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! 😀
User | RANK |
---|---|
4 | |
2 | |
2 | |
2 | |
2 |
Make the shift from discounts to donations, and witness your business not only thrive fina...
By Holly Dec 4, 2023On our Shopify Expert Marketplace, you can find many trusted third party developers and fr...
By Arno Nov 27, 2023You've downloaded the Search & Discovery app from the Shopify App store, and as you're ...
By Skye Nov 8, 2023