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

Dynamic Price Updater

Views: 342,348

Results 1,381 to 1,400 of 1,701
2 Sep 2017, 2:25 PM
#1381
mc12345678 avatar

mc12345678

Totally Zenned

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

Dynamic Price Updater

diamond1:

I have version 3.7 this https://www.zen-cart.com/downloads.php?do=file&id=1301 and the files are all original. Also I did not understand how to do to remove the pop up Status returned and how do I ever keep the file jscript_jquery.min.php what do I do to see DPU work?

diamond1:

Dynamic Price Updater (Version Installed) 3.0.7

Copy from includes/templates/template_default/jscript
The files jscript_jquery.min.php and jscript_framework.php to:
includes/templates/YOUR_TEMPLATE/jscript

Where YOUR_TEMPLATE is the name of the template used on your site.

That will address having jquery/javascript loaded for your template AND make zcJS available for use and the popup will not occur. With those two files in place dpu will work.

A form of javascript or jquery must be present, and it is expected that with a current version of ZC that at least a javascript or jquery file would have been included in the template.

As to a zero price showing for a product that doesn't have attributes, I can no longer reproduce that issue because of the changes that have been made and incorporated into DPU version 3.0.7 and the minor change made as shown in this commit: https://github.com/mc12345678/Dynamic_Price_Updater/commit/8e10237fc1038529c4f92c07efd7002a43116075

2 Sep 2017, 4:36 PM
#1382
diamond1 avatar

diamond1

Zen Follower

Join Date:
Jan 2010
Location:
France
Posts:
295
Plugin Contributions:
0

Re: Dynamic Price Updater

From zero price that shows a product that does not have attributes worked the change you suggested, instead copying the two files in the jscript folder did not work to run dpu i always leave jscript_jquery.min.php if i put the two files you have suggested dpu is blocking Do you have another suggestion?

2 Sep 2017, 4:41 PM
#1383
diamond1 avatar

diamond1

Zen Follower

Join Date:
Jan 2010
Location:
France
Posts:
295
Plugin Contributions:
0

Re: Dynamic Price Updater

[02-Sep-2017 18:38:04 Europe/Rome] PHP Warning: Invalid argument supplied for foreach() in /home/blablabla/public_html/includes/classes/dynamic_price_updater.php on line 150

But I have this as a mistake now with the edit

2 Sep 2017, 6:26 PM
#1384
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: Dynamic Price Updater

To summarize the current situation of DPU, the posted/identified issues and the solutions or the proposed solution, the following posts have been made since issue of 3.0.7 with either a link or some form of direction on how to correct. The most latest forum posted code has not been massaged to remove an extra & from the end, but it allows identifying the product information when viewing the ZC default who's online. It seems like it may be beneficial to have some internal "switch" to allow not capturing the ajax call as a "who's online" condition such as perhaps a session variable when set to bypass the who's online "logging", clear the session variable and continue on. Seeing as the who's online table really only keeps the last unique record (i.e. the last "click"), filtering has to occur up front when the "action" is being taken rather than at some point later as in at the point of viewing the list/record. Obviously would be concerned about some sort of security "black out". I guess another solution is to incorporate a who's online update within the code so that the "position" of the current user does not appear as if in the ajax code... Brings about something of a sigh.

Also, one can see the changes that have been made and stored to keep a functional version of the plugin (changes to be incorporated into the next version plus any new features) by using the following link which compares the current code to the associated issued version (in this case 3.0.7): https://github.com/mc12345678/Dynamic_Price_Updater/compare/v3.0.7...master

mani:

Now got one more warning

[18-Jul-2017 06:57:14 UTC] Request URI: /ajax.php?act=DPU_Ajax&method=dpu_update, IP address: 192.168.200.28
#1 DPU->removeExtraSelections() called at [/home/yabba1/public_html/includes/classes/dynamic_price_updater.php:62]
#2 DPU->getDetails() called at [/home/yabba1/public_html/includes/classes/ajax/zcDPU_Ajax.php:14]
#3 zcDPU_Ajax->dpu_update()
#4 call_user_func() called at [/home/yabba1/public_html/ajax.php:72]

