Overwriting discounts based on MSRP

Hello all,

Use case:

  • I have a product bundle in my cart.

  • The bundle equates to 30% off if the items were to be purchased separately.

  • If a customer finds a coupon code and applies it, I would like the price to take the discount from that original ‘purchased separately’ price.

    Example:

    • $70 bundle with 2 products in it for $75 and $25 each. (30% discount)
    • User finds a discount code for 20% off and applies it
    • The final price should now be $80 (20% off MSRP) . NOT $50 (20% off the bundle price)

Theres a company called CozyEarth that does this, and it appears theyre using something called Cart.JS.

Any ideas?

To implement this functionality, you can create a custom discount code in Shopify that applies a percentage discount to the original, non-discounted price of each individual product in the bundle.

When a customer applies the discount code, you can use Shopify’s API to calculate the new discounted price for each product in the bundle, and then calculate the total price of the bundle based on those individual discounted prices.

Here’s an example workflow:

  1. Create a discount code in Shopify that applies a percentage discount to each individual product in the bundle.
  2. When a customer applies the discount code, use Shopify’s API to retrieve the original, non-discounted price of each product in the bundle.
  3. Calculate the new discounted price of each product by applying the discount code to the original price.
  4. Calculate the total price of the bundle based on the discounted prices of each product.
  5. Display the new bundle price to the customer.

You can use a Shopify app or a custom script to implement this workflow. Cart.js is a JavaScript library that can help you build custom cart functionality, but it’s not necessary to use it for this specific use case.