ending of the word

  • Posts: 172
  • Thank you received: 2
11 years 8 months ago #125921

how to make a mini basket, changed ending of the word ?
1 item

2 items

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

  • Posts: 12953
  • Thank you received: 1778
11 years 8 months ago #125993

Hi,

The first can be to edit your translation file through "Hikashop->System->Configuration->Language" and change this line :

X_ITEMS_FOR_X="%s items for %s"
By :
X_ITEMS_FOR_X="%s item(s) for %s"
Else, you can :
- directly edit the "cart" file of the "product" view of your front-end template through "Hikashop->Display->Views" and change this line :
$text = JText::sprintf('X_ITEMS_FOR_X',$qty,$this->loadTemplate());
By :
if($qty > 1)
      $text = JText::sprintf('X_ITEMS_FOR_X',$qty,$this->loadTemplate());
  else if($qty == 1)
      $text = JText::sprintf('X_ITEM_FOR_X',$qty,$this->loadTemplate());
- add this line through your language file :
X_ITEM_FOR_X="%s item for %s"

Last edit: 11 years 8 months ago by Mohamed Thelji.
The following user(s) said Thank You: rockettboost

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

  • Posts: 172
  • Thank you received: 2
11 years 8 months ago #125996

i use russian language
X_ITEMS_FOR_X=" +%s товар"

товар - it's item

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

  • Posts: 172
  • Thank you received: 2
11 years 8 months ago #125998

thx - second variant is work

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

  • Posts: 172
  • Thank you received: 2
11 years 8 months ago #126171

Mohamed , I need to add one more word completion, when more than 5 items .
please ^ help

1. 1 товар
2. 2-4 товара
3. 5-and more товаров

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

  • Posts: 12953
  • Thank you received: 1778
11 years 8 months ago #126176

Ok so you'll just have to use some code like :

if($qty >= 5)     
    $text = JText::sprintf('X_ITEMS_FOR_X',$qty,$this->loadTemplate());
if($qty > 1 && $qty < 5)
    $text = JText::sprintf('Y_ITEMS_FOR_Y',$qty,$this->loadTemplate());
else if($qty == 1)
      $text = JText::sprintf('X_ITEM_FOR_X',$qty,$this->loadTemplate());

Don't forget to add another traduction for the word : Y_ITEMS_FOR_Y

The following user(s) said Thank You: rockettboost

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

  • Posts: 172
  • Thank you received: 2
11 years 8 months ago #126177

thx work

I reordered
X_ITEMS_FOR_X
and
Y_ITEMS_FOR_Y

well done

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

Time to create page: 0.064 seconds
Powered by Kunena Forum