[18-Jul-2017 06:57:14 UTC] PHP Warning: Invalid argument supplied for foreach() in /home/yabba1/public_html/includes/classes/dynamic_price_updater.php on line 150

How do I get this fixed?

mani:

I copied the contents of the file from classes/dynamic_price_updater.php from

https://github.com/mc12345678/Dynamic_Price_Updater/blob/9857cf302f2ec06562dc40d60b79eea406dd84cf/Installation%20files/includes/classes/dynamic_price_updater.php

and now it doesnt create a log file
Is it the right approach?

Module version installed is downloaded from
https://www.zen-cart.com/downloads.php?do=file&id=1301

and only
classes/dynamic_price_updater.php has been updated from github!

mc12345678:

Pushed the update to github finally. To obtain the specific modification see: https://github.com/mc12345678/Dynamic_Price_Updater/commit/8e10237fc1038529c4f92c07efd7002a43116075

It as well as a few minor updates/fixes for the ZC released version are now in the master branch of the github repo at: https://github.com/mc12345678/Dynamic_Price_Updater

mc12345678:

Untested but should carry the information that would normally be seen in Who's online:

Two places each in two provided files to change to support both "methods" of operation:

includes/modules/pages/product_info/jscript_dynamic_price_updater.php
and
includes/modules/pages/product_music_info/jscript_dynamic_price_updater.php

Line 125 change from:

this.XHR.open(strMode.toLowerCase(), this.url+"?act=DPU_Ajax&method=dpu_update"+(strMode.toLowerCase() == "get" ? "&" + this.compileRequest() : ""), true);

