How to add subscriptions to simple and variable products in WooCommerce?

Featured, WooCommerce
How to add subscriptions to simple and variable products in WooCommerce?

How to add subscription plans to your existing products on WooCommerce?

How can I set this up so customers can purchase the product one-time as well as see the options to subscribe every month, every 2 months, or every 3 months?

All on one product page?

all-products-for-woocommerce-subscriptions

Simon’s Coffee (see example)

In this guide, you will learn best practices for setting up the All Products for WooCommerce Subscriptions extension on your WooCommerce site.

To setup your product page this way you also need to have the WooCommerce Subscriptions extension too.

If you are more of a visual learner, checkout our video tutorial below or see our FAQs.

Let’s begin!

How to setup All Products for WooCommerce Subscriptions?

  1. Download and activate WooCommerce Subscriptions and All Products for WooCommerce Subscriptions plugins
  2. Add snippet to functions.php file
  3. Override the product-subscription-options.php file
  4. Add subscription to existing products
  5. Make sure payment methods work and do a test checkout

Step 1. Download and activate WooCommerce subscription plugins

The first step is to purchase, download and activate the following plugins on your WooCommerce store:

WooCommerce Subscriptions
All Products for WooCommerce Subscriptions

Before going to Step 2, make sure both plugins are not only installed but also activated.

I also recommend taking a backup of your site or testing this on a staging site.

Step 2. Copy/paste code snippet into functions.php

  1. First, go to your active WordPress theme via SFTP or SSH.
  2. Next, open up the functions.php file.
  3. Then, copy/paste the functions.php code snippet to the bottom of your functions.php file.
  4. Save your file.

View code snippet

The file path will be [your-active theme]/functions.php.

Step 3. Override the product-subscription-options.php template file

  1. First, go to your active WordPress theme via SFTP or SSH.
  2. Next, create a ‘woocommerce’ folder inside your active WordPress theme if you have not already. This will allow you to override WooCommerce files.
  3. Then, inside the /woocommerce/ folder, create another folder titled ‘single-product’.
  4. Next, create a file inside your /woocommerce/single-product/ folder called product-subscription-options.php.
  5. Copy the code snippet and paste into your newly created product-subscription-options.php file.
  6. Finally, save your file.

View code snippet

The file path will be [your-active theme]/woocommerce/single-product/product-subscription-options.php.

Note: you could also right click and download the code snippet for the product-subscription-options.php file. Then upload the file inside the /woocommerce/single-product/ folder.

Step 4. Add subscription to existing product

Next, on your WooCommerce dashboard, navigate to Products and choose a product you want to offer a subscription.

Edit the product, scroll down to the Product Data section, and click the “Subscriptions” tab.

woocommerce-subscriptions-tab-edit-product

Then, click “Add Plan” to add your subscription plans.

woocommerce-subscriptions-add-plan-to-existing-product

For example, in my store, I want to offer a subscription on a product with the following intervals:

  • Every month
  • Every two months
  • Every three months

Because subscriptions mean more recurring revenue, I’m going to offer my customers 10% off if they choose a subscription.

See the screenshot below for how my setup looks like:

woocommerce-subscriptions-add-to-existing-product-simple

Finally, I’m going to click “Save” and view my product on my store.

When I navigate to my product page, I see the one-time option as well as the subscription options.

woocommerce-subscriptions-one-time-subscription-options-product-page

If you do not see a ‘help icon’ on your product page, that means you do not have Font Awesome enabled on your site.

woocommerce-subscriptions-subscribe-save-help-icon

Install the free Better Font Awesome plugin to get the help icon to show on the product page.

Solve this by installing the free Better Font Awesome plugin.

Congrats! You have setup a subscription for an existing product.

Step 5. Check payment methods and do test checkout

First, navigate to WooCommerce > Settings and click the “Payments” tab.

Next, look at the Automatic Recurring Payments column.

Does your current payment method support Automatic Recurring Payments?

woo-subscriptions-payments-automatic-recurring-payments

Then, go back to your shop and go to a product page where you are offering a subscription.

Choose a subscription option you have setup and go complete a test order.

Did everything come through correctly?

Finally, navigate back to the backend of your WooCommerce store and click “Orders”.

Because this was the first subscription order you created, you should see the parent order icon.

Reference the screenshot below for the difference between the parent order icons and the renewal order icons.

woocommerce-subscriptions-order-icons

