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

Change "From 1 to X" to "Quantity in stock:"
 
Reply
   X-Cart forums > X-Cart 4 > Changing and adding new features
 
Thread Tools Search this Thread
  #1  
Old 07-11-2010, 09:30 AM
 
Sisom Sisom is offline
 

eXpert
  
Join Date: Sep 2006
Posts: 310
 

Default Change "From 1 to X" to "Quantity in stock:"

I have just completed this work on 4.3.2, I expect it is very similar, if not identical, in earlier versions:

I wanted the product box to say
Quantity [1 ] Quantity in stock: 12

instead of

Quantity [1 ] (from 1 to 12)

after the number of items selection box.

(I ticked "Show quantity selector as input textbox" in General Settings, Appearance Options.)

I edited customer/main/buy_now.tpl as follows:
I changed this part:
Code:
{if $config.General.unlimited_products ne 'Y'} <span class="quantity-text">{$lng.lbl_product_quantity_from_to|substitute:"min":$product.appearance.min_quantity:"max":$product.avail}</span> {/if}


to this:

Code:
{if $config.General.unlimited_products ne 'Y'} {* COMMENTING OUT OLD "FROM 1 TO X" TEXT *} {* <span class="quantity-text">{$lng.lbl_product_quantity_from_to|substitute:"min":$product.appearance.min_quantity:"max":$product.avail}</span>*} {* INSERTING "QUANTITY IN STOCK: X" INSTEAD *} <span class="quantity-text">{$lng.lbl_quantity_in_stock|substitute:"max":$product.avail}</span> {/if}

(You can delete the commented out text completely if you like, I prefer to leave it so that I can see what I have done!)

Then I went to Languages, and created the new label,
lbl_quantity_in_stock

so that it says:
Code:
Quantity in stock: <span class="product-quantity-number">{{max}}</span>

Now your product page should show:
Quantity [1 ] Quantity in stock: 12

Which I think is clearer than "from 1 to 12".
__________________
X-Cart Gold Version 4.3.2
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Changing and adding new features


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 08:24 PM.

   

 
X-Cart forums © 2001-2018