Credit card type | EBANX payment type code | Credit card numbers |
---|---|---|
American Express | amex |
378282246310005 or 371449635398431 |
Aura | aura |
5078601870000127985 or 5078601800003247449 |
Diners Club | diners |
30569309025904 or 38520000023237 |
Discover | discover |
6011111111111117 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Source: https://katienelson.co.uk/developer-acf-counting-repeater-rows-inside-flexible-content/ | |
// The following code doesn’t work with a repeater field if it is part of a flexible content block. | |
<?php | |
if(have_rows('card')): | |
$cards = get_sub_field('card'); | |
$number_of_cards = count($cards); | |
endif; | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function mysite_pending($order_id) { | |
error_log("$order_id set to PENDING", 0); | |
} | |
function mysite_failed($order_id) { | |
error_log("$order_id set to FAILED", 0); | |
} | |
function mysite_hold($order_id) { | |
error_log("$order_id set to ON HOLD", 0); | |
} | |
function mysite_processing($order_id) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Add order again button in my orders actions. | |
* | |
* @param array $actions | |
* @param WC_Order $order | |
* @return array | |
*/ | |
function cs_add_order_again_to_my_orders_actions( $actions, $order ) { | |
if ( $order->has_status( 'completed' ) ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Changes the renewal link for a particular membership to purchase a new one | |
// Old membership will be deleted upon purchase if expired | |
/** | |
* Changes the renewal URL for the trial membership | |
* | |
* @param string $url the renewal URL | |
* @param \WC_Memberships_User_Membership $membership the user membership | |
* @return string $url the updated renewal URL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'woocommerce_dynamic_pricing_process_product_discounts', 'wcdp_exclude_specific_products', 10, 2 ); | |
function wcdp_exclude_specific_products( $include, $product ) { | |
//Adjust this array accordingly. Alternatively use a product category. | |
$products_to_exclude = array( | |
1, | |
101, | |
717 | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function cs_woocommerce_locate_template( $template, $template_name, $template_path ) { | |
global $woocommerce; | |
$_template = $template; | |
if ( ! $template_path ) { | |
$template_path = $woocommerce->template_url; | |
} | |
$plugin_path = untrailingslashit( plugin_dir_path( __FILE__ ) ) . '/templates/'; | |
// Look within passed path within the theme - this is priority |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: WooCommerce Subscriptions No $0 Emails | |
Plugin URI: | |
Description: Do not send processing or completed renewal order emails to customers when the order or renewal is for $0.00. | |
Author: | |
Author URI: | |
Version: 0.1 | |
*/ | |