> to:
> ```
this.XHR.open(strMode.toLowerCase(), this.url+"?act=DPU_Ajax&method=dpu_update"+(strMode.toLowerCase() == "get" ? "&" + this.compileRequest() : "")+<?php echo (!empty(zen_get_all_get_params())) ? '"&' . zen_get_all_get_params() . '"' : '""'; ?>, true);

Line 132 change from:

var option = { url : theURL+"?act=DPU_Ajax&method=dpu_update",

> To:
> ```
var option = { url : theURL+"?act=DPU_Ajax&method=dpu_update<?php echo (!empty(zen_get_all_get_params())) ? '&' . zen_get_all_get_params() : ''; ?>",

diamond1:

[02-Sep-2017 18:38:04 Europe/Rome] PHP Warning: Invalid argument supplied for foreach() in /home/blablabla/public_html/includes/classes/dynamic_price_updater.php on line 150

But I have this as a mistake now with the edit

2 Sep 2017, 10:18 PM
#1385
diamond1 avatar

diamond1

Zen Follower

Join Date:
Jan 2010
Location:
France
Posts:
295
Plugin Contributions:
0

Re: Dynamic Price Updater

I can not follow you, but a version that works as it should not be there? with the editors who are online you see this now /ajax.php?act=DPU_Ajax&method=dpu_update&products_id=154&cPath=3&number_of_uploads=0& a little better than before but not enough for those who have installed the url rewrite, regarding the php error public_html / includes / classes / dynamic_price_updater.php on line 150 I always did not understand how to fix the error despite updated files that would be easier for everyone to upload the correct version of the forum

3 Sep 2017, 2:28 PM
#1386
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: Dynamic Price Updater

diamond1:

I can not follow you, but a version that works as it should not be there? with the editors who are online you see this now /ajax.php?act=DPU_Ajax&method=dpu_update&products_id=154&cPath=3&number_of_uploads=0& a little better than before but not enough for those who have installed the url rewrite, regarding the php error public_html / includes / classes / dynamic_price_updater.php on line 150 I always did not understand how to fix the error despite updated files that would be easier for everyone to upload the correct version of the forum
Although English is a second language (or maybe third, fourth or fifth), no one is a mind-reader or at least I am not one. Please explain what can not be followed, what is not understood, etc...

As to the line 150 issue. If you follow any of the links that go to github, you should see code that has been modified. Red, means that something about that line has been "deleted" or is the "old" line, green means something in that line has been "added" or represents how the new line should look.

If you need to specifically know what line 150 should now look like, then please ask.

As to the software as available from the downloads section of this site. Well, please also understand the nature of this public forum. Volunteers have offered code. That code is offered to the forum for yet other volunteers to review the code by a process and make it available to others at no cost. Sometimes in the overall process an error is found and a correction is made. In this case the correction was posted to the forum and to a live location that is not controlled or maintained by core ZC volunteers. That modified version is available for download which would provide a package very much like what is provided through the ZC forum.

As a user of the software, it is equally important to review the forum for similar issues and to either ask how to apply the fix or find someone to do so as it is for someone to post a central fix to an issue. Right now I have at least three major changes to this software to implement which will improve the overall operation and flexibility of the software and when issuing those changes the minor patches identified to date will be incorporated.

Again, let me just say that the github location: https://github.com/mc12345678/Dynamic_Price_Updater allows download of the code as a zip file. This would allow applying the patch for linme 150 of the class file.

4 Sep 2017, 4:40 PM
#1387
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: Dynamic Price Updater

diamond1:

I can not follow you, but a version that works as it should not be there? with the editors who are online you see this now /ajax.php?act=DPU_Ajax&method=dpu_update&products_id=154&cPath=3&number_of_uploads=0& a little better than before but not enough for those who have installed the url rewrite, regarding the php error public_html / includes / classes / dynamic_price_updater.php on line 150 I always did not understand how to fix the error despite updated files that would be easier for everyone to upload the correct version of the forum

Not sure about which URL rewriter you are speaking of or what is specifically desired to be seen. If they wish to see more information or specifically wish to see the full url, then it could be possible to incorporate a result from zen_href_link (properly sanitized) into the parameters to be displayed. I found that with CEON Uris installed that the result was similar to above. That result is or should be enough to determine the product being viewed.

Locally I have incorporated a jscript_jquery.min.dpu.php template file that will load jquery (currently set to load 1.12.4) if jquery is not yet already loaded. Github will be updated to reflect that additional file plus in time the modifications to the instructions that are needed to cover the things recently identified.

26 Sep 2017, 2:22 AM
#1388
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: Dynamic Price Updater

Submitted v3.0.8 to the ZC Forum to correct a number of issues discussed above and listed below:

3.0.8, What changed:

  • Added a switch and code to support deactivating the use of currency symbols
    in the sidebox, similar to the display of the base product price.
  • Corrected the use of the notifier to support using an observer to provide
    a prefix for displayed prices.
  • Removed the specific comparison of an attribute being a checkbox for when
    processing attributes to identify the lowest price of the product. Inclusion
    of the attribute into the base price is controlled through the attributes
    controller and should not be just blindly omitted within this code.
  • Updated the installer including to incorporate the version checker provided
    in the current alpha release of ZC 1.5.6 and to use that code instead of the built in code and
    instead of pulling the recent file into the distribution of the
    plugin (and then have multiple such versions out and about.)
  • Updated the installer to write a debug log if the installer files have been
    incorrectly placed in the catalog side of the installer.
  • Updated the installer to expect an admin to be logged in, and the page not currently being
    the login page or as a result of selecting the logoff option.
  • Updated code for initial expected changes for PHP 7.2.
  • Corrected the encoding (BOM) of the file that provides the ajax processing.
  • Corrected issue with price being displayed as zero when it should be otherwise displayed.
  • Added the general page information (though not with zen_href_link) and support understanding what
    the customer is looking at at the point of the call.
  • Updated the jscript code for the product_music to match the product_info code.
  • Added template jscript code to attempt to load jquery if it has not previously included or
    loaded to load jquery 1.12.4

Once reviewed and accepted it should be available for download from ZC here. Otherwise this version can be viewed on Github here. With the changes between the ZC 3.0.7 and ZC 3.0.8 release identified here.

27 Sep 2017, 5:37 PM
#1389
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: Dynamic Price Updater

mc12345678:

Submitted v3.0.8 to the ZC Forum to correct a number of issues discussed above and listed below:

Once reviewed and accepted it should be available for download from ZC here. Otherwise this version can be viewed on Github here. With the changes between the ZC 3.0.7 and ZC 3.0.8 release identified here.
Version 3.0.8 has been posted to the ZC website here.

10 Oct 2017, 4:26 PM
#1390
mvstudio avatar

mvstudio

Zen Follower

Join Date:
Apr 2008
Posts:
447
Plugin Contributions:
1

Re: Dynamic Price Updater

Hi there.
Just installed the latest version on a test site and got an error
[10-Oct-2017 10:21:00 America/Denver] PHP Parse error: syntax error, unexpected '(float)' (double) (T_DOUBLE_CAST) in /home/koolwedd/public_html/bvostoretemp/includes/classes/dynamic_price_updater.php on line 200

10 Oct 2017, 5:35 PM
#1391
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: Dynamic Price Updater

mvstudio:

Hi there.
Just installed the latest version on a test site and got an error
[10-Oct-2017 10:21:00 America/Denver] PHP Parse error: syntax error, unexpected '(float)' (double) (T_DOUBLE_CAST) in /home/koolwedd/public_html/bvostoretemp/includes/classes/dynamic_price_updater.php on line 200

Thanks for the report. Could you please try applying the change to that file as indicated in the following commit difference: https://github.com/mc12345678/Dynamic_Price_Updater/compare/mc12345678:725e4cf778913c4b8e1cf283095ed955bdc71de6...mc12345678:a16d975719cba7d9b96d0693febe36f1c1e18928?
I'd like to package that better, but best I could do from my phone when I saw your message.

10 Oct 2017, 10:06 PM
#1392
mvstudio avatar

mvstudio

Zen Follower

Join Date:
Apr 2008
Posts:
447
Plugin Contributions:
1

Re: Dynamic Price Updater

Thank you for that.
I made the changes and now I get this error

[10-Oct-2017 16:07:36 America/Denver] PHP Fatal error: Can't use function return value in write context in /home/koolwedd/public_html/bvostoretemp/includes/modules/pages/product_info/jscript_dynamic_price_updater.php on line 125

11 Oct 2017, 4:01 AM
#1393
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: Dynamic Price Updater

mvstudio:

Thank you for that.
I made the changes and now I get this error

[10-Oct-2017 16:07:36 America/Denver] PHP Fatal error: Can't use function return value in write context in /home/koolwedd/public_html/bvostoretemp/includes/modules/pages/product_info/jscript_dynamic_price_updater.php on line 125

Still trying to figure out which part of the line is causing this issue, it is expected to be repeated in later lines and want to fix all at once not one at a time. Side question is, when viewing your page source do you have the javascript/jquery variable: zcJS?

11 Oct 2017, 3:50 PM
#1394
mvstudio avatar

mvstudio

Zen Follower

Join Date:
Apr 2008
Posts:
447
Plugin Contributions:
1

Re: Dynamic Price Updater

Thank you for looking into it.

I believe so. It appears on 2 places in the header

<script type="text/javascript"><!--//<![CDATA[
if (typeof zcJS == "undefined" || !zcJS) {
 window.zcJS = { name: 'zcJS', version: '0.1.0.0' };
};

zcJS.ajax = function (options) {
zcJS.timer = function (options) {
  var defaults = {
    interval: 10000,
    startEvent: null,
    intervalEvent: null,
    stopEvent: null
11 Oct 2017, 7:10 PM
#1395
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: Dynamic Price Updater

mvstudio:

Thank you for looking into it.

I believe so. It appears on 2 places in the header

<script type="text/javascript"><!--//<=!=[=C=D=A=T=A=[ if (typeof zcJS == "undefined" || !zcJS) { window.zcJS = { name: 'zcJS', version: '0.1.0.0' }; }; zcJS.ajax = function (options) { ``` > > > ```php zcJS.timer = function (options) { var defaults = { interval: 10000, startEvent: null, intervalEvent: null, stopEvent: null ``` I was grabbing at some straws with the question but wanted to be sure that the correct portion of the code would be expected to be processed. I think I have identified the cause (okay besides the programming that I added in), which was an attempt to evaluate the result of a function to see if it was empty or not. I have made a change in the master branch to account for a better arrangement, though that entire portion is still under review. I was going to try to use zen_href_link to build the link so that it would be more informative when using a URI rewriter, but because ajax.php itself must be called statically, it doesn't specifically resolve the issue previously described so I incorporated what I did to move things along and perhaps identify other strict processing issues that haven't yet been identified. :) Again thank you for the notification and patience. See this commit for proposed resolution of the above: <https://github.com/mc12345678/Dynamic_Price_Updater/commit/c29a5281bfc197a9bb19bf2a900748a66b3e7758>
12 Oct 2017, 11:06 PM
#1396
mvstudio avatar

mvstudio

Zen Follower

Join Date:
Apr 2008
Posts:
447
Plugin Contributions:
1

Re: Dynamic Price Updater

I have good news, and bad news.
The good news, the changes didn't make the site crash completely like before. Bad news, product info pages are blank =(
I keep on getting the error on line 126, after the changes, which would be the beginning of the changes you referenced.
Sorry for reporting such bad news =(

13 Oct 2017, 12:33 PM
#1397
mvstudio avatar

mvstudio

Zen Follower

Join Date:
Apr 2008
Posts:
447
Plugin Contributions:
1

Re: Dynamic Price Updater

I was checking the file last night and was able to make some progress, I think.

In comparing the file in the plugin with the modifications you suggested, and this file https://github.com/mc12345678/Dynamic_Price_Updater/blob/master/Installation%20files/includes/modules/pages/product_info/jscript_dynamic_price_updater.php which already contains the modifications, I found an extra line at the bottom of the code on the one on the plugin. In removing that extra line the product info page now downloads. However the ajax loader image stays on a loop. You can see the behavior on the test page here http://www.byvalenti.com/bvostoretemp/index.php?main_page=product_info&cPath=8_9&products_id=4

No error log files are generated with this behavior.

I hope this info helps you a bit =)

Thank you for looking into it.

13 Oct 2017, 12:49 PM
#1398
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: Dynamic Price Updater

mvstudio:

I was checking the file last night and was able to make some progress, I think.

In comparing the file in the plugin with the modifications you suggested, and this file https://github.com/mc12345678/Dynamic_Price_Updater/blob/master/Installation%20files/includes/modules/pages/product_info/jscript_dynamic_price_updater.php which already contains the modifications, I found an extra line at the bottom of the code on the one on the plugin. In removing that extra line the product info page now downloads. However the ajax loader image stays on a loop. You can see the behavior on the test page here http://www.byvalenti.com/bvostoretemp/index.php?main_page=product_info&cPath=8_9&products_id=4

No error log files are generated with this behavior.

I hope this info helps you a bit =)

Thank you for looking into it.

Now that have a link to a "problem" page, for one thing there are some significant html validation issues, one of which is considered a fatal error as seen here: ```
https://validator.w3.org/nu/?doc=http%3A%2F%2Fwww.byvalenti.com%2Fbvostoretemp%2Findex.php%3Fmain_page%3Dproduct_info%26cPath%3D8_9%26products_id%3D4


Another issue may be related to the loading of jquery 1.7.1 as what looks like the main jquery to be loaded. 

From my device, I couldn't see the entire page and the css essentialy wasn't loaded.

Recommend addressing the validation issues before attempting to further work with javascript/jquery related code.
13 Oct 2017, 2:18 PM
#1399
mvstudio avatar

mvstudio

Zen Follower

Join Date:
Apr 2008
Posts:
447
Plugin Contributions:
1

Re: Dynamic Price Updater

The validation issues was on my to-do list, after installing all the plugins the site needed.
Anyways all the validation issues have been resolved. The jquery 1.7.1 is part of the zx Slideshow plugin.

Thank you!

13 Oct 2017, 2:28 PM
#1400
mvstudio avatar

mvstudio

Zen Follower

Join Date:
Apr 2008
Posts:
447
Plugin Contributions:
1

Re: Dynamic Price Updater

From my device, I couldn't see the entire page and the css essentialy wasn't loaded.
I didn't see a css file for the plugin. The templates folder only contains a jscript and sideboxes folders.