How do I implement subscriptions on the product page?

To implement subscriptions on your product page you’ll need to add some code to your themes product.twig file that allows customers to see the available subscription plans and select the one they want.

The code snippet below provides radio options that will allow customers to select a subscription plan (or select that they would like to make a one-time order if the product doesn’t require a subscription).

<div v-if="has_subscription_plans">
   <div v-for="plan in subscription_plans">
       <input type="radio" name="subscription" :id="'subscription-' +" @click="selectSubscriptionPlan(" :checked="has_selected_subscription_plan && ===">
       <label :for="'subscription-' +">
           <span v-text=" + ' ' +"></span>
           <span v-if="plan.has_saving_price" v-text="'saving: ' +"></span>
   <div v-if="!requires_subscription_plan">
       <input type="radio" name="subscription" id="one-time-order" @click="deselectSubscriptionPlan()" :checked="!has_selected_subscription_plan">
       <label for="one-time-order">
           One-time order

Articles in this section

Was this article helpful?
0 out of 0 found this helpful