Personalized checkout and custom promotions with Shopify Scripts
I am working on creating a bundle. Currently if XYZ skus are in the card, I have a script that will recognize that and Bundle them together and apply a discount for that bundle. On the other end, adding the products via 1 click.
Let's say that I create a Product page for bundle XYZ skus. I want to just click that "Add to Cart" button and it will automatically put XYZ skus in the cart. So one click can add 3 separate products in the cart. I also need to account for inventory. If one of the skus XYZ is out of inventory. This bundle would not be able to be added to the cart. After that my script can do the calculations for discounts and pricing.
You can use cart API to add individual items to the cart: https://shopify.dev/api/ajax/reference/cart
Just override the add to cart button to call the API
First: you need to look at how the XYZ binding of three products, and get the three products id:
Second: you can call shopify provide API: / cart/add js items inside a parameter value is an array, and then added to this array
You can go to https://shopify.dev/api/ajax/reference/cart ,If you have any do not understand, at any time consulting me.
Hi Ian - I am looking to create a script to adds multiple products (a bundle) from a product page button click, with a discount for the bundle. Would you be willing to share some details about your script that does this? I'm hoping to not use an app do do this - and it sounds like you have done it. Any insight you can provide would be great. Thanks!
-Dave
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