Results 1 to 5 of 5
  1. #1
    Join Date
    Jul 2009
    Location
    Somerset, UK.
    Posts
    70
    Plugin Contributions
    0

    Default 1 Units in Stock!!

    Hi All,

    I don't even know which forum to ask this in but as I am a newbie I'll start here.

    Is it posible to get it to work so that if only 1 Unit is in stock then it says Unit, but changes to Units when more than one.

    Going futher is it posible to change the word 'Unit' depending on the Category that the product.

    So for example it says Necklace or Necklaces OR Bracelet or Bracelets and do on.

    Thanks for any help.
    FTF

  2. #2
    Join Date
    Sep 2004
    Location
    Western Massachusetts
    Posts
    2,945
    Plugin Contributions
    5

    Default Re: 1 Units in Stock!!

    Edit your product_info_display template:
    Replace this line
    PHP Code:
      <?php echo (($flag_show_product_info_quantity == 1) ? '<li>' $products_quantity TEXT_PRODUCT_QUANTITY '</li>'  '') . "\n"?>
    with this
    PHP Code:
      <?php echo (($flag_show_product_info_quantity == 1) ? '<li>' $products_quantity . ($products_quantity == TEXT_PRODUCT_QUANTITY_SINGLE TEXT_PRODUCT_QUANTITY_PLURAL) . '</li>'  '') . "\n"?>
    Then add the two language defines into your custom language file:
    PHP Code:
    define('TEXT_PRODUCT_QUANTITY_SINGLE''Unit in Stock');
    define('TEXT_PRODUCT_QUANTITY_PLURAL''Units in Stock'); 
    Neville
    An assumption is what you arrive at when you get tired of thinking...

  3. #3
    Join Date
    Jul 2009
    Location
    Somerset, UK.
    Posts
    70
    Plugin Contributions
    0

    Default Re: 1 Units in Stock!!

    Thanks.

    Was the request to change the word 'Units' according to the item category a bridge too far??

    Cheers.
    FTF

  4. #4
    Join Date
    Sep 2004
    Location
    Western Massachusetts
    Posts
    2,945
    Plugin Contributions
    5

    Default Re: 1 Units in Stock!!

    That would prove very tricky if you want the categories displayed as plural in the nav sidebox and product list headings and then as singular/plural in the product counts. It can be done, but you'd need to enter the category titles as singular and then modify places where you need to display plurals - and your code would have to handle situations where the plural is -ies as well as just -s. More than a one-line code change...
    Neville
    An assumption is what you arrive at when you get tired of thinking...

  5. #5
    Join Date
    Jul 2009
    Location
    Somerset, UK.
    Posts
    70
    Plugin Contributions
    0

    Default Re: 1 Units in Stock!!

    Ok, thanks for your help.
    FTF

 

 

Similar Threads

  1. Show "in stock" instead of showing units in stock
    By gustafr in forum Templates, Stylesheets, Page Layout
    Replies: 69
    Last Post: 7 Aug 2015, 04:26 AM
  2. 0 units in stock ....
    By montello1984 in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 13 Apr 2015, 03:45 PM
  3. Display - units amount purchased instead of units in stock
    By evok20 in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 13 Aug 2011, 05:15 PM
  4. Units in Stock
    By rdcast in forum General Questions
    Replies: 3
    Last Post: 8 Apr 2011, 11:20 PM
  5. # Units in stock
    By ambivert in forum Customization from the Admin
    Replies: 15
    Last Post: 30 May 2008, 11:23 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg