4

在 Magento 1.4 中,我可以allowed countriesStore View关卡上设置,因此我可以为我的每个国家/地区 Website设置一个Store和多个:Store Views在此处输入图像描述

现在在 Magento 2 中,我只能设置Allowed CountriesonWebsite而不能设置Store ViewStore View设置如下: 在此处输入图像描述

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

不幸的是,我也无法再更改Store Contact Addressper Store View,这也仅适用于WebsiteLevel。

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

4

2 回答 2

2

我不知道为什么从商店视图的设置中删除了允许的国家选项。但是查看代码表明该信息如果存在则被使用。因此,您只需将数据输入 core_config_data (范围:商店,范围ID:your_store_id,值:AT,AB,AC ...

于 2017-09-20T08:26:19.413 回答
1

尊重 Magento 2 标准化的正确答案是重载 magento/Backend/etc/adminhtml 的 system.xml。你应该试试:Vendor/ModuleName/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>
于 2017-11-29T11:53:58.223 回答