Video Tutorial

If helpful, I also created a video that goes through this process.

If you have not setup WooCommerce Subscriptions, see this video to learn how!

Summary

So there you have it.

That’s how you apply subscriptions to existing products on your WooCommerce store.

After setting up subscriptions on your store, let your customers know that you now offer subscriptions.

This is a good excuse to send a marketing email! You could use the WooCommerce Follow-Ups plugin or your own email marketing provider.

A lot of your customers are going to be thrilled to know they do not have to worry about reordering your product manually anymore!

If you would like to reference how the subscriptions are setup on a store, take a look at the sample product I setup here: sample product

Pro Tip: before publishing this live on your store, ensure you have gone through the “Subscriptions” tab in the WooCommerce Settings.

Comments

  1. Ollie August 15, 2019 | 1:04 am

    Hi – I left a comment on your youtube channel asking how to have a drop down box to select frequency of shipping and a hover Tooltip for information. Can you please send me instructions on how to do this? It would be greatly appreciated! Regards, Ollie

    • Simon Gondeck October 2, 2020 | 2:40 am

      Hey Ollie: thank you for your patience! The post now contains the updated code snippets. Can you retry adding this to your site? Cheers!

  2. Ollie September 3, 2019 | 9:16 pm

    Hi There,

    Is it possible for you to please provide me with the appropriate code to install the dropdown option on the subscription frequency, as shown in your youtube video?

    Regards, Ollie

    • Simon Gondeck September 16, 2019 | 12:21 pm

      Hi Ollie, I posted the code snippet in the blog post. You will need to paste this into your active WordPress theme with the file path: [active theme]/woocommerce/single-product/product-subscription-options.php. Thanks!

  3. MIke September 18, 2019 | 10:32 am

    Hey Ollie, will your solution work for this scenario?
    I have a product with 3 different quantities (30pack, 60pack, 90pack).
    I’d like to offer a one time purchase for each as well as 2 subscription options for the 60 and 90 pack (every month, every 2 months)
    is this possible with your code above?

    Mike

  4. Enamul Haque October 17, 2019 | 12:52 pm

    Hi I have followed your instruction and but it is showing an error. could you please check it. note:

    : Uncaught Error: Call to undefined function get_company_name() in /woocommerce/single-product/product-subscription-options.php:119
    Stack trace:
    #0 plugins/woocommerce/includes/wc-core-functions.php(249): include()
    #1 plugins/woocommerce-subscribe-all-the-things/includes/display/class-wcs-att-display-product.php(166): wc_get_template(‘single-product/…’, Array, false, ‘/home/customer/…’)
    #2 wp-content/plugins/woocommerce-subscribe-all-the-things/includes/display/class-wcs-att-display-product.php(249): WCS_ATT_Display_Product::get_subscription_options_content(Object(WC_Product_Simple))
    #3 wp-includes/class-wp-hook.php(286): WCS_ATT_Display_Product::show_subscription_options(”)
    #4 /home/customer/www/divinohair in

    • Simon Gondeck October 2, 2020 | 2:39 am

      I updated the post with updated code snippets. Can you retry? Thanks!

  5. Dale October 28, 2019 | 5:52 pm

    Hey Simon, thanks for the guide on this. I’ve been trying to accomplish having monthly subscription and one off orders on single product pages without any luck.

    I have tried using your code snippet on my child theme but I am receiving this error:

    “The site is experiencing technical difficult”

    ——–

    Would love to get some feedback, maybe the code works for a certain version of the plugins?

  6. Ryan November 4, 2019 | 10:04 pm

    Hi Ollie and Simon,

    Copying the code via ftp just as you said actually just causes an error and the page does not display at all. Is this dependent on what them or product template builder (elementor) is installed? I’d really like to implement this!

    Thank you

    • Simon Gondeck October 2, 2020 | 2:41 am

      Hey Ryan, I made a mistake when adding the code snippets and forgot to include a closing jQuery tag. Can you go through the post again and see if you are able to solve this problem? Let me know if you have any issues. Cheers!

  7. Rocky November 5, 2019 | 6:58 pm

    Hi simon,
    After add that code in my child theme in this folder http://prntscr.com/pszvgo
    I got error http://prntscr.com/pszv6z
    could you please help?

    • Simon Gondeck October 2, 2020 | 2:31 am

      Hey Rocky, I know it’s been almost a year since I have responded but I updated the code snippets. Can you try going through the blog post again and using the updated snippets? Cheers!

  8. Cat Russell January 12, 2020 | 4:24 am

    I really loved the look of this but it is causing an error on my site also as reported by some other people.
    Any ideas what the issue could be?

    • Simon Gondeck April 5, 2020 | 1:33 am

      Hey Cat! I finally had a chance to update these snippets. Could you try again and see if you can get working on your site? Thanks!

  9. Scott April 6, 2020 | 4:18 pm

    Hi the discount is not being applied in the cart after the subscription is added. Also the reoccurring payment notice is not being displayed in the cart. Ive create the directories and files step by step. Thanks!

    • Gabriel July 16, 2020 | 11:28 pm

      Yea having the same issue but going to see if I can figure out why

      • Simon Gondeck October 2, 2020 | 2:32 am

        I updated the code snippets for this post and re-tested. Can you try going through the blog post and using the updated snippets? Let me know how it goes!

    • Genesis September 20, 2020 | 4:01 pm

      I’m having the same problem. Can someone help with this?

      • Simon Gondeck October 2, 2020 | 2:27 am

        Hey Scott, thank you for your patience. I made a mistake when adding the code snippets and forgot to include jQuery. Can you go through the post again and see if you are able to solve this problem? Let me know if you have any issues. Thanks!

  10. Ivan May 16, 2020 | 1:15 am

    Didnt work for me. Website didnt break, but also didnt get subscription tab in my single products

    • Moldy September 2, 2020 | 5:10 pm

      same here

      • Simon Gondeck October 2, 2020 | 2:38 am

        I updated the post with updated code snippets. Can you retry? Thanks!

  11. GRIFFIN July 1, 2020 | 11:54 pm

    My Product price is getting injected with save XXXX every xx months and its duplicating is there a way to fix this? I also offer memberships on my site and they are tied to specific products, is there a way to turn off the subscribe section for people who are already members?

  12. Michael July 10, 2020 | 1:03 pm

    This might be an odd question, but what exactly is the need to add functions and snippets provided. You don’t really ever explain what they are for. Your video for “All Products for WooCommerce Subscriptions” doesn’t mention them at all, and seems to have all the needed functionality. i.e. the plugins seem to work out of the box, so why the modifications.

    Can you clarify what your modifications do and/or what problems they are attempting to solve?

  13. Michael July 10, 2020 | 1:59 pm

    Kinda figured this out, but the function or template is messing up the Subscription option label, as it’s combining the two into “Subscribe and save 3% every One-time purchase Subscribe and save 3%” (see screenshot – https://www.dropbox.com/s/u7aute25wb3dlv3/Screenshot%202020-07-10%2011.56.23.png?dl=0)
    I entered “Subscribe and save 3% every” in the Title field, but it’s getting mangled.
    How does one fix this? Thanks.

    • Simon Gondeck October 3, 2020 | 8:05 pm

      To remove the subtext that comes after the price, add the snippet below to your functions.php file.

      add_filter( 'wcsatt_price_html_suffix', 'apfs_remove_suffix', 10, 3 );
      
      function apfs_remove_suffix( $suffix, $product, $args ) {
        return '';
      }
      
  14. Victoria August 26, 2020 | 4:05 pm

    Hey guys, this is exactly what I have been looking for. On the front page the layout is much better than the one out of the box from All Products plugin, but for some reason, once I add the PHP file in the theme, the subscription option doesn’t seem to get chosen? Is there some way to fix this? I followed the instructions exactly as you had them.

    • Simon Gondeck October 2, 2020 | 2:33 am

      Hey Victoria, I apologize for the inconvenience. I forgot to add a closing jQuery tag to one of the scripts and this was causing the issue. Can you retry adding the updated code snippets in this post?

  15. Christian September 2, 2020 | 3:14 am

    “Didnt work for me. Website didnt break, but also didnt get subscription tab in my single products” (ivan)

    same for me….
    Added all Code snippets, files ……but no tab, nothing at all..

  16. Mayank September 4, 2020 | 3:09 pm

    How can we switch from premium plan to free plan after the 14 days trial expire ?

    • Simon Gondeck September 13, 2020 | 1:40 am

      Create a variable product that has 2 variants: Free Plan ($0/month) and Premium Plan ($25/month). Add a 14-day free trial to the Premium Plan. When a customer goes through the Checkout process they will sign up to the Premium Plan. Do you want to allow customers to sign-up without a payment method? If so, go to your WooCommerce settings and check “Allow $0 initial checkout without a payment method”. After customer’s 14-day free trial is over, they would be required to put their payment method down to get access to your Premium Plan.

      Are you currently using a simple product or variant product? Are you using WooCommerce Memberships or anything else that would only show content if user is on the Free Plan?

  17. Tatsat September 16, 2020 | 9:55 am

    I saw your screenshot where you have 10% discount. I have that same thing for my store but I have found out that lately customers are subscribing the the product and then cancelling the subscription before the next one is ordered. This way they are trying to save 10%. Is there any way to tackle that?

    • Simon Gondeck September 16, 2020 | 4:57 pm

      Hey Tatsat, I hear you! Customers are going to always try to take advantage of the system. One thing you could do is install the Enhancer for WooCommerce Subscriptions plugin. This is an add-on plugin for WC Subscriptions and has a “Subscription Cancel Delay feature” that allows you to customize the date customers may start cancelling their subscriptions once they’ve subscribed. This prevents users from cancelling their subscription just before their first renewal to take advantage of subscription pricing.

  18. Cesar October 5, 2020 | 9:49 am

    Hi, Simon, just purchased and installed the plugins, they work great, no issues on the mechanics of the plugin just one text issue, when the product on the website lists the subscription to a One-Time Purchase or a Subscription, the text on the subscription literally reads “One-Time purchase Subscribe from”. How do I change this text to read “Recurring order every:”?

    • Simon Gondeck October 12, 2020 | 11:01 am

      To change this you need to add this snippet to the bottom of your functions.php file or using smth like the Code Snippets plugin as a snippet:

      add_filter( 'wcsatt_price_html_suffix', 'apfs_remove_suffix', 10, 3 );
      
      function apfs_remove_suffix( $suffix, $product, $args ) {
        return 'Save with Recurring Purchase 10%';
      }
      
  19. Sansoa October 14, 2020 | 12:39 pm

    Hey Simon,
    I just need a suggestion regarding this plugin i have used the plugin snippet from its official site to change the select options button into add to cart button in shop page. The problem i am facing now is that the product that is added through shop page add to cart and the other from the single product page are saved differently into cart rather than a single product with increased quantity.
    Below is the link to the snippet and i used last one to change the select option to add to cart button.
    https://docs.woocommerce.com/document/all-products-for-woocommerce-subscriptions/snippets/

    The Screenshot Link:
    https://imgur.com/a/ilkKJrj
    Both products are added as one time purchase but added as different in cart. Don’t have any idea how to solve it.

    • Simon Gondeck October 15, 2020 | 6:07 pm

      Hey Sansoa, do you have a product page link you could send to test? Are you sure both of the products are “one-time purchases” instead of 1 as a subscription and 1 as a one-time purchase?

  20. David B. October 18, 2020 | 7:41 pm

    Thanks for the tutorials on this and WooCom in general. We sell bags of produce which we deliver. To encourage people to buy more than one bag, we offer a discount for multiple bags to the same address. ($5 off for each bag delivered to the same address.) You covered how one could set up automatic discounts over time, (bar of soap is discounted 10% when subscribing), but how would you set it up to discount multiples of the same product as a one off as well as a subscription using this extension?

  21. Jay R. October 19, 2020 | 3:26 pm

    Simon,

    This is a huge help, thank you first and foremost.

    I am not a developer by any means, and use builders to develop the sites for my clients. I have got almost everything in place, but just cannot figure out how to have this thing display properly. Here is a link to the page as it stands now:
    https://phazenaturals.com/product/500mg-full-spectrum-hemp-cbd-oil-p1/

    As you can see the QTY box and the drop down box do NOT align, but more importantly, the ADD TO CART button displays as the height of all of the elements to the left of it. Looks even worse on mobile.

    Can you help with this so it displays properly for me?

    Thanks,
    Jay

    • Simon Gondeck October 19, 2020 | 10:47 pm

      Hey Jay,

      It looks like CSS from Elementor is conflicting. I would add the following CSS to your theme, Elementor, or somewhere in WordPress.
       

      .elementor-product-simple form.cart {
      	display: block !important;
      }

       
      If you also wanted to add a background color based on the one-time vs. Subscribe like the screenshot below, add this as well:

      woocommerce-subscriptions-one-time-vs-subscribe-option

      .single-product .purchase-options li.selected {
          background-color: #edebe6 !important;
      }

       
      To line up your radio buttons better you also could add this too:

      margin: 0 6px 0px 0 !important;
        height: 1em !important;
        width: 1em !important;
      }

       
      To remove the suffix appended to the price (i.e. “— or $36.00 $32.40 / month”), add the following as a code snippet or to your functions.php file:

      add_filter( 'wcsatt_price_html_suffix', 'apfs_remove_suffix', 10, 3 );
      
      function apfs_remove_suffix( $suffix, $product, $args ) {
        return '';
      }

      remove-suffix-all-products-subscriptions
       
      Overall, it also looks like you do not have a child theme installed with Astra. If you installed a child theme it would be easier to add in CSS customizations in the future but not required. See more at this link.

  22. Dan October 22, 2020 | 9:29 am

    Hello –

    I was able to create the file “product-subscription-options.php” but I am unable to move it under the subfolder woocommerce/single-product. How do you move .php files within WordPress?

    Thanks,
    Dan

    • Simon Gondeck October 23, 2020 | 4:36 pm

      Hey Dan, what hosting provider are you using? You would need to connect using FTP or SFTP credentials using FileZilla or another FTP client. You could get your SFTP credentials through your hosting provider. Another option would be to use the Advanced File Manager plugin.

  23. Sam October 27, 2020 | 9:58 pm

    Is there a way to allow the customer to select the length of the subscription? Also is there a way to have this work with Min/Max Quantities plugin so that every 3months would default and force them to purchase a qty of 3?

  24. Joe M November 11, 2020 | 6:09 am

    Hi. Using the All Products for WooCommerce Subscriptions plugin extension and it is working as planned… Allows a product to be purchased as either an one time or as a subscription. (I also have traditional subscription only products setup through the standard woo subscriptions plugin.) The last thing im trying to get to work is to setup promos that work with subscriptions. Looking to provide a free product whenever a subscription product is added to cart. Using advanced coupons and setup an auto apply coupon to do this, but it only works when the one time purchase option of the product is added. When a subscription version is selected, the coupon doesn’t get applied. Seems to have something to do with a subscription variation of thx product but I can’t figure out how to set it up for this use case. Any help would be greatly appreciated.

    • Simon Gondeck November 13, 2020 | 9:03 pm

      Hey Joe, I do not use the Advanced Coupons plugin but looking briefly at their Premium version it looks like they have ‘Cart Conditions’ if you edit a coupon and go to the “Usage restriction” tab. For example, I would look at adding conditions like Custom Cart Item Meta contains _wcsatt_schemes.

  25. Daniel November 11, 2020 | 6:25 am

    Hey Simon! Thanks for this fantastic writeup. Do you know of any way of HIDING subscriptions from users with particular roles? We use the “Wholesale For WooCommerce” plugin and we don’t want our wholesale customers to see the subscription offers.

    • Simon Gondeck November 16, 2020 | 6:05 pm

      You could add a conditional near the top of the product-subscription-options.php file or smth in your functions.php file. For example, smth like this:

      $user = wp_get_current_user();
      
      if (!get_user_meta($user->ID, 'wholesale_level', true)) {
      
      --insert line 6 to line 61 in the product-subscription-options.php file --
      
      }

      I do not know how the Wholesale for WooCommerce setups wholesale user roles. You could also reach out to them.

