X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   Displaying "item" or "items" in minicart (https://forum.x-cart.com/showthread.php?t=55401)

Sisom 09-04-2010 01:38 PM

Displaying "item" or "items" in minicart
 
This mod gets rid of the word "item(s)" in the minicart, and instead will put "item" for one item, or "items" for more than one item.
This is for 4.3, but will probably be similar in other versions. You will lose the minicart tooltip by using this method, I expect that can be easily added in by somebody else if they want to.

Edit customer/minicart_total.tlp


and on line 11 (I think, this may be a few lines out as I've moved things about a bit while working on this), delete the following line:
Code:


{$lng.lbl_cart_X_items_total|substitute:x:$minicart_total_items:total:$total}


and insert the following instead:
Code:

{$minicart_total_items} {$lng.lbl_item}{if $minicart_total_items > 1}s{/if} {$total}


That works fine, as long as you don't need the Minicart mouseover tooltip, because

the label 'lbl_cart_X_items_total' is as follows:
Code:

<span  class="minicart-items-value">{{x}}</span>&nbsp;<span  class="minicart-items-label">item</span>&nbsp;<span  class="minicart-items-delim">/</span>&nbsp;<span  class="minicart-items-total help-link" onmouseover="javascript: viewTooltip(this, txt_minicart_total_note);">{{total}}</span>


My solution uses the much simpler label 'lbl_item' which is, of course, "item".


All times are GMT -8. The time now is 10:00 AM.

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