Magento language button store view - magento

I've an website in dutch. http://www.domain.com and an german flag button to http://www.domain.com/german.
i have made an store view called german with a local language german.
How do i get to view this store view on the link www.domain.com/german

There are few ways for doing this.
1) Enable store code in the URL.
Magento allows you to add a store code of your store view to the URL. For instance, if your Dutch store view has a code dutch and your German store view has a code german, then Magento will automatically load a correct store. domain.com/dutch will load a Dutch version and domain.com/german will load the German version of your website. The drawback of this solution is a store code added even for the main domain.
The config setting can be found in Admin Panel (aka Back Office, BO) > System > Configuration > Web > Url Options. There you will find "Add Store Code to URLs" option.
2) Edit .htaccess file.
If you want to avoid the drawback of solution 1) you can modify your main .htaccess file. Add an entry that will search for /german suffix and will load the German store code. Here's a small example (I'm not an expert in this matter, but it should be something like this):
SetEnvIf Host .*domain.com/german.* MAGE_RUN_CODE="german"
You can play around with .htaccess more. Search the web if you want to learn more about .htaccess stuff.
3) Modify index.php of the application
This is very similar to the solution 2), but you do this directly in PHP. Find
$mageRunCode = isset($_SERVER['MAGE_RUN_CODE']) ? $_SERVER['MAGE_RUN_CODE'] : '';
line in index.php and replace it with something like this:
if (!$_SERVER['MAGE_RUN_CODE'] && strpos($_SERVER['HTTP_HOST'], '/german') !== false) {
$mageRunCode = 'german';
} else {
$mageRunCode = isset($_SERVER['MAGE_RUN_CODE']) ? $_SERVER['MAGE_RUN_CODE'] : '';
}
4) Add a new entry to the Apache vhost.
Create a new virtual host (vhost) for domain domain.com/german and put there SetEnv MAGE_RUN_CODE "german".
In my opinion the best option is the 2). It is the most flexible and you don't have to change any code. For development workstation 4) would be also sufficient.
Please note that these are only examples and they may not work on the first shot. I'm writing this from my memory and I cannot really check them now. Hope this gives you a brief idea how to handle your situation.

Related

Url Rewrite of a CMS page in Magento

As a new magento developer I'm using a theme to develop my store. I want to change the URL key of CMS page about. I followed the steps written here but I can't find my layout file for about page on the theme directory or base directory for change XML URL tag.
How can I edit the layout file? Can anyone help me?
Actually that tutorial is a little confusing because there, they are showing an example of changing a URL for two different type of pages (CMS and system).
For changing the URL of a CMS page, like about in your case, it's enough that you proceed until point 12. In short:
First. you change the URL from: (main menu) CMS/Pages/Your_Page -> Url Key: newURL
Then, find the blocks that it is used (e.g footer) and change the URL accordingly.
Plus, in general working in Magento after changing things like page URLs you need to do a reindex and in case of using cache you have to refresh/remove your cached data. Both could be found under System tab (Cache Management & Index Management).

Managing contents in multilingual stores in Magento

This might be a basic question, I'm still relatively new to Magento. I have 2 store views in a magento project. 1 for English (default) and 1 for Japanese. While working with both store views, I noticed how if for example I switch to the Japanese store view, if I redirected to a different page or content on the store, the language goes back to English. How do I prevent the website from going back to the default language every time I change categories/catalogs?
That is all about Magento Admin setting. While creating Content Pages/Categories/products, there is a option that ask to choose Store View.
You can add content for Cateogries/Product/CMS Pages for each locale. If it is done then you'll be able to see your site content on the basis of current locale. Hence you need to go through Magento Admin first.
Hope it will work for you. Please let me know if any issue.
Managing contents in multilingual stores in Magento is easy.
Edit/Create Product/Category/Page/Static blocks according to need storeview and put content according to languages in that.
Now access pages by store code, if we are using that.
In some case we don't find the heading names according to languages so just enable inline translater from admin and do translation specific to store/website.
To run Magento store using urls we have both options index.php modifiction and using .htaccess using website and store codes.
On running Magento multisite , multistore. We generally face the common urls for media, js and other resources we should use symlink to increase SEO ranking and score.
Please feel free to contact.
Install your language package.
Create products, categories, pages, and static blocks on the basis of your selected language.
Sometimes translation does not work for few words. In those cases, Inline translation from admin will help you.
Managing content according to store view is very easy.
follow up below steps for managing content according to Store view.
Edit your product or category or your page and static block etc.
after that you can see store select left side in product and category and on page you can see feild below url in static block also. select your store view.
whater ever you want to change or edit please do according to you.
After that save it will apear only on your selected store.
Note: if you not edit any fild by store then it will show default store contents.

