Installation
- Check that you have the required plugins: Woocommerce and Woocommerce Subscriptions.
- Go to Plugins and click on Add New.
- Upload the plugin zip file and click on install.
- Activate the plugin.
Configuration
- Go to Products and click on Create New.
- Create a simple subscription type of product.
- Create another one or more simple subscription type of products with different terms that is meant for the same product or service.
- Go back to Create New button under Products.
- Create a grouped type of product.
- Go the Linked Products tab under the Woocommerce settings.
- Add the simple subscriptions you created inside the Grouped input box in the Linked Products tab.
Usage
- Go back to the grouped product you created where you linked all the simple subscriptions.
- Notice a new tab was created by the Switching Plugin called Subscription Switch. Go to this tab.
- You can enable the user interface of the switching plugin by either (1) using the shortcode provided in the tab or (2) by clicking on the Show One-page Switch checkbox and saving the product.
- The first option enables you to display it on any page that you want.
- The second option enables you to use the same product page allowing for a normal Woocommerce flow.
Developer
Filter: thsa_sswtch_switching_texts Accepted arguments in order (2):
- Type: Array. Texts and Hexa Decimal (colours) texts returned to display in the user interface. Available indexes: – [‘theme_color’] – [‘button_colors’][‘active_plan_button_color’] – [‘button_colors’][‘available_plan_button_color’] – [‘button_colors’][‘onhold_plan_button_color’] – [‘switch_btn_text’] – [‘switch_alert’] – [‘switch_info’] – [‘switch-small_text’]
- Type: Array. Returns the user status to be able to display different texts depending on the user status. Available indexes: – [‘subscription_id’] – [‘start_date’] – [‘status’] – [‘product_id’] – [‘has_trial’] – [‘trial_period’] – [‘trial_remaining’]
Sample usage in functions.php of your theme:
function edit_language_switch($text_array, $user_status){
if($user_status['status'] === "on-hold"){
$text_array['switch_info'] = "Update your payment to activate this subscription again.";
}
return $text_array;
}
add_filter('thsa_sswtch_switching_texts', 'edit_language_switch', 10, 2);
You can find more info here.