Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
is it possible to apply discount codes in the cart, using the StoreFront API?
I've searched a lot for this, but didn't find a proper solution. Maybe create a checkout and modify it via the API?
When I try to call /api/2021-01/graphql.json with jQuery (from the cart liquid template), it gives me CORS error. how can I avoid that?
noone?
I just need to apply discount on the cart with a private app/ or something
If your store has a Shopify Plus Plan, you can apply a discount automatically by using javascript in the checkout.js file.
If not, you can add a discount code as a url paramenter. The discount will be automatically applied when the user reaches the checkout.
We've tried a couple different solutions (including KartDiscount).
KartDiscount essentially does a call to the checkout page and uses selectors to pull the discounted amount. This works for certain stores, but will eventually time the customer out due to Bot like activity.
We ended up just creating our own solution that hosted on our own server which takes in products & calculates the discount based on however you do discounts (tags/collections)
If you have Shopify plus then you can use the script editor for line item discount which will show up on the cart page. If you don't have Shopify plus then you can manipulate the cart page to display a discount and have a script that will auto-applied the discount code at the checkout page.
Hi there! Here's an answer to your question: https://app.hopps.io/videos/how-do-i-apply-a-discount-on-the-cart-page-178663a7e21. If it doesn't make sense or you still have questions, one of the experts can walk you through the solution.
Looks like we couldn't find this video
Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025Learn how to increase conversion rates in every stage of the customer journey by enroll...
By Shopify Mar 5, 2025