Magento Multiple store views - Language switch issue

I have setup a multi lingual site using magento version 1.3.2.4 and have come accross some weird problems. Hoping that I could get some assistance.
The requirement was to add the new store view (dutch) and also maintain the current stores url structure, so I couldnt use 'Add store codes to urls' in the admin configuration as it would append the current urls with the default store code (fr). So, ultimately I needed the following url structures:
Default language (fr) url style : http://www.domainname.com
Dutch version url style : http://www.domainname.com/nl
For this I performed the the following steps:
I created a store view (code nl)
I created a folder by the name of nl
I copied the .htaccess and index.php from the main web root and pasted it in this folder
I modified the code as follows in index.php :
Mage::app()->getLocale()->setLocale('nl_NL');
$mageRunCode = 'Netherlands';
$mageRunType = 'store';
Mage::app()->setCurrentStore(1); // 1 being the nl store id
Mage::run($mageRunCode, $mageRunType);
When I launch the site, and goto http://www.domainname.com/nl the interface is in dutch as expected, but when I perform the following tasks I get redirected
back to the default language:
Login
Goto checkout/cart
Goto new user signup
Upon checking the view-source of the DOM I notice that some urls are pointing to the default language and not the nl language. For example the login form's action attribute is http://www.domain.com/customer/account/loginPost/ and not http://www.domain.com/nl/customer/account/loginPost/
Warm regards,
Hi instead of creating such a stuff .You can use this extension . Hope this help you and you can easily switch your language without creating a store view.
I got the same problem, cant have the same store code twice and when i try a new code it want link to the translation pack!

Do I need two separate installations of Magento for multi site?

I have been trying to setup multi site multi domain setup in Magento for more than a week now. And no success! I first tried to do it on localhost then I tried to do it on live server (shared hosting).
I followed this tutorial http://www.magentocommerce.com/knowledge-base/entry/tutorial-multi-site-multi-domain-setup but nothing happens.
Can someone answer to my basic question? Do I need two separate Magento installations to perform multi site multi domain setup or only one installation with two domains? I am confused. Please, help!
Regards!
You can run more than one Magento store on a single installation. The clue is in the index.php, specifically:
/* Store or website code */
$mageRunCode = isset($_SERVER['MAGE_RUN_CODE']) ? $_SERVER['MAGE_RUN_CODE'] : 'default';
/* Run store or run website */
$mageRunType = isset($_SERVER['MAGE_RUN_TYPE']) ? $_SERVER['MAGE_RUN_TYPE'] : 'store';
Mage::run($mageRunCode, $mageRunType);
The $mageRunCode defines the code of the store, or website, (as defined in the Manage Store section of the Administration area) that we're initialising. The $mageRunType defines whether we're going to be initialising a store, or a website.
As you can see, Magento first checks for appropriate values as environment variables. Using apache as an example, values for these variables will need to be set in the VirtualHost section of your httpd.conf, or similar. We set the environment variables using the SetEnv directive:
SetEnv MAGE_RUN_TYPE website
SetEnv MAGE_RUN_CODE website_code_001
We can use the same DocumentRoot for all of our domains as we're allowing the VirtualHost to switch the values of $_SERVER['MAGE_RUN_{CODE,TYPE}'] depending on the requested hostname.

Changing joomla site address

I've copied an existing joomla site from one domain to another, but when I hit the menu items it redirects to the old domain articles. Where is the setting to change this?
Thanks
Narkoz's answer isn't correct, there isn't an option to set your site domain in the joomla backend.
The problem isn't that joomla doesn't know your site URL, it gets that from you server, but rather the menu links are probably hard coded. Check your menu links in the backend and make sure the point to an "internal" link of some kind.
Set $live_site variable in your configuration.php file by adding this line:
$live_site = "http://www.example.com";
Export the database to SQL file then open it with a text editor and do a search/replace
Search : old-site-url.com
and replace it by : new-site-url.com
Save your file and import it to the database.

Resources