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

Dynamic Price Updater

Views: 342,302

Results 1,341 to 1,360 of 1,701
30 Jul 2017, 10:47 AM
#1341
calljj avatar

calljj

Zen Follower

Join Date:
Mar 2007
Posts:
253
Plugin Contributions:
2

Dynamic Price Updater

Firstly, many thanks for this mod, installed and worked straight away, can't believe its taken me so long to get around to using it!

A quick ask, incase i'm missing it, but when products are on discount (and priced by attributes) the discounted prices updates and displays all fine without error, but the "original" price (the one crossed out - reference span normalPrice) doesn't change to reflect the difference of original prices.

30 Jul 2017, 4:40 PM
#1342
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: Dynamic Price Updater

Calljj:

Firstly, many thanks for this mod, installed and worked straight away, can't believe its taken me so long to get around to using it!

A quick ask, incase i'm missing it, but when products are on discount (and priced by attributes) the discounted prices updates and displays all fine without error, but the "original" price (the one crossed out - reference span normalPrice) doesn't change to reflect the difference of original prices.

Glad that you found this then. :)

That is correct for the current operation, basically it updates the "bottom line" for the customer as determined by the shopping_cart class. At this time, it does not update each of the other associated price displays.

Edits can be made to modify what is displayed/replaced to support other presentations, but that is currently outside of the base coding of this module.

31 Jul 2017, 5:58 AM
#1343
calljj avatar

calljj

Zen Follower

Join Date:
Mar 2007
Posts:
253
Plugin Contributions:
2

Re: Dynamic Price Updater

That's a shame as it confuses the customers on sale items especially if there is a big price difference between the cheapest and the most expensive attribute- when for example the normal price of £5 is struck through, it says save 25% and then the 'sale' price says £100!

31 Jul 2017, 6:32 AM
#1344
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: Dynamic Price Updater

Calljj:

That's a shame as it confuses the customers on sale items especially if there is a big price difference between the cheapest and the most expensive attribute- when for example the normal price of £5 is struck through, it says save 25% and then the 'sale' price says £100!
Right, but the struck through price should say starting at. Now, you could also do other things with the code to have it simply replace the whole value once selections have begun to be made or not display the crossed through price, etc... right now though that's an extra feature that is not (yet) in my own priority list, unfortunately. It does strengthen my thought (if not already captured in say ZC 1.6.0) of a "price" function that returns all of the values associated with price display. Right now the vprice value returned is just the bottom line. Other prices could be determined, fed and then displayed. At the moment with this plugin id like the display to change as each priced by attribute attribute is selected or at least in the three conditions that the text is modified (starting at, at least, and your price).

1 Aug 2017, 11:45 AM
#1346
calljj avatar

calljj

Zen Follower

Join Date:
Mar 2007
Posts:
253
Plugin Contributions:
2

Re: Dynamic Price Updater

mc12345678:

@Calijj,

I created an issue on github: https://github.com/mc12345678/Dynamic_Price_Updater/issues/10 to address/track this.

Thanks you for adding, i do feel like this would be a valid part of the module.

1 Aug 2017, 11:49 AM
#1347
calljj avatar

calljj

Zen Follower

Join Date:
Mar 2007
Posts:
253
Plugin Contributions:
2

Re: Dynamic Price Updater

on a tangent.. i have a finance calculator that uses the "base price" of a product when the products_page is loaded and gives payment information to the customer. lets call this finance_calc.php. Could you point me in the direction that i could tap into getting the current price of the option that is displayed to then pass across and reload the finance_calc.php.
This would enable the ultimate for me, which is the all the deposit ammounts, terms etc would all change to reflect the different attributes as they are selected. happy to fund this if that's what is required.

7 Aug 2017, 2:53 PM
#1348
calljj avatar

calljj

Zen Follower

Join Date:
Mar 2007
Posts:
253
Plugin Contributions:
2

Re: Dynamic Price Updater

Just also noticed that if i do a salemaker for a category discount, and one of those products in the sale is Zero stock.
The discounted price says "0.00"

7 Aug 2017, 4:34 PM
#1349
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: Dynamic Price Updater

Calljj:

Just also noticed that if i do a salemaker for a category discount, and one of those products in the sale is Zero stock.
The discounted price says "0.00"

