【问题标题】:Set Allowed Countries on Store View在商店视图中设置允许的国家
【发布时间】:2017-06-13 08:45:35
【问题描述】:

在 Magento 1.4 中,我可以在 Store View 级别上设置 allowed countries,因此我可以为我的每个国家/地区设置一个 Website 和一个 Store 和多个 Store Views

现在在 Magento 2 中,我只能在 Website 上设置 Allowed Countries 而不能在 Store View 上设置 Store View 设置如下所示:

我为什么要改变它?我需要能够为这些Store Views 中的每一个设置不同的store contact address,因为我例如有一个阿根廷人和一个保加利亚人Store View,所以我想设置不同的地址但使用相同的Website/Store

不幸的是,我也无法再更改每个Store ViewStore Contact Address,这也仅适用于Website 级别。

我错过了什么吗?关于Store Views,从 1.X 到 2.X 是否有逻辑上的变化?

【问题讨论】:

    标签: magento2 online-store


    【解决方案1】:

    我不知道为什么允许的国家/地区选项已从商店视图的设置中删除。但是查看代码表明该信息如果存在则被使用。所以你只需将数据输入core_config_data(范围:stores,scope_id:your_store_id,value:AT,AB,AC ...

    【讨论】:

      【解决方案2】:

      尊重 Magento 2 标准化的正确答案是重载 magento/Backend/etc/adminhtml 的 system.xml。 你应该试试: 供应商/模块名称/etc/adminhtml/system.xml

      <?xml version="1.0"?>
      <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
          <system>
              <section id="general">
                  <group id="country" translate="label" type="text" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="1">
                      <label>Country Options</label>
                      <field id="allow" translate="label" type="multiselect" sortOrder="2" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
                          <label>Allow Countries</label>
                          <source_model>Magento\Directory\Model\Config\Source\Country</source_model>
                          <can_be_empty>1</can_be_empty>
                      </field>
                  </group>
              </section>
          </system>
      </config>
      

      记得添加被覆盖的模块 - Magento_Backend

      供应商/模块名称/etc/module.xml

      <?xml version="1.0"?>
      <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
          <module name="Vendor_YourModule" setup_version="1.0.0">
              <sequence>
                  <module name="Magento_Backend"/>
              </sequence>
          </module>
      </config>
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2012-07-25
        • 1970-01-01
        • 2014-09-22
        • 1970-01-01
        • 1970-01-01
        • 2012-07-15
        • 1970-01-01
        相关资源
        最近更新 更多