Forums / All Other Contributions/Addons / Dynamic Price Updater

Dynamic Price Updater

Views: 343,202

Results 1,641 to 1,660 of 1,701
6 Nov 2022, 4:30 AM
#1641
morrysmith avatar

morrysmith

New Zenner

Join Date:
May 2022
Location:
HK
Posts:
9
Plugin Contributions:
0

Dynamic Price Updater

I've been testing locally so far and everything works fine.
My version is v1.5.7d, the local PHP version is 7.4, and so is the server.
But whenever I move the site to the server, the plugin doesn't work at all except for loading images all the time when I input the quantity.
Any ideas?

6 Nov 2022, 12:06 PM
#1642
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Dynamic Price Updater

morrysmith:

I've been testing locally so far and everything works fine.
My version is v1.5.7d, the local PHP version is 7.4, and so is the server.
But whenever I move the site to the server, the plugin doesn't work at all except for loading images all the time when I input the quantity.
Any ideas?

Several come to mind, though not all specifically related to the plugin and in no particular order: files exist in the server that are not in the local version, file differences between the two, database differences that have some affect, two or more observers trying to monitor the same notifier but are loaded in a different sequence on the site than the local version, that there has been done html validation differences between the output, differences in jquery versions, etc.

Basically that there is a difference between the two that has brought out a difference in operation. Look for logs, create logs if necessary, include browser (javascript/jquery) as well, etc.

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

21 Jan 2023, 12:35 PM
#1643
simon1066 avatar

simon1066

Totally Zenned

Join Date:
Feb 2009
Location:
UK
Posts:
1,326
Plugin Contributions:
0

Re: Dynamic Price Updater

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

