Personalized checkout and custom promotions with Shopify Scripts
Hi everyone,
I am trying to create a script to manage subscription line items in the cart.
I wanted to test things out while using the Script Editor app preview (clicking "Run Script").
I have two doubts.
1) How can I add a product as a subscription to the cart? There is no option to select between plans.
(PS: If there's a way around 1), my original issue might be solved)
2) I created a product that can only be sold as a subscription. When I try to add it to the cart, I get the following error:
How can I test things out for subscriptions in the Script Editor App?
Any insight is highly appreciated.
Thank you very much,
Pedro Costa.
Solved! Go to the solution
This is an accepted solution.
Hi, sorry for the late reply, just noticed the activity!
The issue is really with the editor on the Shopify Scripts app, there is no option to select a selling plan ID there (when adding to the cart input section).
When previewing on the shop, it does work as intended when I select a product with a selling plan associated.
Thanks for the response, for the time being my workaround is just testing stuff with regular one-offs on the Script Editor app and then invert the condition to check if a variant is a subscription or not.
Hi,
This error means that you have to include the selling_plan parameter when adding the product to the cart 😉 I am not sure how you are adding products to the cart in your case, but basically, you jut have to include the selling_plan parameter (which contains selling plan id) on the same level as the id parameter (which contains variant id).
This is an accepted solution.
Hi, sorry for the late reply, just noticed the activity!
The issue is really with the editor on the Shopify Scripts app, there is no option to select a selling plan ID there (when adding to the cart input section).
When previewing on the shop, it does work as intended when I select a product with a selling plan associated.
Thanks for the response, for the time being my workaround is just testing stuff with regular one-offs on the Script Editor app and then invert the condition to check if a variant is a subscription or not.
Thanks for sharing this with the community 🙂 And good job for finding the workaround!
Although it is a bit manual, it does work, thanks! 😀
Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024Hey Community! It’s time to share some appreciation and celebrate what we have accomplis...
By JasonH Nov 14, 2024