Zen Cart Logo
Forums / All Other Contributions/Addons / Dynamic Price Updater

Dynamic Price Updater

Views: 342,267

Results 1,541 to 1,560 of 1,701
5 Jun 2019, 4:34 PM
#1541
gwynwyffar avatar

gwynwyffar

New Zenner

Join Date:
Dec 2006
Location:
Hudson Valley, New York USA
Posts:
93
Plugin Contributions:
0

Dynamic Price Updater

I've recently updated to ZC 1.5.6b and also had some updates to my theme template (that came bundled with Dynamic Price Updater). Server is running PHP 7.1.5. I'm getting the following Debug error when DPU is turned on (on the product page there's a loading indicator where a sale price of an item should be). I've checked all the DPU related files with the most recent plugin package and everything seems to match, so I'm at a loss where to look.

[05-Jun-2019 11:25:03 EST5EDT] PHP Fatal error: Uncaught Error: Class 'DPU' not found in /X/X/X/public_html/XXX//catalog/includes/classes/ajax/zcDPU_Ajax.php:10
Stack trace:
#0 /X/X/X/public_html/XXX//catalog/ajax.php(85): zcDPU_Ajax->dpu_update()
#1 {main}
thrown in /X/X/X/public_html/XXX//catalog/includes/classes/ajax/zcDPU_Ajax.php on line 10

[05-Jun-2019 11:25:03 EST5EDT] Request URI: /catalog/ajax.php?products_id=1004&cPath=34_93_38&number_of_uploads=0&act=DPU_Ajax&method=dpu_update, IP address: 67.245.196.78
--> PHP Fatal error: Uncaught Error: Class 'DPU' not found in /X/X/X/public_html/XXX//catalog/includes/classes/ajax/zcDPU_Ajax.php:10
Stack trace:
#0 /X/X/X/public_html/XXX//catalog/ajax.php(85): zcDPU_Ajax->dpu_update()
#1 {main}
thrown in /X/X/X/public_html/XXX//catalog/includes/classes/ajax/zcDPU_Ajax.php on line 10.
5 Jun 2019, 7:32 PM
#1542
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: Dynamic Price Updater

gwynwyffar:

I've recently updated to ZC 1.5.6b and also had some updates to my theme template (that came bundled with Dynamic Price Updater). Server is running PHP 7.1.5. I'm getting the following Debug error when DPU is turned on (on the product page there's a loading indicator where a sale price of an item should be). I've checked all the DPU related files with the most recent plugin package and everything seems to match, so I'm at a loss where to look.

[05-Jun-2019 11:25:03 EST5EDT] PHP Fatal error: Uncaught Error: Class 'DPU' not found in /X/X/X/public_html/XXX//catalog/includes/classes/ajax/zcDPU_Ajax.php:10
Stack trace:
#0 /X/X/X/public_html/XXX//catalog/ajax.php(85): zcDPU_Ajax->dpu_update()
#1 {main}
thrown in /X/X/X/public_html/XXX//catalog/includes/classes/ajax/zcDPU_Ajax.php on line 10

[05-Jun-2019 11:25:03 EST5EDT] Request URI: /catalog/ajax.php?products_id=1004&cPath=34_93_38&number_of_uploads=0&act=DPU_Ajax&method=dpu_update, IP address: 67.245.196.78
--> PHP Fatal error: Uncaught Error: Class 'DPU' not found in /X/X/X/public_html/XXX//catalog/includes/classes/ajax/zcDPU_Ajax.php:10
Stack trace:
#0 /X/X/X/public_html/XXX//catalog/ajax.php(85): zcDPU_Ajax->dpu_update()
#1 {main}
thrown in /X/X/X/public_html/XXX//catalog/includes/classes/ajax/zcDPU_Ajax.php on line 10.


Oye, that's a new one...

First off, I see the above paths; however, noting that a portion of the path was replaced with x's did the original path have two forward slashes back-to-back like that? If so, then there may be an issue related to that, if not, let's continue.

What is effectively reported is that the DPU class is not being loaded by ajax.php when calling to require includes/application_top.php
Which seems to indicate that the file: includes/auto_loaders/config.dynamic_price_updater.php is not in place, or if it is, that the template/store is using an auto_loader prefix other than config.

That latter is possible, but not normal.

I would ask if the same issue occurs when temporarily using one of the default templates, but that requires putting the includes/templates files in the corresponding directory basically.

Initially I was thinking that perhaps the necessary jscript template file wasn't present, but the ajax class was loaded. :/ if the file wasn't present then the built in XHR would have kicked in, if it was then the zcJS variable would be used...

Other than checking that the necessary files are present, I would have to suggest looking at what other files are installed or where modified what the change(s) did.

Could PM the address to see if I might see something of assistance.
7 Jun 2019, 2:35 PM
#1543
gwynwyffar avatar

gwynwyffar

New Zenner

Join Date:
Dec 2006
Location:
Hudson Valley, New York USA
Posts:
93
Plugin Contributions:
0

Re: Dynamic Price Updater

I apologize, those double slashes were my sloppy find/replace. The file paths are correct.

The includes/auto_loaders/config.dynamic_price_updater.php is in place

In terms of file changes, there were only 2 that were changed for the template update.
includes/languages/english/extra_definitions/yourstore/dynamic_price_updater.php
includes/modules/pages/product_info/jscript_dynamic_price_updater.php
I've attached the files here.[Attachment no longer available]

Let me know if you see anything there, otherwise I can PM FTP/login info to let you look further. Thanks for your help!

8 Jun 2019, 3:24 PM
#1544
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: Dynamic Price Updater

gwynwyffar:

I apologize, those double slashes were my sloppy find/replace. The file paths are correct.

The includes/auto_loaders/config.dynamic_price_updater.php is in place

In terms of file changes, there were only 2 that were changed for the template update.
includes/languages/english/extra_definitions/yourstore/dynamic_price_updater.php
includes/modules/pages/product_info/jscript_dynamic_price_updater.php
I've attached the files here.[Attachment no longer available]

Let me know if you see anything there, otherwise I can PM FTP/login info to let you look further. Thanks for your help!
FYI, the attachment is considered invalid. Not sure why, but unable to download it. PM may be necessary.

8 Jun 2019, 10:22 PM
#1545
design75 avatar

design75

Totally Zenned

Join Date:
Dec 2009
Location:
Amersfoort, The Netherlands
Posts:
2,862
Plugin Contributions:
5

Re: Dynamic Price Updater

mc12345678:

Possible, yes, would expect. Apparently haven't finished off the stock update aspect otherwise there would be something assigned to that "missing" constant.

To be sure that am working on the right thing(s), could you please either explain what you are seeing and what conditions are necessary to recreate it, or provide a link to a problem product about which I may still have similar questions?

As to the variable/constant assignment, I tried to incorporate something that could be displayed in proximity to the existing information or to replace it. I tried to leave the constant open for assignment to maybe include what you are asking which is to still show the original price. As to the price of zero, that's where understanding the configuration comes into play.
Any progress on this? as the constant DPU_SHOW_OUT_OF_STOCK_IMAGE is still undefined.

30 Jul 2019, 2:45 PM
#1546
torvista avatar

torvista

Totally Zenned

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

Re: Dynamic Price Updater

in the code there is this:

switch (true) {
case ($this->product_stock > 0): // No consideration made yet on allowing quantity to go less than 0.
$this->responseText['stock_quantity'] = $this->product_stock;
break;
case (true):
$out_of_stock = false;
if ((STOCK_CHECK == 'true') && (STOCK_ALLOW_CHECKOUT != 'true')) {
$out_of_stock = true;
}
case ($out_of_stock && $this->num_options == $this->unused && !empty($this->new_temp_attributes)):
etc.
I don't get the logic behind the second case (true):
or rather don't find a similar construct on the web to explain its use here....

30 Jul 2019, 3:05 PM
#1547
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: Dynamic Price Updater

torvista:

in the code there is this:

I don't get the logic behind the second case (true):
or rather don't find a similar construct on the web to explain its use here....
So, unfortunately the code segment didn't carry over to this post (quoted text maybe?), but at the time of development/incorporation, the thought was: there was no need for $out_of_stock to be defined if there was stock. But, it would be needed for the cases beyond.
The select criteria is set to act on case statements that are true. Therefore if the first case is false the next case is evaluated. The second case evaluates to true by default and is processed. The absence of a break causes the third and subsequent cases to be evaluated until true with a break that follows or default is reached.

Further because the $out_of_stock variable made up part of the "if" structure, I was trying to keep it a part of the logic rather than either pulling it completely out to a separate statement or to repeat the code at each subsequent case. This way the processing logic would be fully contained to this dropdown structure rather than separate parts that would have to be maintained together.

Typical examples would show some part of each of these aspects which were grouped together to give this select structure.

So, besides the interest in its presence, what issue(s) are trying to be resolved?

30 Jul 2019, 4:00 PM
#1548
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: Dynamic Price Updater

Design75:

Any progress on this? as the constant DPU_SHOW_OUT_OF_STOCK_IMAGE is still undefined.

Regarding this, I'm thinking that will define as %s and then allow the DPU class and/or perhaps the script on the final page to provide substitution of the text through the use of the sprintf function.

31 Jul 2019, 7:07 AM
#1549
torvista avatar

torvista

Totally Zenned

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

Re: Dynamic Price Updater

what issue(s) are trying to be resolved?
The debug log due to the missing constant DPU_OUT_OF_STOCK_IMAGE

I've rejigged that switch to check first for that constant, removed all these unnecessary > defined('DPU_SHOW_OUT_OF_STOCK_IMAGE). since this is part of the install.
Then I was pondering over the logic of the section. I don't really get how the out of stock stuff should work/what it is trying to do and since I don't use it I won't be investing any more time in it.
Normally I would try and improve things but I have too much to do already. I think the readme could do with more info.

19 Nov 2019, 10:20 PM
#1550
dbltoe avatar

dbltoe

Totally Zenned

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

Re: Dynamic Price Updater

Calljj:

just a little php7 issue:

PHP Warning: Use of undefined constant DPU_OUT_OF_STOCK_IMAGE - assumed 'DPU_OUT_OF_STOCK_IMAGE'

Any solution on this yet.  Checked github and nothing there.
19 Nov 2019, 10:45 PM
#1551
torvista avatar

torvista

Totally Zenned

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

Re: Dynamic Price Updater

I stuck it in the class
includes/classes/dynamic_price_updater.php

$this->responseText['stock_quantity'] = $this->product_stock;
define('DPU_OUT_OF_STOCK_IMAGE', '');//steve missing: https://www.zen-cart.com/showthread.php?70577-Dynamic-Price-Updater&p=1355225#post1355225
if (defined(DPU_OUT_OF_STOCK_IMAGE)) {
21 Nov 2019, 3:25 PM
#1552
dbltoe avatar

dbltoe

Totally Zenned

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

Re: Dynamic Price Updater

THANX
I put it in includes/languages/english/extra_definitions/dynamic_price_updater.php to maintain uniformity.

24 Jan 2020, 1:51 PM
#1553
dharrison avatar

dharrison

Zen Follower

Join Date:
Mar 2009
Location:
Essex, UK
Posts:
448
Plugin Contributions:
0

Re: Dynamic Price Updater

Hi

Is Dynamic Price Updater compatible with ZenCart 1.5.6?

24 Jan 2020, 8:15 PM
#1554
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: Dynamic Price Updater

dharrison:

Hi

Is Dynamic Price Updater compatible with ZenCart 1.5.6?
Fourth time at trying to post this...

Yes and no. As reported recently in this thread, the version available here will likely throw a myDebug file for the lack of definition associated with stock quantities; however, version 3.2.1: https://github.com/mc12345678/Dynamic_Price_Updater/tree/3.2.1 has (or should by now have) a definition included that displays quantities available associated with the product quantity lookup (meaning when using Stock By Attributes it should narrow down the available quantity based on selections made); however, it looks like if no selections have been made the initial stock message incorrectly identifies that the product is out of stock, but updates when selections have been made. I expect some alternate text to be displayed or the total quantity of the product, but either/both of those are dependent on how the store uses such quantities. Anyways, that feature can be turned off also to not cause confusion to the customer.

9 Mar 2020, 10:14 PM
#1555
dharrison avatar

dharrison

Zen Follower

Join Date:
Mar 2009
Location:
Essex, UK
Posts:
448
Plugin Contributions:
0

Re: Dynamic Price Updater

HI Mc

It works ok. I'm upgrading the live site tomorrow (I hope!) but I have a question: If say you go to https://sitstandforbusiness.com/fundamental-manual-standing-desk-c-22_73_88/fundamental-height-adjustable-sitstand-desk-with-manual-crank-adjustment-p-113.html, We have the inc VAT price howing as well as the ex VAT price. However on the new version these get overriden by the Your Price and the unit price.

How can I prevent the inc/ex VAT prices being hidden and replaced with the Your Price? Please advise.

10 Mar 2020, 7:57 PM
#1556
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: Dynamic Price Updater

dharrison:

HI Mc

It works ok. I'm upgrading the live site tomorrow (I hope!) but I have a question: If say you go to https://sitstandforbusiness.com/fundamental-manual-standing-desk-c-22_73_88/fundamental-height-adjustable-sitstand-desk-with-manual-crank-adjustment-p-113.html, We have the inc VAT price howing as well as the ex VAT price. However on the new version these get overriden by the Your Price and the unit price.

How can I prevent the inc/ex VAT prices being hidden and replaced with the Your Price? Please advise.
Sorry that do not have all of the details together yet; however, I did today go to that product and saw the spinning graphic did not replace the existing values, but instead was shown off to the side.

So, first things first, currently the module returns only one price, either with tax included or without tax included based on the settings for the display of price on the catalog side. Further, the returned price is expected to take the place of the associated product's price value based on identifying the id for the html parameter that is to hold that price. The implementation of the Includes/Excludes VAT that I saw on the site, also offers a separate identifier for the price that contains the Tax'd value. The DPU class could return two fields instead of just one to provide both the taxed and non-taxed value, with the javascript to process not only the returned value, but to also identify to what location it should be assigned (thought I remembered the module supporting display of the information in either sequence of non-taxed first with taxed to follow or vice versa). These additional "options" may introduce additional classes/ids of concern to handle in different ways... I know that at one point I had begun to incorporate the likes of that module or an older one, but other aspects of the software were more important and I had to put that aside at least as a solution for all versus incorporating a limited correction. Hope the launch is going well!

11 Mar 2020, 9:10 AM
#1557
dharrison avatar

dharrison

Zen Follower

Join Date:
Mar 2009
Location:
Essex, UK
Posts:
448
Plugin Contributions:
0

Re: Dynamic Price Updater

Hi MC

mc12345678:

Sorry that do not have all of the details together yet; however, I did today go to that product and saw the spinning graphic did not replace the existing values, but instead was shown off to the side.

The live site at present hasn't been updated. Everything I am doing is on my test server.

mc12345678:

So, first things first, currently the module returns only one price, either with tax included or without tax included based on the settings for the display of price on the catalog side. Further, the returned price is expected to take the place of the associated product's price value based on identifying the id for the html parameter that is to hold that price.

Yes that's correct. And it does work when I updated this site to 1.55f but on the updated 1.5.6c the prices for Inc and Ex VAT show normally, then when the page is loaded, they are superseded by the Updater (was labelled At least, I renamed it price).

mc12345678:

The DPU class could return two fields instead of just one to provide both the taxed and non-taxed value, with the javascript to process not only the returned value, but to also identify to what location it should be assigned (thought I remembered the module supporting display of the information in either sequence of non-taxed first with taxed to follow or vice versa). These additional "options" may introduce additional classes/ids of concern to handle in different ways... I know that at one point I had begun to incorporate the likes of that module or an older one, but other aspects of the software were more important and I had to put that aside at least as a solution for all versus incorporating a limited correction.

Yes that's exactly what the current site does and I would love to be able to recreate this for the new site. The launch is pretty much ready to go, except for this and a separate issue.

I hope you can help. :)

11 Mar 2020, 12:52 PM
#1558
dharrison avatar

dharrison

Zen Follower

Join Date:
Mar 2009
Location:
Essex, UK
Posts:
448
Plugin Contributions:
0

Re: Dynamic Price Updater

In fact, I think it would be easier for me to make the site live, so you can see what the issue is.

11 Mar 2020, 12:57 PM
#1559
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: Dynamic Price Updater

dharrison:

Hi MC

The live site at present hasn't been updated. Everything I am doing is on my test server.

Yes that's correct. And it does work when I updated this site to 1.55f but on the updated 1.5.6c the prices for Inc and Ex VAT show normally, then when the page is loaded, they are superseded by the Updater (was labelled At least, I renamed it price).

Yes that's exactly what the current site does and I would love to be able to recreate this for the new site. The launch is pretty much ready to go, except for this and a separate issue.

I hope you can help. :)
Looked again at the source code generated on the page and see that the current display doesn't have discreet divisions between each of the text items, so just returning different values for tax/non-tax. It appears, that instead would need to return the full text to be displayed as a single value.

To try to do that, I went to search for a module that expressed compatibility with any recent version of Zen Cart. While I suspect the one I found would be compatible, I wanted to ask what module is being used so that perhaps I could use its results for the returned value instead of trying to do some sort of javascript muddling.

11 Mar 2020, 1:47 PM
#1560
dharrison avatar

dharrison

Zen Follower

Join Date:
Mar 2009
Location:
Essex, UK
Posts:
448
Plugin Contributions:
0

Re: Dynamic Price Updater

What I had been using was Dyanmic price Updater and https://www.zen-cart.com/downloads.php?do=file&id=597&styleid=4 (which I know is a bit out of date).

It does show on my test site

Attachment 18898

and then when the page is fully loaded, it replaces with this

Attachment 18899

The piricing for both did update when options/quantities were changed.

I hope this helps. Please do let me know if you would prefer to see the site live.