![]() |
Replace Quantity Available Message with "Available"
Hi ...
On the product detail template page (product.tpl) rather than having a message for the Quantity that displays how many items are available in stock, can that be replaced with something simple like "Item is Available" and for items that are out of stock display something like "Item is Currently on Order" ... is this possible ? thanks & regards Shafiq :sK |
File: /customer/main/product.tpl
Change... Code:
{if $config.Appearance.show_in_stock eq "Y" and $config.General.unlimited_products ne "Y" and $product.distribution eq ""} to... Code:
{if $config.Appearance.show_in_stock eq "Y" and $config.General.unlimited_products ne "Y" and $product.distribution eq ""} You might also want to change $lng.lbl_quantity to "Availability" |
i tried that ....
and got the following message: Fatal error: Smarty error: [in customer/main/product.tpl line 151]: syntax error: unclosed tag {else} (opened line 10). (Smarty_Compiler.class.php, line 308) in /usr/local/home/httpd/vhtdocs/www/Smarty-2.6.3/Smarty.class.php on line 1082 any ideas ? should i need to upgrade to version 4.0.13 for this to work ? thanks shafiq :sK |
Not working for me -do i need to change anything else
I like the mod but when i try it nothing happens.
Do i need to change anything else? WP |
I see what happend.
It only shows up on the detailed page. I would like it to show up on the page with all the products too. Is there a way to do this?
WP |
Quote:
Make sure you did not remove the {/if} at the end of the line. |
Re: I see what happend.
Quote:
I don't think the quantity is the in the products array when viewing products_t.tpl, you would need to modify the php to do that. |
nice one
Quote:
i think i did .... seems to work now ... thank you for your help :) shafiq :sK |
Am I just having a blonde moment?
Quote:
Ok basically I did this, I even played around with the code myself, looked into the PHP side too, and well I can see when out of stock it says No, but when it's in stock still shows Numbers, how do I get rid of the numbers I just want it to simply say Available. Thanks for the info, but it's probably just me having a moment.. xcart 4/13 |
Official Modification
How I was saying about the Numbers I have fixed it, if any one else was looking for a code like this, in 4.X/13 I have made it work.
{if $config.Appearance.show_in_stock eq "Y" and $config.General.unlimited_products ne "Y" and $product.distribution eq ""} <TR><TD width="30%">In Stock</TD><TD nowrap>{if $product.avail gt 0}<font color=green>In Stock</font>{else}<font color=red>Out Of Stock</font>{/if}</TD></TR> {/if} os the new code, replace it in your /cart/skin1/customer/main/product.tpl Around line 27.. hope this helps and I have included the simple Red if out, Green if in font colors, you can change as you desire. Hope everyone enjoys and good luck out there. |
I tried this and it works fine...but if you have product options, then the instock quantity displays the number. I found the source of this --> Modules --> Product_Options --> check_options.tpl. Anybody know how to fix the javascript so it displays a txt_message such as "In Stock" instead of the quantity available?
|
I ran into the same problem, for others who want this the work; there is just a minor extra modification needed:
Change this Code:
{if $config.Appearance.show_in_stock eq "Y" and $config.General.unlimited_products ne "Y" and $product.distribution eq ""} to: Code:
{if $config.Appearance.show_in_stock eq "Y" and $config.General.unlimited_products ne "Y" and $product.distribution eq ""} That should do it |
When i used that mod all it did was just show In Stock even if it was out of stock??
|
All times are GMT -8. The time now is 10:27 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.