1
votes

I am trying to add a discount code in the admin panel to "FREEGIFT" buy x get y, so when the customer add any product in the cart, he can proceed to the checkout page where we have the Discount code field, but my issue is, in Shopify the customer needs to add both x and y to the cart in order to get the discount code, which is not working for me. So, what i was trying to do is, editing the checkout page to get the input value, if it is equal to "FREEGIFT" then add the gift product to the cart page. But i figured out that we can't access the checkout page code or add any javascript code. So what do you suggest? i appreciate any help.

Thank you in advance.

1
Welcome to SO. You might find reading the site help section useful when it comes to asking a good question. To get the best answers to your question we like to see that you've attempted to solve the problem yourself first using a minimal reproducible example. Here's a question checklist you might find useful.. - Andy
You can't update the checkout pages in Shopify, if you don't have Shopify plus account, you need to update the theme and make logic on the cart page and utilize the code on there with custom code. - Onkar

1 Answers

2
votes

I hope this would help you. You can try Automatic Discount whose type is Buy X get Y here you can add your discount quantity item-wise or purchase amount wise and add your discount AT A DISCOUNTED VALUE as free.

If you have further clarification refer to this link: https://help.shopify.com/en/manual/discounts/automatic-discounts