Skip to content

Instantly share code, notes, and snippets.

View gedex's full-sized avatar
🏠
Working from home

Akeda Bagus gedex

🏠
Working from home
View GitHub Profile
{
"id": "stripe",
"title": "Stripe",
"description": "Pay with your credit card via Stripe. TEST MODE ENABLED. In test mode, you can use the card number 4242424242424242 with any CVC and a valid expiration date or check the documentation \"<a href=\"https://stripe.com/docs/testing\">Testing Stripe</a>\" for more card numbers.",
"order": 4,
"enabled": true,
"method_title": "Stripe",
"method_description": "Stripe works by adding credit card fields on the checkout and then sending the details to Stripe for verification. <a href=\"https://dashboard.stripe.com/register\" target=\"_blank\">Sign up</a> for a Stripe account, and <a href=\"https://dashboard.stripe.com/account/apikeys\" target=\"_blank\">get your Stripe account keys</a>.",
"settings": {
"title": {
HTTP/1.1 200 OK
Server: nginx
Date: Mon, 24 Jul 2017 11:07:07 GMT
Content-Type: application/json; charset=UTF-8
Transfer-Encoding: chunked
Connection: keep-alive
X-Robots-Tag: noindex
Link: <https://local.wordpress.dev/wp-json/>; rel="https://api.w.org/"
X-Content-Type-Options: nosniff
Access-Control-Expose-Headers: X-WP-Total, X-WP-TotalPages

Activate the WooCommerce Stripe Gateway


url_path: /wp-admin/plugins.php?plugin_status=search&s=stripe

I click Activate under WooCommerce Stripe Gateway plugin.

I see Plugin activated. notice and following links displayed under WooCommerce Stripe Gateway:

url_path
/wp-admin/plugins.php?plugin_status=search&s=stripe

Activate the WooCommerce Stripe Gateway


url_path: /wp-admin/plugins.php?plugin_status=search&s=stripe

Activate the WooCommerce Stripe Gateway

url_path: /wp-admin/plugins.php?plugin_status=search&s=stripe

I click Activate under WooCommerce Stripe Gateway plugin.

I see Plugin activated. notice and following links displayed under WooCommerce Stripe Gateway:

  • Settings
  • Docs

Activate the WooCommerce Stripe Gateway

start_path: /wp-admin/plugins.php?plugin_status=search&s=stripe

I click Activate under WooCommerce Stripe Gateway plugin.

I see Plugin activated. notice and following links displayed under WooCommerce Stripe Gateway:

Activate the WooCommerce Stripe Gateway

start_path: /wp-admin/plugins.php?plugin_status=search&s=stripe
tags: fresh-install

Click Activate under WooCommerce Stripe Gateway plugin.

I see Plugin activated notice and following links displayed under WooCommerce Stripe Gateway:

Activate the WooCommerce Stripe Gateway

start_path: /wp-admin/plugins.php?plugin_status=search&s=stripe
tags: fresh-install, pre-checkout

Click Activate under WooCommerce Stripe Gateway plugin.

I see Plugin activated notice and following links displayed under WooCommerce Stripe Gateway:

<?php
add_filter( 'post_class', function( $classes, $class = '', $post_id = '' ) {
$product = wc_get_product( $post_id );
if ( ! $product ) {
return $classes;
}
if ( class_exists( 'WC_Pre_Orders_Product' ) && WC_Pre_Orders_Product::product_can_be_pre_ordered( $product ) ) {
$classes[] = 'pre-order';
@gedex
gedex / custom_rule_cost_distance_shipping.php
Created August 30, 2017 06:31
Override rule cost for distance shipping when destination within 5miles of shop AND order total over $100
<?php
add_filter( 'woocommerce_distance_rate_shipping_rule_cost_distance_shipping', function( $rule_cost, $rule, $distance, $package ) {
$order_total = $package['contents_cost'];
if ( $order_total > 100 && $distance <= 5 ) {
$rule_cost = 0;
}
return $rule_cost;
}, 10, 4 );