DPU v3.2.1
Upgrading a site from ZC 1.5.7d to ZC 1.5.8 (PHP 8.0.17) and I get this fatal error when visiting a product_info page
Code:
[21-Jan-2023 12:18:02 Europe/London] PHP Fatal error: Uncaught Error: Cannot access protected property shoppingCart::$total_before_discounts in D:\wamp64\www\mydomain.com\includes\classes\dynamic_price_updater.php:181
Stack trace:
#0 D:\wamp64\www\mydomain.com\includes\classes\dynamic_price_updater.php(79): DPU->prepareOutput()
#1 D:\wamp64\www\mydomain.com\includes\classes\ajax\zcDPU_Ajax.php(16): DPU->getDetails('JSON')
#2 D:\wamp64\www\mydomain.com\ajax.php(85): zcDPU_Ajax->dpu_update()
#3 {main}
thrown in D:\wamp64\www\mydomain.com\includes\classes\dynamic_price_updater.php on line 181
[21-Jan-2023 12:18:02 Europe/London] Request URI: /ajax.php?product_info&act=DPU_Ajax&method=dpu_update, IP address: 127.0.0.1
--> PHP Fatal error: Uncaught Error: Cannot access protected property shoppingCart::$total_before_discounts in D:\wamp64\www\mydomain.com\includes\classes\dynamic_price_updater.php:181
Stack trace:
#0 D:\wamp64\www\mydomain.com\includes\classes\dynamic_price_updater.php(79): DPU->prepareOutput()
#1 D:\wamp64\www\mydomain.com\includes\classes\ajax\zcDPU_Ajax.php(16): DPU->getDetails('JSON')
#2 D:\wamp64\www\mydomain.com\ajax.php(85): zcDPU_Ajax->dpu_update()
#3 {main}
thrown in D:\wamp64\www\mydomain.com\includes\classes\dynamic_price_updater.php on line 181.
Lines 174 - 182 of includes/classes/dynamic_price_updater.php
Code:
174. $this->responseText['priceTotal'] .= number_format($this->shoppingCart->total, $decimal_places, $decimal_point, $thousands_point);
175. // $this->responseText['priceTotalTaxed'] .=
176. $this->responseText['midDiscPriceTotal'] = number_format(zen_add_tax($this->shoppingCart->total_before_discounts, zen_get_tax_rate($product_check->fields['products_tax_class_id'])), $decimal_places, $decimal_point, $thousands_point);
177. $this->responseText['preDiscPriceTotal'] = number_format(zen_add_tax($this->shoppingCart->total_before_discounts, zen_get_tax_rate($product_check->fields['products_tax_class_id'])), $decimal_places, $decimal_point, $thousands_point);
178. } else {
179. $this->responseText['priceTotal'] .= $currencies->display_price($this->shoppingCart->total, 0 /*zen_get_tax_rate($product_check->fields['products_tax_class_id'])*//* 0 */ /* DISPLAY_PRICE_WITH_TAX */);
180. $this->responseText['priceTotalTaxed'] .= $currencies->display_price($this->shoppingCart->total, zen_get_tax_rate($product_check->fields['products_tax_class_id']));
181. $this->responseText['midDiscPriceTotal'] = $currencies->display_price($this->shoppingCart->total_before_discounts, zen_get_tax_rate($product_check->fields['products_tax_class_id'])); // Need to determine if/how price should be adjusted associated with multiple price discounts.
182. $this->responseText['preDiscPriceTotal'] = $currencies->display_price($this->shoppingCart->total_before_discounts, zen_get_tax_rate($product_check->fields['products_tax_class_id']));
Any thoughts/suggestions?
Bookmarks