Skip to content

Instantly share code, notes, and snippets.

@redesigned
Created November 13, 2013 06:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save redesigned/7444487 to your computer and use it in GitHub Desktop.
Save redesigned/7444487 to your computer and use it in GitHub Desktop.
Magento Website and Theme Switching
#### Set the website based on the domain name ####
SetEvnIf Host ^www\.domain1\.com$ MAGE_RUN_CODE=website_one_code MAGE_RUN_TYPE=website
SetEvnIf Host ^www\.domain1\.com$ MAGE_RUN_CODE=website_two_code MAGE_RUN_TYPE=website
Admin>System>Configuration>Design>Themes>Default>
Add Exception for mobile theme:
iPhone|iPod|BlackBerry|Pre|Palm|Googlebot-Mobile|mobi|Safari Mobile|Windows Mobile|Android|Opera Mini|mobile
/* Fancy Store Switcher */
if (isset($_SERVER['SERVER_NAME']) && $_SERVER['SERVER_NAME'] == 'wholesale.tayloredexpressions.com') { $mageRunCode = 'wholesale'; } else { $mageRunCode = 'default'; };
/* Fancy Store Switcher */
if (isset($_COOKIE['magento_website']) && $_COOKIE['magento_website'] == 'usa') { $mageRunCode = 'defaultusa'; $_COOKIE['magento_website'] = 'usa'; } else { $mageRunCode = 'default'; $_COOKIE['magento_website'] = 'canada'; };
/* Fancy Store Switcher */
if (isset($_COOKIE['currency_code']) && $_COOKIE['currency_code'] == 'CAD') { $mageRunCode = 'ca'; } else { $mageRunCode = 'us'; };
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment