Personalized checkout and custom promotions with Shopify Scripts
How to I write a script in ruby when customer selects product A and Product D. the customer must get 30% off and freeshipping into the cart.
Solved! Go to the solution
This is an accepted solution.
Hi @WizardofDeath,
Apologies for the delay in getting back to you. I've attached the two scripts to this post. Make sure you copy them to the correct script type in the Script Editor app.
Let me know if the solution worked for you!
Matthew
Hi maltanvi,
The script can be written in many different ways. A few clarifications can help make sure you get the script/code you are looking for.
This will require two separate scripts, a Line Item script (for the 30% off) and a Shipping script (for free shipping). Those scripts will need to be added to the Script Editor app. Be sure you have that installed. I will await your clarifications before starting on the script.
Matthew
HI Matt, Thanks for the reply.
We will identify the products using their product id's. Customer will get 30% off on the product bundle.
Lets say there is product A in cart. but there is not product D -> In such scenario there will be no discount
But if there is product A and Product D in cart then customer will get 30% off on cost of product A and D together.
Product A is $100 and product D is $50 then customer will get 30% off on $150.
If there Product A and D are found in customers cart then they will get FREESHIPPING as well.
The country zone for the same will be only USA and Canada.
in short -> product A + product D in customers cart = 30% off + freeshipping (only for USA and Canada)
This is an accepted solution.
Hi @WizardofDeath,
Apologies for the delay in getting back to you. I've attached the two scripts to this post. Make sure you copy them to the correct script type in the Script Editor app.
Let me know if the solution worked for you!
Matthew
Dropshipping, 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, 2024In today’s interview, we sat down with @BSS-Commerce to discuss practical strategies f...
By JasonH Nov 13, 2024