X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing and adding new features (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   Change "From 1 to X" to "Quantity in stock:" (https://forum.x-cart.com/showthread.php?t=54561)

Sisom 07-11-2010 09:30 AM

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".


All times are GMT -8. The time now is 03:25 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.