麦进斗 Magento 设置多站点、多域名、多语言、多货币

麦进斗 Magento 设置多站点、多域名、多语言、多货币

1、登录后台system->manage stores
多站点
选择create website:

麦进斗 Magento 设置多站点、多域名、多语言、多货币

进入:

麦进斗 Magento 设置多站点、多域名、多语言、多货币

填写完整后,保存,再去该website下新建store和store view
store新建:

麦进斗 Magento 设置多站点、多域名、多语言、多货币

2、store下面可以新建多个store view(即多语言设置),Code的值是展示view的关键所在
每个view代表着一种语言,所以建立多个view时,需要去下载安装语言包,magento-community

麦进斗 Magento 设置多站点、多域名、多语言、多货币

3、多个网站,重复上面步骤即可。
4、多域名设置
system->confirguration

麦进斗 Magento 设置多站点、多域名、多语言、多货币

5、然后在选择,GENERAL标签下的Web:

麦进斗 Magento 设置多站点、多域名、多语言、多货币

6、取消use default(或者 use website)前面的勾, 在Unsecure和Secure的base url中输入你已经拥有的域名
点击保存。
7、多域名设置的最后一步,修改项目根木的 .htaccess文件:

麦进斗 Magento 设置多站点、多域名、多语言、多货币

打开文件在最后加入:

  1. SetEnvIf Host ^xncp.mez100.de.cn MAGE_RUN_CODE=de /* Store or website code 这里的code新建store view时的code输入框的值*/
  2. SetEnvIf Host ^xncp.mez100.de.cn MAGE_RUN_TYPE=website /* Run store or run website */

8、多货币的设置
view或website设置多货币
再选择下方的currency Setup:

麦进斗 Magento 设置多站点、多域名、多语言、多货币

依次设置基础货币、默认货币、所允许的货币
在Allowed Currencies选择多个值后,保存,实现多货币的设置
在去设置货币汇率。这个如果不设置的话,在前台不会出现货币转换的选项:

麦进斗 Magento 设置多站点、多域名、多语言、多货币

这里可以设置货币的汇率以及货币的符号
货币汇率:
麦进斗 Magento 设置多站点、多域名、多语言、多货币

货币符号:
麦进斗 Magento 设置多站点、多域名、多语言、多货币

设置好后,保存,在前台就可以看见货币转为的选项了。
下面还有一种多域名的做法(又称二级目录)
假设我们的网站现在有个vip的站点(只有允许vip用户访问)
1、登录后台system->configuration,选择对应的website或store view ,选择左侧的 web 标签:

麦进斗 Magento 设置多站点、多域名、多语言、多货币
注意:{{secure_base_url}}/de有个斜线,设置的时候不要漏掉。
按上图配置好后,点击保存。
2、回到项目的根目录中,新建一个de的文件夹(这里的de为你在后台配置web下Base Link URL后面追加的那个de),创建如下:

麦进斗 Magento 设置多站点、多域名、多语言、多货币
将更目录的index.php的内容copy到de文件下的inde.php,文件.htaccess也一样从根目录的.htaccess 拷贝到de文件夹下的.htaccess
3、修改de文件下的index.php;

  1. <?php
  2. /**
  3. * Magento
  4. *
  5. * NOTICE OF LICENSE
  6. *
  7. * This source file is subject to the Open Software License (OSL 3.0)
  8. * that is bundled with this package in the file LICENSE.txt.
  9. * It is also available through the world-wide-web at this URL:
  10. * http://opensource.org/licenses/osl-3.0.php
  11. * If you did not receive a copy of the license and are unable to
  12. * obtain it through the world-wide-web, please send an email
  13. * to license@magentocommerce.com so we can send you a copy immediately.
  14. *
  15. * DISCLAIMER
  16. *
  17. * Do not edit or add to this file if you wish to upgrade Magento to newer
  18. * versions in the future. If you wish to customize Magento for your
  19. * needs please refer to http://www.magentocommerce.com for more information.
  20. *
  21. * @category Mage
  22. * @package Mage
  23. * @copyright Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
  24. * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
  25. */
  26. if (version_compare(phpversion(), '5.2.0', '<')===true) {
  27. echo '<div style="font:12px/1.35em arial, helvetica, sans-serif;"><div style="margin:0 0 25px 0; border-bottom:1px solid #ccc;"><h3 style="margin:0; font-size:1.7em; font-weight:normal; text-transform:none; text-align:left; color:#2f2f2f;">Whoops, it looks like you have an invalid PHP version.</h3></div><p>Magento supports PHP 5.2.0 or newer. <a href="http://www.magentocommerce.com/install" target="">Find out</a> how to install</a> Magento using PHP-CGI as a work-around.</p></div>';
  28. exit;
  29. }
  30. /**
  31. * Error reporting
  32. */
  33. error_reporting(E_ALL | E_STRICT);
  34. /**
  35. * Compilation includes configuration file
  36. */
  37. $compilerConfig = '../includes/config.php';
  38. if (file_exists($compilerConfig)) {
  39. include $compilerConfig;
  40. }
  41. $mageFilename = '../app/Mage.php';
  42. $maintenanceFile = '../maintenance.flag';
  43. if (!file_exists($mageFilename)) {
  44. if (is_dir('downloader')) {
  45. header("Location: downloader");
  46. } else {
  47. echo $mageFilename." was not found";
  48. }
  49. exit;
  50. }
  51. if (file_exists($maintenanceFile)) {
  52. include_once dirname(__FILE__) . '/errors/503.php';
  53. exit;
  54. }
  55. require_once $mageFilename;
  56. #Varien_Profiler::enable();
  57. if (isset($_SERVER['MAGE_IS_DEVELOPER_MODE'])) {
  58. Mage::setIsDeveloperMode(true);
  59. }
  60. #ini_set('display_errors', 1);
  61. umask(0);
  62. /* Store or website code */
  63. $mageRunCode = isset($_SERVER['MAGE_RUN_CODE']) ? $_SERVER['MAGE_RUN_CODE'] : '';
  64. /* Run store or run website */
  65. $mageRunType = isset($_SERVER['MAGE_RUN_TYPE']) ? $_SERVER['MAGE_RUN_TYPE'] : 'store';
  66. /*de为 website or store view code*/
  67. /*如果该站点为website的话,将store改为wensite即可*/
  68. Mage::run('de', 'store');

4、然后在浏览器中输入www.xample.com/de就可以访问相应的store view或website了

声明:本站部分文章或资源,整理于网络或由网友提供,主要用于知识性分享与学习用途。若相关内容侵犯了原著者的合法权益,请联系处理。
技术

Themeforest购买主题模板的详细步骤

2021-6-9 17:20:07

技术资源

Magento模板安装详细过程

2021-6-9 17:22:56

0 条回复 A文章作者 M管理员
欢迎您,新朋友,感谢参与互动!
    暂无讨论,说说你的看法吧