Leave a reply

Comment policy: We love comments and appreciate the time that readers spend to share ideas and give feedback. However, all comments are manually moderated and those deemed to be spam or solely promotional will be deleted. Your email address will not be published. Required fields are marked*

FAQ

Subscriptions

All Products for WooCommerce Subscriptions
I am using Elementor and the Add to Cart button is TALL and not WIDE.

It looks like CSS from Elementor is conflicting. I would add the following CSS to your theme, Elementor, or somewhere in WordPress.

.elementor-product-simple form.cart {
	display: block !important;
}

If you also wanted to add a background color based on the one-time vs. Subscribe like the screenshot below, add this as well:

woocommerce-subscriptions-one-time-vs-subscribe-option

.single-product .purchase-options li.selected {
    background-color: #edebe6 !important;
}

To line up your radio buttons better you also could add this too:

margin: 0 6px 0px 0 !important;
  height: 1em !important;
  width: 1em !important;
}

To remove the suffix appended to the price (i.e. “— or $36.00 $32.40 / month”), add the following as a code snippet or to your functions.php file:

add_filter( 'wcsatt_price_html_suffix', 'apfs_remove_suffix', 10, 3 );

function apfs_remove_suffix( $suffix, $product, $args ) {
  return '';
}

remove-suffix-all-products-subscriptions

