Add subscription simple product
↑ Back to topDescription:
ssd_add_simple_product_before_calculate_totals – fired after a new simple product has been added to the subscription.
Usage:
add_action( 'ssd_add_simple_product_before_calculate_totals', function( $subscription, $product ) { // custom code }, 10, 2 );
Attributes:
$subscription – Subscription object data;
$item_id – The ID of the item with quantity updated;
$product – Product object data.
Add subscription variable product
↑ Back to topDescription:
ssd_add_variable_product_before_calculate_totals – fired after a new variable product has been added to the subscription.
Usage:
add_action( 'ssd_add_variable_product_before_calculate_totals', function( $subscription, $product, $variable_id ) { // custom code }, 10, 3 );
Attributes:
$subscription – Subscription object data;
$product – Product object data;
$variable_id – The product variable id.
Filter for changing “Switch item” button text
↑ Back to topDescription:
ssd_switch_item_text’ – allow text change on “Switch item” button.
Usage:
add_filter( 'ssd_switch_item_text', 'custom_switch_item_text', 10, 1 ); function custom_switch_item_text( $text ) { return 'Change monthly hapé'; }
Attributes:
$text – The button text.
Filter “Add new product” query arguments
↑ Back to topDescription:
ssd_product_query_args – allows query arguments change. The filter allows you to change the WP_Query parameters used to get the products the user sees when adding a new item on a Subscription.
Usage: add_filter( 'ssd_product_query_args', function( $args ) { // custom code return $args; }, 10, 1 );
Attributes:
$args – wc_get_products arguments.
Filter “Add new product” product object
↑ Back to topDescription:
ssd_add_new_product_list – allows query arguments to change. The filter allows you to manipulate the object containing the list of products the user sees when adding a new item to a Subscription.
Usage: add_filter( 'ssd_add_new_product_list', function( $products ) { // custom code return $products; }, 10, 1 );
Attributes:
$products – products object.
Pause subscription until date
↑ Back to topDescription:
ssd_pause_subscription – fired after the subscription is paused.
Usage:
add_action( ssd_pause_subscription, function( $subscription_id, $pause_date ) { // custom code }, 10, 2 );
Attributes:
$subscription_id – Subscription id;
$pause_datet – The date until the subscription it’s paused.
Quantity update hook before calculating totals
↑ Back to topDescription:
ssd_quantity_update_before_calculate_totals – fired after the subscription item quantity gets updated.
Usage:
add_action( 'ssd_quantity_update_before_calculate_totals', function( $subscription, $item_id, $qty ) { // custom code }, 10, 3 );
Attributes:
$subscription – Subscription object data;
$item_id – The ID of the item with quantity updated;
$qty – The new quantity for the item.
Update subscription variable item before calculating totals
↑ Back to topDescription:
ssd_update_variable_item_before_calculate_totals – fired after the subscription variable item gets updated.
Usage:
add_action( 'ssd_update_variable_item_before_calculate_totals', function( $subscription , $item_id, $product, $variation_id ) { // custom code }, 10, 4 );
Attributes:
$subscription – Subscription object data;
$item_id – The ID of the item with quantity updated;
$product – Product object data;
$variation_id – Variation ID;
Filter for changing the date format in the date picker used by the Change next payment date and Pause subscription functionalities
↑ Back to topDescription:
ssd_custom_date_format – a filter that can be used for changing the date format in the date picker used by the Change next payment date and Pause subscription functionalities
Usage:
add_filter( 'ssd_custom_date_format', function ( $date_format ) { return 'y-m-d'; }, 10, 1 );
Attributes:
$date_format – the date format
Supported date formats can be found here.
Back to main documentation.