So, until now hadn't seen the previous message/request about "throwing" the current price of the selected options to or back to another piece of software. Also, regarding the above, there isn't anything in the price determination code to pick up on being "out-of-stock" in some sub-variant. There can be, it's just not there at the moment. Code would likely go into the class file for dpu in includes/classes. Though I am also trying to figure out the configuration that causes this. Is the problem being seen on the product's listing page (multiple product being displayed) or on the product info page (which at the moment doesn't make sense per se, or may need to be "worked around")?

8 Aug 2017, 8:31 AM
#1350
calljj avatar

calljj

Zen Follower

Join Date:
Mar 2007
Posts:
253
Plugin Contributions:
2

Re: Dynamic Price Updater

mc12345678:

So, until now hadn't seen the previous message/request about "throwing" the current price of the selected options to or back to another piece of software. Also, regarding the above, there isn't anything in the price determination code to pick up on being "out-of-stock" in some sub-variant. There can be, it's just not there at the moment. Code would likely go into the class file for dpu in includes/classes. Though I am also trying to figure out the configuration that causes this. Is the problem being seen on the product's listing page (multiple product being displayed) or on the product info page (which at the moment doesn't make sense per se, or may need to be "worked around")?

Issue occurs on the product_info page. I'm not using any stock by attributes mods. just simply if the main product stock level is zero, the discounted price goes to zero (the original rrp remains the same).

8 Aug 2017, 11:41 AM
#1351
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: Dynamic Price Updater

Calljj:

on a tangent.. i have a finance calculator that uses the "base price" of a product when the products_page is loaded and gives payment information to the customer. lets call this finance_calc.php. Could you point me in the direction that i could tap into getting the current price of the option that is displayed to then pass across and reload the finance_calc.php.
This would enable the ultimate for me, which is the all the deposit ammounts, terms etc would all change to reflect the different attributes as they are selected. happy to fund this if that's what is required.

That final operation is a bit outside this plugin, but... there are a number of tools within it that would aid/support getting the desired result and/or that could be combined into the associated functionality (that way system doesn't have to double dip for data/info, just needs to be handled/processed either on the php side or the javascript side or both.)

8 Aug 2017, 12:22 PM
#1352
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: Dynamic Price Updater

Calljj:

Issue occurs on the product_info page. I'm not using any stock by attributes mods. just simply if the main product stock level is zero, the discounted price goes to zero (the original rrp remains the same).

What are the settings for stock related to product availability when "sold out", is it possible to purchase items that have a quantity of 0 or less, or are items just on display that are at 0 or less, what conditions are necessary to reproduce the issue so that can incorporate a fix as necessary?

The price that is displayed for the product and attribute selection is based off of attempting to add the product to the cart and figuring out from there what the price became. If something say prevented adding to the cart or gives such a 0 price, then that's the end result as far as this plugin is concerned.

9 Aug 2017, 9:16 AM
#1353
calljj avatar

calljj

Zen Follower

Join Date:
Mar 2007
Posts:
253
Plugin Contributions:
2

Re: Dynamic Price Updater

mc12345678:

What are the settings for stock related to product availability when "sold out", is it possible to purchase items that have a quantity of 0 or less, or are items just on display that are at 0 or less, what conditions are necessary to reproduce the issue so that can incorporate a fix as necessary?

The price that is displayed for the product and attribute selection is based off of attempting to add the product to the cart and figuring out from there what the price became. If something say prevented adding to the cart or gives such a 0 price, then that's the end result as far as this plugin is concerned.

Products are set to display only when stock is 0.
to replicate, just set a standard product to zero stock quantity, no priced by attributes, then discount it.
the original price shows, the discount price = 0.00

9 Aug 2017, 10:57 AM
#1354
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: Dynamic Price Updater

Calljj:

Products are set to display only when stock is 0.
to replicate, just set a standard product to zero stock quantity, no priced by attributes, then discount it.
the original price shows, the discount price = 0.00
Thank you for that information. Will look into one or more ways to address it. It sounds like based on the discussion of the product being out-of-stock that it the store is setup to not allow purchase of product if the quantity is 0 or less. Therefore that will be/become a factor moving forwards.

It does make me wonder how much if any of the shopping_cart related operation can be hooked into to allow the "addition" of a product in this condition so that the price updating can be visualized, but not to allow the addition of the product through another process. Otherwise (without editing the shopping_cart class), price updating may not be permitted for product that are out-of-stock when store is set to require a positive quantity of stock to add product to the cart.

Of course an alternative would be to include a separate version of a shopping_cart type class that does allow such a condition, but then it would need to either be maintained in parallel with the version of ZC or any other changes uniquely made to it, which just makes things more difficult to maintain consistent operation and the software.

A potential middle ground to that could be to evaluate the in-stock quantity and then manage the price determination based on that knowledge. :/

Some things to review and determine.

If you believe you need a temporary fix to the issue in the interim I can advise how to disable the price update feature for this condition.

In: includes/modules/pages/YOUR_PRODUCT_TYPE/jscript_dynamic_price_updater.php

Before the last line of this code (code section starts about line 23):

if (empty($pidp)) {
    $load = false;
  }
  if ($load)

Make it look like:

if (empty($pidp)) {
    $load = false;
  }

  if ($load && STOCK_ALLOW_CHECKOUT === 'false') {
    $pid_quant = $db->Execute("SELECT products_quantity FROM " . TABLE_PRODUCTS . " WHERE products_id = ". (int)$pid, false, false, 0, true);
    if ($pid_quant->EOF || $pid_quant->fields['products_quantity'] <= 0) {
      if (zen_get_products_special_price((int)$pid, false) !== false) {
        $load = false;
      } 
    }
  }
   
  if ($load)

This is based on the report that there is an issue when a special/sale exists for a product that has a stock quantity of zero and the store does not permit "over-purchase" of the quantity. It does not address the possibility of quantity discounts having the same "result" of displaying the discounted price as 0.

17 Aug 2017, 5:42 PM
#1355
calljj avatar

calljj

Zen Follower

Join Date:
Mar 2007
Posts:
253
Plugin Contributions:
2

Re: Dynamic Price Updater

HI, thanks for reply, just tried the code change but didnt make any difference.
Just noticed same issue applies to any product (discounted or not) if quantity set to 0, and setting for checkout not allowed when quantity is 0.

17 Aug 2017, 6:11 PM
#1356
calljj avatar

calljj

Zen Follower

Join Date:
Mar 2007
Posts:
253
Plugin Contributions:
2

Re: Dynamic Price Updater

just noticed that if the setting "Show Sold Out Image in place of Add to Cart" is set to 1, then i just get 0.00 displayed for the price.
if the setting is set to 0, then the price displays fine.
one presumes that DPU is linked to this setting somehow?

17 Aug 2017, 7:10 PM
#1357
calljj avatar

calljj

Zen Follower

Join Date:
Mar 2007
Posts:
253
Plugin Contributions:
2

Re: Dynamic Price Updater

So ,based on digging, found the only way i can get the price to still display correctly when product is sold out is to change the template file
tpl_product_info_display.php

find

$display_button = zen_get_buy_now_button($_GET['products_id'], $the_button);

and after it add

  //jf added for dynamic price updater DPU----------------
if (strpos($display_button, 'button_sold_out.gif') !== false) {
$display_button  = '<input type="hidden" name="cart_quantity" value="1" />' .  zen_draw_hidden_field('products_id', (int)$_GET['products_id']) .  $display_button ;
}
     //eof jf add-------------------------------

this passes the hidden quantity and value fields which it appears DPU requires to calculate its values

18 Aug 2017, 10:53 AM
#1358
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: Dynamic Price Updater

Based on the additional information afforded by the above. There is a code modification that I am staging to github to address this issue such that DPU will still update prices of product with attributes even for product that are out-of-stock.

This change does not require modification of the template files. Further, it will identify the price associated based on the quantity identified by the ZC function zen_get_buy_now_qty for product that are out-of-stock and for quantity entered as zero or negative.

19 Aug 2017, 12:34 PM
#1359
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: Dynamic Price Updater

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

31 Aug 2017, 7:29 AM
#1360
diamond1 avatar

diamond1

Zen Follower

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

Re: Dynamic Price Updater

I installed dpu, but I have a problem and I had to disable it.

The problem is that in admin I see who's online no longer has the normal link but this:

/ajax.php?act=DPU_Ajax&method=dpu_update

Also if you look at generate generate source i get this one:
</ Head>

<Body id = "productinfoBody" onload = "try { #### init (); } Catch (dpu_err) { #### console.log (dpu_err.stack); }; ">

I think something in my installation does not go you even see who is online /ajax.php?act=DPU_Ajax&method=dpu_update