Closed ajenkins-dev closed 1 year ago
This is on the latest releases of ConcreteCMS 9.1.3 and Community Store, running on PHP 8.0.25.
The error occurs when logged into the website and clicking the clear cart button from the cart page but it doesn't happen when the user isn't logged in.
Undefined variable $taxCalc /packages/community_store/src/CommunityStore/Tax/TaxRate.php
if ('grandtotal' == $this->getTaxBasedOn()) { $shippingTotal = floatval(Calculator::getShippingTotal()); if ('extract' == $taxCalc) { $taxrate = 1 + ($this->getTaxRate() / 100); $shippingtaxtotal = $shippingTotal - ($shippingTotal / $taxrate); } else { $taxrate = $this->getTaxRate() / 100; $shippingtaxtotal = $taxrate * $shippingTotal; } }
I changed it to:
if ('grandtotal' == $this->getTaxBasedOn()) { $shippingTotal = floatval(Calculator::getShippingTotal()); $taxCalc = Config::get('community_store.calculation'); if ('extract' == $taxCalc) { $taxrate = 1 + ($this->getTaxRate() / 100); $shippingtaxtotal = $shippingTotal - ($shippingTotal / $taxrate); } else { $taxrate = $this->getTaxRate() / 100; $shippingtaxtotal = $taxrate * $shippingTotal; } }
and it seems to have resolved the issue.
This is on the latest releases of ConcreteCMS 9.1.3 and Community Store, running on PHP 8.0.25.
The error occurs when logged into the website and clicking the clear cart button from the cart page but it doesn't happen when the user isn't logged in.
Undefined variable $taxCalc /packages/community_store/src/CommunityStore/Tax/TaxRate.php
I changed it to:
and it seems to have resolved the issue.