Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
i started a new store which sells supplement products and i try to push subscriptions. when you add to cart from the product page the subscription is automatically added to cart as i have made that the default. but when you add to cart from a collections page, the one time purchase is added to cart and not the subscription. i have searched youtube but there are no videos on how to fix this. please can anyone with coding skills help.
Hi @ELIJAH09
It sounds like you’re facing an issue where subscriptions are being added by default on the product page but not when adding from the collections page. This is likely because the code handling subscriptions on the product page hasn't been applied to your collections page.
To fix this, you'll need to modify the code that handles the "Add to Cart" functionality on your collections page to ensure it triggers the subscription logic, similar to the product page. Here’s a quick guide on how you can approach it:
Check your theme's collection-template.liquid: You'll need to add the same subscription logic here that exists in your product page template. You can find it in the product's product-template.liquid.
Modify JavaScript handling: If your subscription functionality is triggered via JavaScript, make sure the same script is called on both the product and collection pages. Typically, the code differentiating between one-time purchases and subscriptions should be added to the cart button on your collection pages as well.
Identify your subscription option: If you’re using a specific subscription app, it may have some guidelines for implementing this on the collection page. Check the app's documentation to ensure that its code is placed in the right spots for both product and collection pages.
On that note, if you're looking for a more seamless solution for managing subscriptions across both product and collection pages, I’d recommend checking out Trust Subscriptions. It’s a highly customizable and user-friendly subscription app built specifically to handle scenarios like this. With Trust Subscriptions, you’ll get:
Feel free to give Trust Subscriptions a try! We offer comprehensive onboarding support to ensure that your subscription setup works flawlessly.
I hope this helps! If you have any questions or need more assistance, feel free to reach out.
Best of luck with your store and subscriptions!
Starting a B2B store is a big undertaking that requires careful planning and execution. W...
By JasonH Sep 23, 2024By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024