oc-mall-plugin icon indicating copy to clipboard operation
oc-mall-plugin copied to clipboard

Discount application ordering and priority

Open chrisvidal opened this issue 2 years ago • 5 comments

I think this is a problem with ordering and priority of application of discounts.

Let's say we have a discount 'FREE SHIPPING' for any order total above 50$. Let's say we have a cart containing items for a total price of 55$. So the free shipping will apply. Let's say the customer apply a discount code giving him back 10$. So the new order total is 45$.

But the FREE SHIPPING stills applies automatically, and I guess it shouldn't since the total is now 45$.

EDIT: using MALL 1.13.5 and October v1 (472)

chrisvidal avatar Dec 07 '21 10:12 chrisvidal

Discount coupons are calculated for products total price not for whole order, I believe.

martinkuch avatar Dec 07 '21 17:12 martinkuch

yes indeed but this is not the issue at play here. The issue is that the alternate shipping still applies when it should not.

chrisvidal avatar Dec 08 '21 03:12 chrisvidal

my bad, I just realized my mistake.

It is not an alternate shipping discount that is applied, it is a shipping method that becomes available when the order is above a certain amount.

So, still the problem appears as the shipping method appears even after the application of the discount code.

image

chrisvidal avatar Dec 08 '21 04:12 chrisvidal

any updates on this please?

chrisvidal avatar Jan 04 '22 07:01 chrisvidal

Hi @chrisvidal

I've had a similar issue, ended up modifying this line of code here,

https://github.com/OFFLINE-GmbH/oc-mall-plugin/blob/98a5028b854699fca1bf7e07e36be9a6cd13db8c/models/ShippingMethod.php#L157

Where I've subtracted the discount total, so the correct shipping method will return.

Then, the $total variable is sent here,

https://github.com/OFFLINE-GmbH/oc-mall-plugin/blob/98a5028b854699fca1bf7e07e36be9a6cd13db8c/models/ShippingMethod.php#L196

Where it would return the correct shipping method.

georgij- avatar Nov 17 '23 11:11 georgij-