laravelshoppingcart icon indicating copy to clipboard operation
laravelshoppingcart copied to clipboard

After applying conditions on subtotal retrieve calculated price on old subtotal price

Open Mustakimpatel opened this issue 5 years ago • 2 comments

How to fetch "$condition->getCalculatedValue($subTotal);" on old subtotal value?

$subTotal = Cart::getSubTotal(); $condition = Cart::getCondition('VAT 12.5%'); $conditionCalculatedValue = $condition->getCalculatedValue($subTotal); //this will calculate on already applied condition value, instead of old one.

Mustakimpatel avatar Aug 31 '19 10:08 Mustakimpatel

Is the issue fixed? if fixed, What is the solution?

debuEkodus avatar Sep 15 '20 08:09 debuEkodus

Replace getSubTotal() by getSubTotalWithoutConditions() like this:


$subTotalWithoutConditions = Cart::getSubTotalWithoutConditions();
$condition = Cart::getCondition('VAT 12.5%');
$conditionCalculatedValue = $condition->getCalculatedValue($subTotalWithoutConditions);

AnasSafi avatar Dec 26 '21 18:12 AnasSafi