subscription add to cart from collections page

subscription add to cart from collections page

ELIJAH09
Visitor
1 0 0

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.

Reply 1 (1)

KingBensley21
Visitor
1 0 0

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:

  1. 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.

  2. 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.

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

  • Automatic sync between product and collection pages, ensuring your customers always see the correct subscription options regardless of where they add products to the cart.
  • Flexible subscription plans that fit your business model, including recurring payments, mixed purchase options, and more.
  • Easy integration with your theme and other apps, allowing you to get up and running quickly.
  • Dedicated support to help with any technical issues like the one you're facing.

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!