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.

1 Answer 1

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.

6
  • 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 ? Apr 9, 2020 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. Apr 9, 2020 at 11:36
  • Why do you think it is a bad idea ? Apr 9, 2020 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. Apr 9, 2020 at 12:01
  • Do you have any idea how to replace meta title and meta description programmatically for product for specific store view ? Apr 9, 2020 at 17:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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