Re: Script Editor, apply discount on compare price

Script Editor, apply discount on compare price

evanchristians
Visitor
3 0 0

Hi all,

I'd like to apply discounts to line items compare prices at checkout with the following conditions, but unsure how to approach the problem.

If there is a percentage discount code applied to the cart I'd like to apply that discount to the compare price and not the sale price if the discounted compare price is less than the current sale price otherwise it should not be discounted at all.

To better illustrate the behavior I'd like to achieve, consider I've got the following input cart:


CP: Compare Price

P: Current Sale Price
Discount Code: 50%

Line Items:
1. itemA P: $40 CP: $100
2. itemB P: $60 CP: $100
3. itemC P: $100 CP: 0

I need my output cart to be:

1. itemA $40 $100
2. itemB $50 $100
3. itemC $50 $100



If anyone has some insights regarding this, I would greatly appreciate if you could provide some assistance 🙂

Reply 1 (1)

Garyblanker
Visitor
2 0 2

Did you find a way to do it? I'm having the same problem.