New Zenner
- Join Date:
- Jul 2007
- Posts:
- 1
- Plugin Contributions:
- 0
Post #1 by travlinstranger
Hi.
Can anyone tell me how I might be able to hide the price of an item when it's out of stock?
Thanks in advance
Gary
New Zenner
Hi.
Can anyone tell me how I might be able to hide the price of an item when it's out of stock?
Thanks in advance
Gary
Oba-san
You could customize your template with the templates and overrides od tpl_product_info_display.php based on the variable $products_quantity on that page ...
Look for the section where the price is blocked out and throw an IF around it to not show the price or show your text etc. when the $products_quantity <= 0 ...
Linda McGrath
If you have to think ... you haven't been zenned ...
Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here
Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!
New Zenner
Ajeh:
You could customize your template with the templates and overrides od tpl_product_info_display.php based on the variable $products_quantity on that page ...
Look for the section where the price is blocked out and throw an IF around it to not show the price or show your text etc. when the $products_quantity <= 0 ...
I managed to remove the product price when quantity was 0 or less by editing the file that Linda mentioned. Here is what I did (using ZenCart 1.3.8a):
Copied the file catalog/includes/templates/tpl_product_info_display.php into my
catalog/includes/templates/OVER_RIDE_DIR/templates/ directory.
In the file I copied, I found the Product Price Block section.
Then located the line
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']);
and replaced it with
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 $one_time . ((zen_has_product_attributes_values((int)$_GET['products_id']) and $flag_show_product_info_starting_at == 1) ? TEXT_BASE_PRICE : '') ;
}
I have the options set to show the product when it is still marked "in stock" but the quantity drops to 0 or less. Now the price is not shown when the quantity is <= 0.
I used this because my wife makes baskets and lists each one as a separate product. When one is sold, she moves it to a "sold" category. She still wants the previously available basket to show so others can see her past creations, but no price shows up on the product page. You can see it in action at http://naturalfiberbaskets.com.
Thanks again to the ZenCart team and the support in this forum.
Doug Younkin
Natural Fiber Baskets - One-of-a-kind baskets made with care from locally grown plant materials.
New Zenner
Is it possible to apply a similar fix to the product listing page?
I'd like to hide the price and display a sold out button instead.
Thanks
d.
New Zenner
Instead of blanking out the price I put in my sold out button.
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=\"http://URL TO SOLD OUT GIF\" title=\"Sold Out\" alt=\"Sold Out\" />";
}
Tell staff why this post should be reviewed.