Re: Dynamic Price Updater
Right. We were focusing on the perpetual spinning wheel and were not able to actually see the price change not taking effect as it was masked completely by the image. It wasn't until turning off the image loading last night that I realized the price wasn't updating at all and I assumed both events - the perpetual spinning and the price not updating - were related. In this product http://www.byvalenti.com/bvostoretem...&products_id=2 with 2 attributes and two different price points the price doesn't update at all. I've turned the mod back on and removed the image loader for you to see the behavior. No error logs are generated.
Thank you!
Re: Dynamic Price Updater
Quote:
Originally Posted by
mvstudio
Right. We were focusing on the perpetual spinning wheel and were not able to actually see the price change not taking effect as it was masked completely by the image. It wasn't until turning off the image loading last night that I realized the price wasn't updating at all and I assumed both events - the perpetual spinning and the price not updating - were related. In this product
http://www.byvalenti.com/bvostoretem...&products_id=2 with 2 attributes and two different price points the price doesn't update at all. I've turned the mod back on and removed the image loader for you to see the behavior. No error logs are generated.
Thank you!
No thank you for continuing to test. I've sent a PM with some proposed code changes to try to address this. If it works, then I have a good starting point on which to further improvement to get over what looks like a proxy server related issue. If it seems to resolve the issue (or doesn't) I have another idea, but ultimately I can see a need for some code changes to make addressing things like this a little easier/cleaner. I am aware of one solution reported to work, but I'm concerned of the ramifications.
Also, regarding the spinning image and disabling "replace" there is a code change/modification that would allow the image to appear, but not obscure the price(s). An admin switch has not yet been added to do this, but I think it would help.
The subject code change to allow it to appear but not replace the text is to modify includes/modules/pages/product_info/jscript_dynamic_price_updater.php line 49 from:
Code:
var imgLoc = "replace"; // Options are "replace" or , "" (empty)
to:
Code:
var imgLoc = ""; // Options are "replace" or , "" (empty)
by deleting just the word replace... This will revert DPU back to an "earlier" condition where the image would appear for posterity. :)
Then reenable loading the image from the configuration menu.
Re: Dynamic Price Updater
Hi all,
just trying a small modification. Actually the plugin is working great, i would like to modify it so that if an article is out of stock (quantity = 0) an image is displayed instead of the price. In the old version of my site i have modified the file \includes\templates\YOUR_TEMPLATES\templates\tpl_product_info_display.php adding around lines 83 (after the // base price start) the following:
PHP Code:
//BOF No price if out of stock, show image instead
//echo $one_time . ((zen_has_product_attributes_values((int)$_GET['products_id']) and $flag_show_product_info_starting_at == 1) ? TEXT_BASE_PRICE : '') . zen_get_products_display_price((int)$_GET['products_id']);
if ($products_quantity > 0) {
echo $one_time . ((zen_has_product_attributes_values((int)$_GET['products_id']) and $flag_show_product_info_starting_at == 1) ? TEXT_BASE_PRICE : '') . zen_get_products_display_price((int)$_GET['products_id']);
} else {
echo "<img src=images/esaurito.gif>";
}
//EOF No price if Out of stock, show images instead
I've done the same with the new version of my site (which have installed last version of DPU) but after displying the OUT OF STOCK image for a few second, DPU replace it with the price...
Before messing with DPU code I prefere to ask if someone have a good hint on how to have it work.
Thanks
Zencart 1.55e
DPU last version
Re: Dynamic Price Updater
Quote:
Originally Posted by
izar74
Hi all,
just trying a small modification. Actually the plugin is working great, i would like to modify it so that if an article is out of stock (quantity = 0) an image is displayed instead of the price. In the old version of my site i have modified the file \includes\templates\YOUR_TEMPLATES\templates\tpl_product_info_display.php adding around lines 83 (after the // base price start) the following:
PHP Code:
//BOF No price if out of stock, show image instead
//echo $one_time . ((zen_has_product_attributes_values((int)$_GET['products_id']) and $flag_show_product_info_starting_at == 1) ? TEXT_BASE_PRICE : '') . zen_get_products_display_price((int)$_GET['products_id']);
if ($products_quantity > 0) {
echo $one_time . ((zen_has_product_attributes_values((int)$_GET['products_id']) and $flag_show_product_info_starting_at == 1) ? TEXT_BASE_PRICE : '') . zen_get_products_display_price((int)$_GET['products_id']);
} else {
echo "<img src=images/esaurito.gif>";
}
//EOF No price if Out of stock, show images instead
I've done the same with the new version of my site (which have installed last version of DPU) but after displying the OUT OF STOCK image for a few second, DPU replace it with the price...
Before messing with DPU code I prefere to ask if someone have a good hint on how to have it work.
Thanks
Zencart 1.55e
DPU last version
So, one of the future features desired for this is to allow it to consider the status of stock of an attribute or attribute combination. Considering that this is being used to support attribute selection, I would think that while you may not have such implemented, that you might have interest in such future capability. With that in mind, there are a few places I could see some code modification to support the possibility of attribute stock determination without requiring significant rework in the future, or a way to just have DPU not load/activate if the products_quantity within the products table is 0 or less (this part assuming that it is not desirable/possible for the store to "oversell" product).
Most of the modification I would see in the includes/classes/dynamic_price_updater.php file, possibly in the insertProduct function where some data would be collected based on the current selection(s), to test the quantity of product available in the store, and then in prepareOutput to consider that data collected and basically assign the "price" to your html for your image (suggest to build the image using the ZC built in functions rather than "hard coding", but whatever seems to work I guess). This way, when the "price" is replaced, it will update the image with whatever your "sold-out" image is.
If you just want to cut DPU off at the pass, then in the top of includes/modules/pages/product_info/jscript_dynamic_price_updater.php (or includes/modules/pages/YOUR_PRODUCT_TYPE/jscript_dynamic_price_updater.php) add an additional test for no quantity of the product and whatever further "allowance" to disable DPU on this product page and therefore, the image added to your template file will not be displayed.
Then, there is the thought that perhaps the price should be displayable AND an image to be provided... That can be accomplished in either of the above two ways or by modifying the insertion point of the image in the template file to be outside the class identifiers for where the price is to be displayed. But, it would seem that if that were the case or desired, then the original change would not have been made. Unfortunately such a modification (not displaying price) also leaves "everyone" in the dark about whether the site is competitive for recently out-of-stock items or as unmonitored/out-of-date for product that remain visible for an extended period of time.
Re: Dynamic Price Updater
Hi Mc,
as always You are full of ideas and hints!
First thing first, the last one you wrote is something I was considering just know. Why show just the image and not the price? Logically the image showing the OUT OF STOCK status is good, but removing the price could, as You stated, make some customer considering looking elsewhere cause the price is not competitive.
Dunno if this is the better way, commercially speaking, but now that You have highlighted it I could not stop thinking that i have to try it. More, doing so I will avoid a huge coding (It just show an image when the quantity is 0 or below).
Just for coding purpose I've tried to modify the includes/modules/pages/product_info/jscript_dynamic_price_updater.php adding test for quantity, still testing.
Re: Dynamic Price Updater
Currently i have modified the code and the positioning of the image, if the quantity is 0 or below.
Modified the file :includes\templates\YOUR_TEMPLATES\templates\tpl_product_info_display.php around line 80
PHP Code:
<!--bof Product Price block -->
<div id="productOFS">
<!--BOF No price if out of stock, show image instead-->
<?php
if ($products_quantity <= 0) {
echo "<img src=images/esaurito.gif>";
}
?></div>
<!--EOF No price if Out of stock, show images instead-->
<h2 id="productPrices" class="productGeneral">
I also added a class #productOFS in stylesheet.css so to have more control over the display of the image.
Re: Dynamic Price Updater
Quote:
Originally Posted by
izar74
Currently i have modified the code and the positioning of the image, if the quantity is 0 or below.
Modified the file :includes\templates\YOUR_TEMPLATES\templates\tpl_product_info_display.php around line 80
PHP Code:
<!--bof Product Price block -->
<div id="productOFS">
<!--BOF No price if out of stock, show image instead-->
<?php
if ($products_quantity <= 0) {
echo "<img src=images/esaurito.gif>";
}
?></div>
<!--EOF No price if Out of stock, show images instead-->
<h2 id="productPrices" class="productGeneral">
I also added a class #productOFS in stylesheet.css so to have more control over the display of the image.
Sounds like a plan. :)
Btw, note that the image will display any time quantity is less than or equal to zero, even if you choose later to allow back ordering product from your store. Would recommend documenting something regarding that in case you ever choose to allow back ordering and to help on upgrade of your file(s) as well to understand the capabilities/restrictions of the content.
Re: Dynamic Price Updater
I dont know if this has been mentioned previously or not, but in trying to install DPU, I kept getting a complete site crash on upload. Setting DPU Status to False had no effect on this. I personally am just begaining to learn PHP, so I have no idea as to what incompatibilities I should be looking for, however I do know how to narrow it down to what files in general are the problem-causers.
For referance, I am running Zen-Cart 1.5.5d, and DPU 3.0.8.
Includes > auto_loaders > jscript_dynamic_price_updater is causing the entire site crash. Removing it alone made everything run again, but I'm FAIRLY certain it's an important file to have. This did leave me with compleatly blank screens however, when I went to an actual product discription page.
Removing Includes > modules> pages > product_info > jscript_dynamic_price_updater fixed the white-page issue, but it doesn't matter, as with those two files removed, the module wouldn't work in the first place...
Re: Dynamic Price Updater
Quote:
Originally Posted by
Lordzoabar
I dont know if this has been mentioned previously or not, but in trying to install DPU, I kept getting a complete site crash on upload. Setting DPU Status to False had no effect on this. I personally am just begaining to learn PHP, so I have no idea as to what incompatibilities I should be looking for, however I do know how to narrow it down to what files in general are the problem-causers.
For referance, I am running Zen-Cart 1.5.5d, and DPU 3.0.8.
Includes > auto_loaders > jscript_dynamic_price_updater is causing the entire site crash. Removing it alone made everything run again, but I'm FAIRLY certain it's an important file to have. This did leave me with compleatly blank screens however, when I went to an actual product discription page.
Removing Includes > modules> pages > product_info > jscript_dynamic_price_updater fixed the white-page issue, but it doesn't matter, as with those two files removed, the module wouldn't work in the first place...
So, when an error occurs, in particular a blank screen, then suggest following the instruction provided here: https://www.zen-cart.com/content.php?124-blank-page
That said, would recommend verifying proper placement of files as there is no: includes/autoloaders/jscript_dynamic_price_updater file. Files that begin with jscript_ are expected to be in a template directory or a directory within includes/modules/pages. Nothing prevents them from being elsewhere, just not common practice and this plugin specifically doesn't have any in the autoloaders directory.
Re: Dynamic Price Updater
That is actually my bad, I ment to write Includes > auto_loaders > config.dynamic_price_updater, not the jscript. As far as placement goes, I have triple checked my uploads, and everything is where it is supposed to be.