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

Dynamic Price Updater

Views: 342,268

Results 1,581 to 1,600 of 1,701
29 Jun 2020, 11:08 PM
#1581
mc12345678 avatar

mc12345678

Totally Zenned

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

Dynamic Price Updater

RixStix:

zc 157
vanilla install
drop db tables
import 156c db tables from live site
clone responsive classic template
OPC plugin installed

DPU doesn't play nice. Product screens just flash and flash and flash
Is this an example of plugin not ready for primetime 157, an ID10t error on my part or something else?

https://srevaewniahc (A DOT GOES HERE) info/index.php?main_page=product_info&cPath=1_7&products_id=9
Darnit, somewhere in the forum I posted the fix for the issue other than referring to the latest branch for github.

Basically there was a need identified in ZC 1.5.7 to require that a main_page parameter always accompany a products_id parameter. Couple this with the fact that zen_get_all_get_params doesn't actually return ALL of the parameters in the $_GET array and yes, the page(s) load again and again because of the Ajax request going through the sanitizer and forcing a page reload... the change, presented here: https://github.com/mc12345678/Dynamic_Price_Updater/tree/3.2.1

Though there is one additional feature currently off of that branch (discussed above) to properly respect the upgrade check flag at: https://github.com/mc12345678/Dynamic_Price_Updater/tree/321_correct_update_check

30 Jun 2020, 12:39 AM
#1582
rixstix avatar

rixstix

Totally Zenned

Join Date:
Aug 2009
Location:
North Idaho, USA
Posts:
2,015
Plugin Contributions:
0

Re: Dynamic Price Updater

Thanks for the reply. OK, so the zc plugin DPU is obsolete for anything other than what is listed.

I followed the links, both seem the same. I see references but I don't see a 'download all the correct files' button or a "download the complete plugin" button.

Can you help with a simple explanation of where I am missing the download button?

30 Jun 2020, 1:38 AM
#1583
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: Dynamic Price Updater

RixStix:

Thanks for the reply. OK, so the zc plugin DPU is obsolete for anything other than what is listed.

I followed the links, both seem the same. I see references but I don't see a 'download all the correct files' button or a "download the complete plugin" button.

Can you help with a simple explanation of where I am missing the download button?
On my mobile I didn't see the "big button" either, but when I viewed the source code of the page, I found this link that will download at least the 3.2.1 branch as a zip:
https://github.com/mc12345678/Dynamic_Price_Updater/archive/3.2.1.zip

For the other branch, replace the above 3.2.1 with the branch name.

30 Jun 2020, 1:52 AM
#1584
rixstix avatar

rixstix

Totally Zenned

Join Date:
Aug 2009
Location:
North Idaho, USA
Posts:
2,015
Plugin Contributions:
0

Re: Dynamic Price Updater

Thank you. It's on tomorrow's todo list.

30 Jun 2020, 7:01 PM
#1585
rixstix avatar

rixstix

Totally Zenned

Join Date:
Aug 2009
Location:
North Idaho, USA
Posts:
2,015
Plugin Contributions:
0

Re: Dynamic Price Updater

Thank you. Works as expected, no flashes.

22 Jul 2020, 7:59 PM
#1586
jimmie avatar

jimmie

Totally Zenned

Join Date:
Jan 2013
Location:
New Port Richey, Florida
Posts:
969
Plugin Contributions:
0

Re: Dynamic Price Updater

zen 1.56c php 7.0
i have map pricing module installed (Shows price as - Priced so low Unable to show a price. add to cart to see price.) and this module. when this module is activated it shows the price. how can i not have it effect that module?
also have certain products price at a sq ft. but sold by the box. this module changes the sq ft. price to sold by the box price.
this module also takes away the text before the price and only shows the price.

23 Jul 2020, 10:48 PM
#1587
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: Dynamic Price Updater

jimmie:

zen 1.56c php 7.0
i have map pricing module installed (Shows price as - Priced so low Unable to show a price. add to cart to see price.) and this module. when this module is activated it shows the price. how can i not have it effect that module?
also have certain products price at a sq ft. but sold by the box. this module changes the sq ft. price to sold by the box price.
this module also takes away the text before the price and only shows the price.

For MAP, will need to intercept output of this plugin so that it doesn't attempt to actually show what is in the cart for those product. There is I thought a section of code that somewhat covers this situation. Recommendation would be that the plugin be disabled for product that are tracked by MAP which is done at the beginning of the associated code set in the files added to includes/modules/pages/PRODUCT_TYPE/.

As far as the "sold by the box" versus square foot. This module works off of providing the cost and associated information based off of what the shopping cart itself reports. It is possible to intercept that information and alter it to what is needed for the various product, but whatever it is that makes the product's price display unique upon landing there, needs to be carried over to that processing so that the appropriate "type" of price is shown.

