1

First off, Lets clarify :
-Using Magento ver. 2.1.1
-Got a Porto theme
-Only one extension other then the one for the theme: M2E
-Installation on Google cloud

We just got into magento, fidle with it a while and now we have something presentable. Except for one thing that really bug us.
See, I used the store view for the translation, didn't want and find the CMS file. Everything is good form static page to categories, but when we go to a subcategory and change 'store', the link add-up.

Let's say I got
www.domain.com/fr/category-fr/sub-fr
And switch "store", it will give me the following:
www.domain.com/en/category-fr/category-en/sub-en
Which leave me with a 404 error of course.

*I'll add that the categories and subcategories have different url-key from one store to a other so that the URL is in french in French store and in English in English store. This seem to be the problem but the client want that...

Anyone got a clue? Don't really know what could I say about which setting I got. got 'yes' for putting store code and thing. Their's surely something I'm missing right?

  • Did you solve the problem? – Mehdi May 9 '17 at 15:38
0

I have a solution for this issue if you are using porto theme for magento 2.X:

you need to go following path and open "languages.phtml"

app/design/frontend/Smartwave/porto/Magento_Store/templates/switch

Find code of line

<a href="<?php echo $_lang->getCurrentUrl(); ?>">

Replace with this

<a href="#" data-post='<?php /* @escapeNotVerified */ echo $block->getTargetStorePostData($_lang); ?>'>

Clear magento cache and check. I hope it will work.

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.