laravelshoppingcart icon indicating copy to clipboard operation
laravelshoppingcart copied to clipboard

Item Conditions always applied to subtotal.

Open audetcameron opened this issue 5 years ago • 6 comments

In checkout I thought subtotal was the price of the cart before any conditions applied. That appears to be how using a cart condition works. However if you apply a condition to an item the calculated condition price is included in the subtotal making it difficult to show the original cost of the items , then show the discounted amount, and then the total. Am I doing something wrong?

audetcameron avatar May 21 '19 13:05 audetcameron

I have the same problem, could you solve it?

diegonella avatar Mar 13 '20 11:03 diegonella

I ended up making a $tempTotal which was a calculated cost of all items in cart before conditions and used that as my new "sub total" in the front-end. I do think if I had time I would make a pr to only apply conditions to the total and never the sub total so sub total was always the default calculated cost of items in the cart before anything.

audetcameron avatar Mar 17 '20 19:03 audetcameron

I have made a fork, with several changes, such as for example the taxes are applied after obtaining the subtotal of the item

diegonella avatar Mar 17 '20 20:03 diegonella

I have the same problem and was wondering if anyone found out a solution using "native" laravelshoppingcart methods ? If not, I will probably make my own subtotal too. Thanks

Leonie-D avatar Jun 16 '20 19:06 Leonie-D

You need to use getSubTotalWithoutConditions.

Santukon avatar Jan 13 '21 13:01 Santukon

If Im not wrong, tax conditions must be applied to cart, not to items, If you have different tax per items, I think using getSubTotalWithoutConditions is a good alternative anyway.

Santukon avatar Jan 13 '21 14:01 Santukon