The shopping_cart class has notifiers that could potentially be used knowing that the current page is say the product_info page and/or that the source function/class is/was the DPU class or a function within it, etc... even perhaps one of the notifiers in the DPU class could be used to intercept the value(s) and do some sort of conversion based on information captured from earlier gathered information when the shopping_cart class ($_SESSION['cart']) was "triggered"/accessed.

24 Jul 2020, 2:10 AM
#1588
jimmie avatar

jimmie

Totally Zenned

Join Date:
Jan 2013
Location:
New Port Richey, Florida
Posts:
969
Plugin Contributions:
0

Re: Dynamic Price Updater

found this, added whats in red but didnt work. not sure what phrase i should put there.

if (defined('DPU_STATUS') && DPU_STATUS === 'true') {
  $load = true; // if any of the PHP conditions fail this will be set to false and DPU won't be fired up
  $pid = (!empty($_GET['products_id']) ? (int)$_GET['products_id'] : 0);
  if (0 == $pid) {
    $load = false;
  } elseif (zen_get_products_price_is_call($pid) || zen_get_products_price_is_free($pid) || zen_get_products_map_enabled == 1 || STORE_STATUS > 0) {
    $load = false;
  }
  $pidp = zen_get_products_display_price($pid);
  if (empty($pidp)) {
    $load = false;
  }

and i only want the price to update if product has an attribute

24 Jul 2020, 7:47 AM
#1589
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: Dynamic Price Updater

jimmie:

found this, added whats in red but didnt work. not sure what phrase i should put there.

if (defined('DPU_STATUS') && DPU_STATUS === 'true') {
$load = true; // if any of the PHP conditions fail this will be set to false and DPU won't be fired up
$pid = (!empty($_GET['products_id']) ? (int)$_GET['products_id'] : 0);
if (0 == $pid) {
$load = false;
} elseif (zen_get_products_price_is_call($pid) || zen_get_products_price_is_free($pid) || zen_get_products_map_enabled == 1 || STORE_STATUS > 0) {
$load = false;
}
$pidp = zen_get_products_display_price($pid);
if (empty($pidp)) {
$load = false;
}

> and i only want the price to update if product has an attribute
Right place to add something, the question is if it is the right thing to add. I read || zen_get_products_map_enabled == 1to mean that there is something like a function that is named zen_get_products_map_enabled, though if so, I would add parentheses at the end of that to more accurately reflect that it is a function. Otherwise is that supposed to be a variable? If so it is missing a dollarsign at the beginning: $zen_get_products_map_enabled. Or is it a function that is supposed to take a parameter ($_GET['products_id']) so that it can respond to the question of if the "current" product is affected by map?

BTW, if all this seems "too much", let me know and can provide some more step-by-step searching ideas to better incorporate this concept. 

As far as only updating when product has attributes, then when using the latest software, should note that updates also occur when the product's quantity box is available for edit (following ZC process to determine if the quantity box should be displayed or not). Will need to disable that additional determination which will affect display of price differences caused by quantity discounts and any other determination that is made/shown by way of current quantity in cart and effect of adding additional to the shopping cart as shown on the shopping_cart page.
24 Jul 2020, 11:34 AM
#1590
jimmie avatar

jimmie

Totally Zenned

Join Date:
Jan 2013
Location:
New Port Richey, Florida
Posts:
969
Plugin Contributions:
0

Re: Dynamic Price Updater

the field in database is labeled map_enabled, there are radio buttons on product edit page 0 = off 1 = on

24 Jul 2020, 3:10 PM
#1591
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: Dynamic Price Updater

jimmie:

the field in database is labeled map_enabled, there are radio buttons on product edit page 0 = off 1 = on
If that field is partof the products table, then the following function could be used to lookup the value and take action:

zen_products_lookup($_GET['products_id'], 'map_enabled') == '1'

This function is built into ZC as compared to possibly using a function associated with MAP. If a function is included with MAP to potentially do a similar search, would recommend first validating that the function exists, followed by (anded) the check of the value.

24 Jul 2020, 4:26 PM
#1592
goldbuckle avatar

goldbuckle

Zen Follower

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

Re: Dynamic Price Updater

Does the newest version of DPU work on html pages generated by the Ultimate Urls pluggin? I am currently running DPU 3.2.0 and Ultimate Urls 2.215 and the price displays correctly on .php pages but not on the html pages generated by Ultimate urls. Don't want to waste my time upgrading the Ultimate urls if it does not.
thanks,
John

24 Jul 2020, 5:10 PM
#1593
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: Dynamic Price Updater

GoldBuckle:

Does the newest version of DPU work on html pages generated by the Ultimate Urls pluggin? I am currently running DPU 3.2.0 and Ultimate Urls 2.215 and the price displays correctly on .php pages but not on the html pages generated by Ultimate urls. Don't want to waste my time upgrading the Ultimate urls if it does not.
thanks,
John
I don't have an answer to that, I don't really know of anything that USU does that would/should have an effect on DPU. DPU doesn't check for information on the URI to worry if it is a ".php" versus ".html" page. I would expect that USU doesn't modify the internal $_GET variables in a way that removes existing information. There are other factors that may be at play causing an issue with display (eg. a script error from some other code could prevent DPU script code from firing). It is recommended to use the latest version(s) which include ZC (version not identified in above post).

24 Jul 2020, 7:42 PM
#1594
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: Dynamic Price Updater

GoldBuckle:

Does the newest version of DPU work on html pages generated by the Ultimate Urls pluggin? I am currently running DPU 3.2.0 and Ultimate Urls 2.215 and the price displays correctly on .php pages but not on the html pages generated by Ultimate urls. Don't want to waste my time upgrading the Ultimate urls if it does not.
thanks,
John

mc12345678:

I don't have an answer to that, I don't really know of anything that USU does that would/should have an effect on DPU. DPU doesn't check for information on the URI to worry if it is a ".php" versus ".html" page. I would expect that USU doesn't modify the internal $_GET variables in a way that removes existing information. There are other factors that may be at play causing an issue with display (eg. a script error from some other code could prevent DPU script code from firing). It is recommended to use the latest version(s) which include ZC (version not identified in above post).
Although I haven't heard/seen others having issues with USU and DPU together, doesn't mean that there haven't been those that have had them. I saw your post in the USU forum which was far more detailed than the above. Got me thinking about the possibility that USU might be trying to rewrite othe uri for ajax.php just maybe. As a result some of the "return" code may not be executing and therefore the spinning graphics shows if enabled or if disabled the price doesn't update. (by disabled, I mean the spinning graphic.)

If able, think could PM me a page address of a problem product? Maybe could take a look at the page to see what is going on.

24 Jul 2020, 9:30 PM
#1595
jimmie avatar

jimmie

Totally Zenned

Join Date:
Jan 2013
Location:
New Port Richey, Florida
Posts:
969
Plugin Contributions:
0

Re: Dynamic Price Updater

added this ```
} elseif (zen_get_products_price_is_call($pid) || zen_get_products_price_is_free($pid) || STORE_STATUS > 0 || zen_products_lookup($_GET['products_id'], 'map_enabled') == '1' ) {

thankyou
why the quotes around the 1? (i removed them)
sq ft price versus carton price, my customers want to see what they are paying per sq ft., but buy by the carton (Min, max Units) DPU Looks at this field and changes the price from sq ft to carton. how to stop this action, or only activate for attributes only.?
29 Jul 2020, 2:27 PM
#1596
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: Dynamic Price Updater

jimmie:

added this ```
} elseif (zen_get_products_price_is_call($pid) || zen_get_products_price_is_free($pid) || STORE_STATUS > 0 || zen_products_lookup($_GET['products_id'], 'map_enabled') == '1' ) {

> thankyou
> why the quotes around the 1? (i removed them)
> sq ft price versus carton price, my customers want to see what they are paying per sq ft., but buy by the carton (Min, max Units) DPU Looks at this field and changes the price from sq ft to carton. how to stop this action, or only activate for attributes only.?
I used quotes because data retrieved from the database at least such as that is text when initially retrieved. To evaluate it as a number (integer in this case) it should be type cast to that type. By using a non-quoted value, php attempts to do a form of type casting. Ideally the function would have been prefaced with (int) and then also an exact match used (=== 1). 

As far as evaluating to prevent DPU operation for anything that doesn't have attributes, could recommend the following:

!zen_has_product_attributes($pid)

To be included in the same "path" as the above so that when that is true (doesn't have attributes) that $load will be set to false.
6 Aug 2020, 9:30 PM
#1597
goldbuckle avatar

goldbuckle

Zen Follower

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

Re: Dynamic Price Updater

I am running a clean install of v 1.5.7 with demo product info and then the first thing I did was install DPU 3.2.0 and went to a test product page once I turned on DPU in the admin configuration and the page just keeps refreshing. Not sure where to start to fix it.

6 Aug 2020, 10:10 PM
#1598
rixstix avatar

rixstix

Totally Zenned

Join Date:
Aug 2009
Location:
North Idaho, USA
Posts:
2,015
Plugin Contributions:
0

Re: Dynamic Price Updater

Scroll up to post #1564 and that should help.

8 Aug 2020, 7:45 PM
#1600
jimmie avatar

jimmie

Totally Zenned

Join Date:
Jan 2013
Location:
New Port Richey, Florida
Posts:
969
Plugin Contributions:
0

Re: Dynamic Price Updater

zen version 1.56C php7.0
how can we make the model number change to customid on select,
also would like to add a sku or (custom fields) that change on select.
right now i have picture, price, stock and weight all changing on select. i need to have the model number change to custom id. and i want to use the description field to store barcodes and have them change on select. and have the description field incorporated to lookup of other barcodes
here is my site with example product
https://jnsflooringandsupplies.com/Tools_Equipment/Hardwood_Laminate_Tools/Floor_Nailers_Staplers/Powernail_445_16_Ga._Pneumatic_Cleat_Nailer_w_5MI_White_Mallet

jimmie