Jump to content

Multilanguage fields product.tpl shows Array


Recommended Posts

Hello,

 

I installed Prestashop 1.4.7.0 and imported data into the eshop with czech translation. When I have a look at database there are all languages filled:

Product with name has 6 titles with translated texts etc. When I want to display product's information - product.tpl, than instead of values is displayed value 'Array'. I had a look into the product.tpl and there are lines like:

<h1>{$product->name|escape:'htmlall':'UTF-8'}</h1>

...

<div id="short_description_content" class="rte align_justify">{$product->description_short|strip_tags}</div>

...

<div id="idTab1" class="rte">{$product->description}</div>

 

But these values are arrays instead of string.

print_r($product->description) looks like this:

Array

(

[1] => EN description

[2] => FR description

[3] => ES description

[4] => DE description

[5] => IT description

[6] => CZ description

)

 

I tried to change these lines into this format, and it works fine, but I don't know where I have to change these lines and why it is not working correctly... Can anybody help me what I have to change to enable working presta correctly?

 

 

{assign var='id_lang' value=$cookie->id_lang}

{if is_array($product->description)}

<div id="idTab1" class="rte">{$product->description.$id_lang}</div>

{else}

<div id="idTab1" class="rte">{$product->description}</div>

{/if}

 

Thank you.

Myth

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...