Jump to content

[solved] Product page ( In stock ) is not translated


Recommended Posts

Dear sir madam

 

I got a default theme v1.5.4.1.

 

With 3 language installed

 

- german

- spain

- english

 

If you look at the Product page.

 

The Stock text is not translate. for example if i choose the Language german, spain,

 

1. Where can i change the text In stock

 

Screenshot:

 

1bpe.jpg

 

 

 

 

 

issue is s

Link to comment
Share on other sites

you're using default translation tool to translate this field?

(localization > translations - then select "front office translatinons" search for product.tpl and translate it)

 

in some cases it's also necessary to clear prestashop cache (or recompile tempalte)

Link to comment
Share on other sites

  • 2 weeks later...

1. no, I download the dutch v1.5.4.1 language pack http://www.prestasho...en/translations

The in Stock was not translated.

 

2. I folllow your instructions

"localization > translations - then select "front office translatinons" search for product.tpl and translate it)

 

After i select the FRONT office Translations. There is on the left a dropdown menu i can only choose DEFAULT.

 

 

3. Where exactly can i clear the Presta Cache or recompile the template

Edited by rayg (see edit history)
Link to comment
Share on other sites

Hi rayg,

 

you won't find in in the translations, because this to be modified for each produkt. Go in BO to Catalog, then choose

 

Product -->open any <anyproduct>-->Quantities

 

Then scroll down to section Availabilty options, where you find the standard 'in stock'. Change it to whatever you like. :)

  • Like 1
Link to comment
Share on other sites

Hi rayg,

 

you won't find in in the translations, because this to be modified for each produkt. Go in BO to Catalog, then choose

 

Product -->open any <anyproduct>-->Quantities

 

Then scroll down to section Availabilty options, where you find the standard 'in stock'. Change it to whatever you like. :)

 

Thank you it worked :-) .

Edited by rayg (see edit history)
Link to comment
Share on other sites

if you want to use the same information for each product in your store, just go to the theme directory and open the product.tpl file

you've got there:

 

<span id="availability_value"{if $product->quantity <= 0} class="warning_inline"{/if}>{if $product->quantity <= 0}{if $allow_oosp}{$product->available_later}{else}{l s='This product is no longer in stock'}{/if}{else}{$product->available_now}{/if}</span>

 

change the:

{$product->available_now} to {l s='available now'}

{$product->available_later} to {l s='available later'}

 

or use any other text you want

(then you will be able to translate it under the localization > translation tab)

  • Like 2
Link to comment
Share on other sites

  • 8 months later...

Thank you Vekia for your solution!!

 

I tried it and it's working great in English, but as 2nd language has no translated text by default in the 2 product availability fields, the text doesn't show up. Would there be a way to make it appear when needed without the need to go put text in those two fields for every item?

 

Thanks! :)

Link to comment
Share on other sites

Hi, thanks for your fast answer!

 

My code so far is:

<p id="availability_statut"{if ($product->quantity <= 0 && !$product->available_later && $allow_oosp) OR ($product->quantity > 0 && !$product->available_now) OR !$product->available_for_order OR $PS_CATALOG_MODE} style="display: none;"{/if}>
    <span id="availability_label">{l s='Availability:'}</span>
    {* ORIGINAL *}
    <span id="availability_value"{if $product->quantity <= 0} class="warning_inline"{/if}>{if $product->quantity <= 0}{if $allow_oosp}{$product->available_later}{else}{l s='This product is no longer in stock'}{/if}{else}{$product->available_now}{/if}</span>                
    {* LILIDOO MODIF *}
    <span id="availability_value"{if $product->quantity <= 0} class="warning_inline"{/if}>{if $product->quantity <= 0}{if $allow_oosp}{l s='Pre-order one!'}{else}{l s='This product is no longer in stock'}{/if}{else}{l s='Available now'}{/if}</span>                
</p>

I think the if in the <p> is the problem as the code shows "style="display: none;" when the page is in french

 

It shows "in stock in stock" in english, but nothing in french!

 

Thanks!
 

Edited by MissLili (see edit history)
Link to comment
Share on other sites

  • 9 months later...

if you want to use the same information for each product in your store, just go to the theme directory and open the product.tpl file

you've got there:

 

<span id="availability_value"{if $product->quantity <= 0} class="warning_inline"{/if}>{if $product->quantity <= 0}{if $allow_oosp}{$product->available_later}{else}{l s='This product is no longer in stock'}{/if}{else}{$product->available_now}{/if}</span>
change the:

{$product->available_now} to {l s='available now'}

{$product->available_later} to {l s='available later'}

 

or use any other text you want

(then you will be able to translate it under the localization > translation tab)

 

 

Hello vekia, i try this solution on prestashop 1.6.0.9 and its not working, I still shows translation from product card (in stock) or nothing - can you help me with this?

 

my code in product.tpl

<p id="availability_statut"{if ($product->quantity <= 0 && !$product->available_later && $allow_oosp) || ($product->quantity > 0 && !$product->available_now) || !$product->available_for_order || $PS_CATALOG_MODE} style="display: none;"{/if}>
					{*<span id="availability_label">{l s='Availability:'}</span>*}
					<span id="availability_value"{if $product->quantity <= 0 && !$allow_oosp} class="warning_inline"{/if}>{if $product->quantity <= 0}{if $allow_oosp}{l s='available later'}{else}{l s='This product is no longer in stock'}{/if}{else}{l s='available now'}{/if}</span>
				</p>
Link to comment
Share on other sites

{PL}Po polsku było by mi łatwiej ale że to angielski wątek to postaram się to opisać{/PL}

 

I think so :)

 

On "Advenced"->"Performance" i have select such options:

 

Compilation template:Force compilation.

Cache: NO

 

I click "Save" and "Clear Cache" on the top.

 

On the bottom i have option: Use Cache: No

Edited by mastek (see edit history)
Link to comment
Share on other sites

  • 1 year later...

Hi I tried change products.tpl file, later translated on back-end. Then when I refreshed my page there was a good translation, but after few miliseconds it refresh in "In stock", this caused Js script which I can't find. Any ideas how to fix.

P.S. my prestashop is 1.6.1.7

Link to comment
Share on other sites

×
×
  • Create New...