cancel
Showing results for 
Search instead for 
Did you mean: 

how to display two language for one product on one page

how to display two language for one product on one page

so basically in admin I want to allow user able to input two or more languages in one product(e.g. need both english and french for product name, description etc.), and on front end, user will able to see different language dscription for same product on one page or just flip through tabs, but without changing store view, how do I do that? does Magento support that by default, or I need to make code change?

3 REPLIES 3

Re: how to display two language for one product on one page

Hi @eversun

 

No you can't do this without changing store by default. However you could create multiple instances of each attribute you want to show, and have the product manager(s) enter one in each field.

 

I hope this helps.

Re: how to display two language for one product on one page

Thanks 

Re: how to display two language for one product on one page

HI @eversun

 

Sure, as mentioned you would need to create dublicate attributes for each attribute you want to use. You can create these from:

 

Catalog > Attributes > Manage Attributes.

 

Depending on how to you want these to be displayed / your PHP skill level, you can set the option: Visible on product view page on Front-end, to yes, most standard templates will display all attributes selected here in a grid, if you want it a bit more custome you can look further down.

 

When you are done assign them to your products attribtues sets form 

 

Catalog > Attributes > Manage Attribute Sets

 

When you have added the attributes to attributes sets and assigned them to the products you can fetch them on the product page. This can be done in many ways (one described above), but the simplest way other them from the admin is by using the getData or Magic __call function on the $_product object.

 

As an example you can edit the catalog/product/view.phtml file in your template (or copy it out from the default template to yours). 

 

You can use the following code:

 

<?php

// Fetching the my_attribute_code value using the getData method
echo $_product->getData('my_attribute_code');

// Fetching the my_attribute_code using the magic method __call
echo $_product->getMyAttributeCode();

// If you are using a select / multiselect attribute use
echo $_product->getAttributeText('my_attribute_code');

I hope this helps :-)