简体   繁体   中英

magento multiple store views

I'm working on an existing magento web site that is in french. The link structure is as follows:

domain-name.com/category/product.html

My task is to add a dutch version to the site. I added a store view and everything is working as expected. But now my link structure is as follows:

French version : http://www.domain-name.com/ fr /category/product.html

Dutch version : http://www.domain-name.com/ nl /category/product.html

The problem now is that my requirement is to leave the french link as it was previously (without the fr/ prefix) and to have to dutch version with the nl/ prefix (which is fine).

Could someone please explain how i could remove the fr prefix from the frech store view from the admin panel?

Thanks in advance,

Regards,

After creating your store view, follow these steps:-

  1. Create a folder in web root with the code name you specified in the magento admin panel for your store view
  2. copy index.php and .htaccess from your web root folder into this folder
  3. Open index.php and add the following lines:-

     $store_id = 'your_store_id_here'; // integer store identifier $mageRunCode = 'store view code'; // nl / fr etc $mageRunType = 'store'; Mage::app()->setCurrentStore($store_id); Mage::run($mageRunCode, $mageRunType); 

It took me many painstaking hours to figure this one out. Hope someone will find this information useful.

Check the Magento's admin:

System->COnfiguration->General->Web->Url options->Add Store Code to Urls

This is global setting, so you have to implement custom logic, if you don't accept option when both shops will have similar url. And language will be switched by language selector.

The other more complicated option - create another Website with an additional store view and set custom url for this store view.

Option that requires a small custom layer to the url handling:

  • disable ''add store code to urls''.
  • check incoming urls for a language code; if not present default to /fr/. Set store view based on information and remove information from url.
  • add store code to outgoing urls unless default (/fr/).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM