1. Documentation

Self-service Dashboard for WooCommerce Subscriptions | Developer Hooks

Make sure you have a child theme or otherwise this code will get deleted by WordPress when you will update the theme next time.

Add subscription simple product ↑ Back to top

Description:
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 top

Description:
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.

Change “Switch item” button text ↑ Back to top

Description:
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.

Pause subscription until date ↑ Back to top

Description:
ssd_pause_subscription – fired after the subscription is paused until date.

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 calculate totals ↑ Back to top

Description:
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 calculate totals ↑ Back to top

Description:
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;

Back to main documentation.

WooCommerce - the most customizable eCommerce platform for building your online business.

  • 30 day money back guarantee
  • Support teams across the world
  • Safe & Secure online payment