0

I have Magento store with two languages, English and Arabic. When we inserted the products in the English store view, then translate the product title to Arabic. The product meta title, description and keywords remains in English.

So When I open a product page in Arabic store view the page title tag, meta title, meta description and meta keyword are in English. Is there I way to override the layout or create a plugin to override those value to the current product name. So the title,meta title will be product name based on the current selected store view, meta description will product description and meta keywords will be product title + description separated by commas.

0

These are separate attributes that need to be translated in the backend. It is not enough to translate the product title. You also need to translate meta_title, meta_description and meta_keyword. They can be found in the "Search Engine Optimization" tab on the "Edit product" page in the backend.

| improve this answer | |
  • Yes What if I don't want to translate them and I want to change the layout or create a plugin to replace them with the translated name is it possible ? – Mohd Alomar Apr 9 at 11:33
  • Yes, it's possible, although I don't think this is a good approach. However, look into the class Magento\Framework\View\Page\Config. It has the methods like getMetaTitle() etc where you can add plugins. – simonthesorcerer Apr 9 at 11:36
  • Why do you think it is a bad idea ? – Mohd Alomar Apr 9 at 11:41
  • Because you're creating logic for a specific language / store view. IMHO it would be better to change the saved data, and have the frontend behave identically for every language. But that's just my opinion of course. – simonthesorcerer Apr 9 at 12:01
  • Do you have any idea how to replace meta title and meta description programmatically for product for specific store view ? – Mohd Alomar Apr 9 at 17:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.