Comparing my working version to
https://github.com/Zen4All-nl/Zen-Ca...-Price-Updater
+ the pending pull request,
is pretty much the same, so you should try it.
Printable View
Comparing my working version to
https://github.com/Zen4All-nl/Zen-Ca...-Price-Updater
+ the pending pull request,
is pretty much the same, so you should try it.
I forgot to mention you should use the develop branch, not the master. There is a world of difference.
158 **github latest**
PHP 8
latest responsive cloned
OPC latest
Get spinning icon on entry to product page
Code:[14-Feb-2023 15:56:01 America/New_York] PHP Fatal error: Uncaught Error: Cannot access protected property shoppingCart::$total_before_discounts in /includes/classes/ajax/zcDPU_Ajax.php:177
Stack trace:
#0 /includes/classes/ajax/zcDPU_Ajax.php(89): zcDPU_Ajax->prepareOutput()
#1 /ajax.php(85): zcDPU_Ajax->getDetails()
#2 {main}
thrown in /includes/classes/ajax/zcDPU_Ajax.php on line 177
[14-Feb-2023 15:56:01 America/New_York] Request URI: /ajax.php?act=DPU_Ajax&method=getDetails, IP address: 216.177.186.199
--> PHP Fatal error: Uncaught Error: Cannot access protected property shoppingCart::$total_before_discounts in /includes/classes/ajax/zcDPU_Ajax.php:177
Stack trace:
#0 /includes/classes/ajax/zcDPU_Ajax.php(89): zcDPU_Ajax->prepareOutput()
#1 /ajax.php(85): zcDPU_Ajax->getDetails()
#2 {main}
thrown in /includes/classes/ajax/zcDPU_Ajax.php on line 177.
Noting that there is a shopping_cart class method (show_total_before_discounts) to retrieve that value.
Upgrading from ZC v157 to v158. Currently using Dynamic Price Updater v3.2.1 (confirmed the version in my Admin Configuration>Dynamic Price Updater). On the plugins page I see v3.2.0 but no v3.2.1. What happened to v3.2.1? Also will v3.2.0 or v3.2.1 work with v158? Secondly I see that there is a 4.0.0 Beta 3 from April 2020 in Github (https://github.com/Zen4All-nl/Zen-Ca...-Price-Updater). Is it due out of Beta soon? Also, is anyone here working on an updated version specifically for 158? I would like to work with them if they are to add some additional functionality to it that I think may be useful to others besides myself.
Thanks,
John
lines 173-182,
All these files are from the development branch of github.Code:$this->responseText['priceTotal'] .= number_format($this->shoppingCart->total, $decimal_places, $decimal_point, $thousands_point); $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);
} else {
$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 */);
$this->responseText['preDiscPriceTotal'] = $currencies->display_price($this->shoppingCart->total_before_discounts, zen_get_tax_rate($product_check->fields['products_tax_class_id']));
}
if (!defined('DPU_OUT_OF_STOCK_IMAGE')) {
define('DPU_OUT_OF_STOCK_IMAGE', '%s');
}
Change this line
toCode:$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);
Code:$this->responseText['preDiscPriceTotal'] = number_format(zen_add_tax($this->shoppingCart->show_total_before_discounts(), zen_get_tax_rate($product_check->fields['products_tax_class_id'])), $decimal_places, $decimal_point, $thousands_point);