Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Replace Quantity Available Message with "Available"

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 04-24-2005, 04:19 PM
 
D.Thornley@salford.ac.uk D.Thornley@salford.ac.uk is offline
 

Member
  
Join Date: Mar 2005
Posts: 22
 

Default 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
__________________
Cart Version 4.0.12
Reply With Quote
  #2  
Old 04-24-2005, 07:08 PM
 
sportruck sportruck is offline
 

Advanced Member
  
Join Date: Dec 2003
Posts: 70
 

Default

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 ""} <TR><TD width="30%">{$lng.lbl_quantity}</TD><TD nowrap><SPAN id="product_avail_txt">{if $product.avail gt 0}{$product.avail}</SPAN>{else}{$lng.txt_no}{/if} {$lng.txt_items_available}</TD></TR>

to...

Code:
{if $config.Appearance.show_in_stock eq "Y" and $config.General.unlimited_products ne "Y" and $product.distribution eq ""} <TR><TD width="30%">{$lng.lbl_quantity}</TD><TD nowrap><SPAN id="product_avail_txt">{if $product.avail gt 0}In Stock</SPAN>{else}Not Available{/if}</TD></TR>

You might also want to change $lng.lbl_quantity to "Availability"
Reply With Quote
  #3  
Old 04-25-2005, 12:22 AM
 
D.Thornley@salford.ac.uk D.Thornley@salford.ac.uk is offline
 

Member
  
Join Date: Mar 2005
Posts: 22
 

Default

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 30 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
__________________
Cart Version 4.0.12
Reply With Quote
  #4  
Old 04-25-2005, 12:50 AM
 
WPOO WPOO is offline
 

Advanced Member
  
Join Date: May 2004
Location: Delft - Netherlands -
Posts: 31
 

Default 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
__________________
X-Cart Gold 4.13
X-Configurator
X-ROM
Easy Checkout
Reply With Quote
  #5  
Old 04-25-2005, 01:00 AM
 
WPOO WPOO is offline
 

Advanced Member
  
Join Date: May 2004
Location: Delft - Netherlands -
Posts: 31
 

Default 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
__________________
X-Cart Gold 4.13
X-Configurator
X-ROM
Easy Checkout
Reply With Quote
  #6  
Old 04-25-2005, 11:03 AM
 
sportruck sportruck is offline
 

Advanced Member
  
Join Date: Dec 2003
Posts: 70
 

Default

Quote:
Originally Posted by D.Thornley@salford.ac.uk
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 30 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

Make sure you did not remove the {/if} at the end of the line.
Reply With Quote
  #7  
Old 04-25-2005, 11:04 AM
 
sportruck sportruck is offline
 

Advanced Member
  
Join Date: Dec 2003
Posts: 70
 

Default Re: I see what happend.

Quote:
Originally Posted by WPOO
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

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.
Reply With Quote
  #8  
Old 04-25-2005, 12:18 PM
 
D.Thornley@salford.ac.uk D.Thornley@salford.ac.uk is offline
 

Member
  
Join Date: Mar 2005
Posts: 22
 

Default nice one

Quote:
Originally Posted by sportruck
Quote:
Originally Posted by D.Thornley@salford.ac.uk
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 30 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

Make sure you did not remove the {/if} at the end of the line.


i think i did .... seems to work now ... thank you for your help

shafiq :sK
__________________
Cart Version 4.0.12
Reply With Quote
  #9  
Old 05-29-2005, 11:01 PM
 
thepbstore thepbstore is offline
 

Newbie
  
Join Date: May 2005
Posts: 6
 

Default Am I just having a blonde moment?

Quote:
Originally Posted by sportruck
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 ""} <TR><TD width="30%">{$lng.lbl_quantity}</TD><TD nowrap><SPAN id="product_avail_txt">{if $product.avail gt 0}{$product.avail}</SPAN>{else}{$lng.txt_no}{/if} {$lng.txt_items_available}</TD></TR>

to...

Code:
{if $config.Appearance.show_in_stock eq "Y" and $config.General.unlimited_products ne "Y" and $product.distribution eq ""} <TR><TD width="30%">{$lng.lbl_quantity}</TD><TD nowrap><SPAN id="product_avail_txt">{if $product.avail gt 0}In Stock</SPAN>{else}Not Available{/if}</TD></TR>

You might also want to change $lng.lbl_quantity to "Availability"

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
__________________
.-=.=-.
Reply With Quote
  #10  
Old 05-31-2005, 04:07 AM
 
thepbstore thepbstore is offline
 

Newbie
  
Join Date: May 2005
Posts: 6
 

Default 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.
__________________
.-=.=-.
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 02:11 PM.

   

 
X-Cart forums © 2001-2020