How to remove the “-subscribe and save X%” from the product price?

To remove the subtext that comes after the price, add the snippet below to your functions.php file.

add_filter( 'wcsatt_price_html_suffix', 'apfs_remove_suffix', 10, 3 );

function apfs_remove_suffix( $suffix, $product, $args ) {
  return '';
}

If you do not feel comfortable adding this to your theme’s functions.php file, install the Code Snippets plugin and add the code snippet above.

How does this differ from a variable subscription product?

If you setup a variable product subscription all you can do is set variants for a specific billing period (i.e. every month, every 2 months, every 3 months). There is no option to offer a one-time purchase without making a new product and making the customer go to 2 different product pages. The All Products for WooCommerce Subscriptions plugins allows you to make any simple/variable product available as one-time purchase and subscription, without changing the way your manage inventory. In addition, easily offer discounts as an extra incentive for subscribing, rather than using coupon plugins that may not always work well.

Does it work with variable product?

Yes. The add-on allows you to make any simple or variable product on subscription.

How can I add a one-time coupon code in additional to the subscribe and save discount?

To do this you would need to add an additional coupon with the Discount type set as a “Recurring Product % Coupon”. The coupon should only be valid for the 1st payment. For example, the product costs $59.99. In addition, you also have a subscribe and save option at 20% off for $47.99. You also want to offer a one-time 20% additional coupon off the subscribe and save option so the first purchase is $35.99 instead of $47.99. But the product recurs monthly at the normal subscription price of $47.99.

