1 Item not 1 Items

  • Posts: 78
  • Thank you received: 3
11 years 6 months ago #98403

Any way to get it to display the word "item" and not "items" when there is only 1?

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
11 years 6 months ago #98465

Hi,

You can edit the view "product / quantity" and add an if condition around:
echo '<span class="hikashop_product_stock_count">'.JText::sprintf('X_ITEMS_IN_STOCK',$this->row->product_quantity).'</span><br/>';

Like:

if($this->row->product_quantity == 1)
    echo '<span class="hikashop_product_stock_count">'.JText::sprintf('X_ITEMS_IN_STOCK',$this->row->product_quantity).'</span><br/>';
else
    echo '<span class="hikashop_product_stock_count">'.JText::sprintf('X_ITEM_IN_STOCK',$this->row->product_quantity).'</span><br/>';

And add the translation "X_ITEM_IN_STOCK" in the language file with the desired translation.

Please Log in or Create an account to join the conversation.

  • Posts: 78
  • Thank you received: 3
11 years 6 months ago #98467

I'm not trying to sound like an **** [Self-Censored] but how come this is not installed already?

Please Log in or Create an account to join the conversation.

  • Posts: 152
  • Thank you received: 11
11 years 6 months ago #98512

I wish I would guess why it is not.
When you develop something new, there are many ideas and here they also like to release their shop.
Then there is a small thing that is not thought of the way, then when you ask for it, they find out that it might be an idea to make it. I think there's a long to-do list every day just gets longer and longer.

The priority is to create a shop that conquers the market and then refine it.

Now, were you helped, what these guys are hugely fast and skilled. It may be that in the next release is made ​​this mistake.


I'm using firebug, forumsearch, dokumentation and then I ask.. It's so easy ;)
The following user(s) said Thank You: Xavier

Please Log in or Create an account to join the conversation.

  • Posts: 78
  • Thank you received: 3
11 years 6 months ago #98557

My question was not meant as an insult. I was just wondering if there was a specific reason that this was omitted?

Please Log in or Create an account to join the conversation.

  • Posts: 78
  • Thank you received: 3
11 years 6 months ago #98728

Xavier wrote: Hi,

You can edit the view "product / quantity" and add an if condition around:
echo '<span class="hikashop_product_stock_count">'.JText::sprintf('X_ITEMS_IN_STOCK',$this->row->product_quantity).'</span><br/>';

Like:

if($this->row->product_quantity == 1)
    echo '<span class="hikashop_product_stock_count">'.JText::sprintf('X_ITEMS_IN_STOCK',$this->row->product_quantity).'</span><br/>';
else
    echo '<span class="hikashop_product_stock_count">'.JText::sprintf('X_ITEM_IN_STOCK',$this->row->product_quantity).'</span><br/>';

And add the translation "X_ITEM_IN_STOCK" in the language file with the desired translation.


Thanks. This worked with on variation I changed.

if($this->row->product_quantity == 1)
    echo '<span class="hikashop_product_stock_count">'.JText::sprintf('1_ITEMS_IN_STOCK',$this->row->product_quantity).'</span><br/>';
else
    echo '<span class="hikashop_product_stock_count">'.JText::sprintf('X_ITEM_IN_STOCK',$this->row->product_quantity).'</span><br/>';

I created a new variable called 1_ITEMS_IN_STOCK which had the change....

Please Log in or Create an account to join the conversation.

Time to create page: 0.050 seconds
Powered by Kunena Forum