Prefix | Length | ID Type & Reference |
---|---|---|
B | 17 | Reference Transaction ID This is also confusingly called "billing agreement" ID in some places, not to be confused with the entirely different type of billing agreement ID starting with "I-" below. |
I | 12 | PayPal Standard Billing Agreement ID in REST API Recurring Payments Profile ID in classic APIs |
P | 24 | Billing Plan 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
<input type="button" onclick="location.href='http://testsubs2.local/checkout/?add-to-cart=56&variation_id=57';" value="Buy Now" /> |
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 | |
function wcs_my_custom_retry_rules( $default_retry_rules_array ) { | |
return array( | |
array( | |
'retry_after_interval' => DAY_IN_SECONDS / 2, // how long to wait before retrying | |
'email_template_customer' => 'WCS_Email_Customer_Payment_Retry', // email customer immediately upon first failed payment | |
'email_template_admin' => 'WCS_Email_Payment_Retry', | |
'status_to_apply_to_order' => 'pending', | |
'status_to_apply_to_subscription' => 'on-hold', |
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_filter( 'woocommerce_subscriptions_update_users_role', '__return_false', 100 ); |
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 | |
function wcs_redirect_to_cart( $url ) { | |
// If product is of the subscription type | |
if ( is_numeric( $_REQUEST['add-to-cart'] ) && WC_Subscriptions_Product::is_subscription( (int) $_REQUEST['add-to-cart'] ) ) { | |
// Redirect to cart instead | |
$url = WC()->cart->get_cart_url(); | |
} | |
return $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
<?php | |
add_filter( 'wcsatt_single_product_one_time_option_description', 'custom_one_time_purchase_string', 12, 2 ); | |
function custom_one_time_purchase_string( $none_string, $product ) { | |
// Alter the value of $none_string to use a custom string | |
$none_string = "One-Time Purchase"; | |
return $none_string; | |
} |
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_action( 'wp', 'auto_add_to_cart_OPC' ); | |
function auto_add_to_cart_OPC() { | |
$product_id = 561; | |
$page_id = 332; | |
if ( is_page( $page_id ) ) { | |
WC()->cart->empty_cart(); |
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_filter( 'woocommerce_payment_complete_order_status', 'wcs_aco_return_completed' ); | |
/** | |
* Return "completed" as an order status. | |
* | |
* This should be attached to the woocommerce_payment_complete_order_status hook. | |
* | |
* @since 1.1.0 | |
* |
OlderNewer