Sample Product

  • One-time purchase price: $59.99
  • Subscribe every month for 20% off ($59.99 * 0.8): $47.99
  • Subscription price for 1st purchase only ($59.99 * 0.6): $35.99

Subscription price and billing schedule (every month)

  • 1st month (i.e. 1st purchase):  $35.99
  • 2nd month: $47.99
  • 3rd month: $47.99
  • Xth month: $47.99

How to set an additional discount for the 1st purchase only?

You would add the coupon amount to be a 25% recurring product discount since the coupon is applying to the Subscription price (i.e. $47.99 * 0.75 = $35.99).

If you did a 20% recurring product discount (i.e. $47.99 * 0.80) the price would be $38.39.

woocommerce-subscription-coupon-recurring

If you want to have the coupon “auto-apply” you could use the Smart Coupons plugin.

auto-apply-woocommerce-coupon-smart-coupons

Live example

You can test this out by going through the Checkout process with the Sam’s Coffee product: https://coffee.sgwp.dev/product/sams-coffee/

How to give a free product whenever a subscription product is added to the Cart?

To do this, create a new coupon on your WooCommerce store by going to WooCommerce –> Coupons.

Add any conditions on the “Usage Restriction” tab. For example, if a customer purchases Coffee, I am going to give them a Bag of Produce.

Next, purchase the WooCommerce Extended Coupon Features PRO plugin. This plugin has an easy to use “Free products” feature for you to apply your Free products.

woocommerce-coupon-free-product

Click the ‘Miscellaneous’ tab. You can set the coupon to Auto coupon and Apply silently so the customer does not have to enter the coupon code.

woocommerce-coupon-auto-apply

See more info in the docs.

1X Purchase Only
Can I buy 1 subscription product and a non-subscription product on the same order?

Yes, you need to purchase the All Products for WooCommerce Subscriptions extension on your WooCommerce site.

Mixed Cart
What is a mixed checkout in WooCommerce?

A Mixed Checkout in WooCommerce is when a single transaction includes both subscription products and one-time products.

To allow multiple subscriptions and products to be purchased in a single transaction, check the option for the Mixed Checkout setting in your WooCommerce settings under the Subscriptions tab.

woocommerce-subscriptions-mixed-checkout

If you do not want multiple subscriptions and products to be purchased in a single transaction, uncheck the Mixed Checkout setting. If you try to add a product to your Cart, you will see the following message “A subscription has been removed from your cart. Products and subscriptions can not be purchased at the same time.”

woocommerce-subscriptions-no-mixed-checkout