[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

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?

Simon

21 Jan 2023, 2:05 PM
#1644
strelitzia avatar

strelitzia

Totally Zenned

Join Date:
Nov 2005
Location:
France
Posts:
588
Plugin Contributions:
1

Re: Dynamic Price Updater

simon1066:

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

[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.


Another mod that has fallen foul of changes made to the ZC 1.5.8 `shoppingCart` class which reassigned some variables
from generically `public` to specifically `protected`.

The mod is going to require some reworking. Not sure who's managing this one now.

Zen Cart developer since 2009 — Zen Cart Solutions
Ecommerce development, integrations & automation — Junction Solutions

21 Jan 2023, 2:17 PM
#1646
simon1066 avatar

simon1066

Totally Zenned

Join Date:
Feb 2009
Location:
UK
Posts:
1,326
Plugin Contributions:
0

Re: Dynamic Price Updater

strelitzia:

Have you tried using the beta version from GitHub? It can be found at https://github.com/Zen4All-nl/Zen-Cart-Dynamic-Price-Updater

Thanks for that, I knew it existed but couldn't for the life of me remember where I had seen it - or whether I was just dreaming about it. I'll take a look and see if it helps.

Simon

21 Jan 2023, 4:01 PM
#1647
simon1066 avatar

simon1066

Totally Zenned

Join Date:
Feb 2009
Location:
UK
Posts:
1,326
Plugin Contributions:
0

Re: Dynamic Price Updater

strelitzia:

Have you tried using the beta version from GitHub? It can be found at https://github.com/Zen4All-nl/Zen-Cart-Dynamic-Price-Updater

I haven't tried installing this v4.0.0 but it looks as though it makes use of the same variable as v3.2.1

shoppingCart->total_before_discounts

A workaround on the site I'm currently working on is to remove the offending lines from dynamic_price_updater.php. I don't use the native ZC specials, sales and discounts (just @swguy's Quantity Discounts) so it should be ok.

Simon

22 Jan 2023, 10:05 AM
#1648
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,875
Plugin Contributions:
7

Re: Dynamic Price Updater

Comparing my working version to

https://github.com/Zen4All-nl/Zen-Cart-Dynamic-Price-Updater

  • the pending pull request,

is pretty much the same, so you should try it.

Steve
github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...

22 Jan 2023, 10:23 AM
#1649
simon1066 avatar

simon1066

Totally Zenned

Join Date:
Feb 2009
Location:
UK
Posts:
1,326
Plugin Contributions:
0

Re: Dynamic Price Updater

torvista:

Comparing my working version to

https://github.com/Zen4All-nl/Zen-Cart-Dynamic-Price-Updater

  • the pending pull request,

is pretty much the same, so you should try it.

Thanks, will do.

Simon

22 Jan 2023, 10:45 AM
#1650
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,875
Plugin Contributions:
7

Re: Dynamic Price Updater

I forgot to mention you should use the develop branch, not the master. There is a world of difference.

Steve
github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...

14 Feb 2023, 9:01 PM
#1651
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,849
Plugin Contributions:
18

Re: Dynamic Price Updater

158 github latest
PHP 8
latest responsive cloned
OPC latest

Get spinning icon on entry to product page

[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.

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

14 Feb 2023, 10:21 PM
#1652
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,110
Plugin Contributions:
56

Re: Dynamic Price Updater

Noting that there is a shopping_cart class method (show_total_before_discounts) to retrieve that value.

16 Feb 2023, 3:55 AM
#1653
goldbuckle avatar

goldbuckle

Zen Follower

Join Date:
Dec 2006
Location:
near Atlanta Georgia
Posts:
220
Plugin Contributions:
0

Re: Dynamic Price Updater

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-Cart-Dynamic-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

Best,
Goldbuckle

16 Feb 2023, 9:22 AM
#1654
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,849
Plugin Contributions:
18

Re: Dynamic Price Updater

lat9:

Noting that there is a shopping_cart class method (show_total_before_discounts) to retrieve that value.any further hint for the code-challenged among us?

asking for a friend:P

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

16 Feb 2023, 12:41 PM
#1655
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,110
Plugin Contributions:
56

Re: Dynamic Price Updater

dbltoe:

any further hint for the code-challenged among us?

asking for a friend:P
What's the code on the following line?

/includes/classes/ajax/zcDPU_Ajax.php on line 177.

16 Feb 2023, 1:11 PM
#1656
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,849
Plugin Contributions:
18

Re: Dynamic Price Updater

lines 173-182,

      $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');
    }

All these files are from the development branch of github.

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

16 Feb 2023, 2:28 PM
#1657
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,110
Plugin Contributions:
56

Re: Dynamic Price Updater

dbltoe:

lines 173-182,

  $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');
}
> 
> All these files are from the development branch of github.
Change this line

$this->responseText['preDiscPriceTotal'] = number_format(zen_add_tax([B]$this->shoppingCart->total_before_discounts[/B], zen_get_tax_rate($product_check->fields['products_tax_class_id'])), $decimal_places, $decimal_point, $thousands_point);


to

$this->responseText['preDiscPriceTotal'] = number_format(zen_add_tax([B]$this->shoppingCart->show_total_before_discounts()[/B], zen_get_tax_rate($product_check->fields['products_tax_class_id'])), $decimal_places, $decimal_point, $thousands_point);

16 Feb 2023, 3:48 PM
#1659
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,849
Plugin Contributions:
18

Re: Dynamic Price Updater

Spoke a little too soon.

Still a glitch

[16-Feb-2023 10:50:14 America/New_York] Request URI: /ajax.php?act=DPU_Ajax&method=getDetails, IP address: 216.177.186.199, Language id 1
#1 zcDPU_Ajax->prepareOutput() called at [/includes/classes/ajax/zcDPU_Ajax.php:88]
#2 zcDPU_Ajax->getDetails() called at [/ajax.php:85]
--> PHP Warning: Undefined property: shoppingCart::$show_total_before_discounts in /includes/classes/ajax/zcDPU_Ajax.php on line 176.

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

16 Feb 2023, 3:59 PM
#1660
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,110
Plugin Contributions:
56

Re: Dynamic Price Updater

dbltoe:

Spoke a little too soon.

Still a glitch

[16-Feb-2023 10:50:14 America/New_York] Request URI: /ajax.php?act=DPU_Ajax&method=getDetails, IP address: 216.177.186.199, Language id 1
#1 zcDPU_Ajax->prepareOutput() called at [/includes/classes/ajax/zcDPU_Ajax.php:88]
#2 zcDPU_Ajax->getDetails() called at [/ajax.php:85]
--> PHP Warning: Undefined property: shoppingCart::$show_total_before_discounts in /includes/classes/ajax/zcDPU_Ajax.php on line 176.


Same change as the previous one, this on line 176.