laravelshoppingcart
laravelshoppingcart copied to clipboard
After applying conditions on subtotal retrieve calculated price on old subtotal price
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.
Is the issue fixed? if fixed, What is the solution?
Replace getSubTotal()
by getSubTotalWithoutConditions()
like this:
$subTotalWithoutConditions = Cart::getSubTotalWithoutConditions();
$condition = Cart::getCondition('VAT 12.5%');
$conditionCalculatedValue = $condition->getCalculatedValue($subTotalWithoutConditions);