2017-06-13 49 views
3

在Magento的1.4,我能夠設置allowed countriesStore View水平,所以我可以有一個Website一個Store UND多個Store Views我的每個國家: enter image description here上存儲視圖設置允許國家

現在Magento的2,我只能設置在Website,而不是Allowed CountriesStore View,在Store View設置如下所示: enter image description here

爲什麼我要改變這種狀況?我需要能夠爲這些Store View中的每一個設置不同的store contact address,因爲我例如有一個阿根廷人和一個保加利亞人Store View,所以我想設置不同的地址,但使用相同的Website/Store

不幸的是,我也無法更改Store Contact AddressStore View了,這也只適用於Website級別。

我錯過了什麼嗎?對於Store Views有沒有從1.X到2.X的邏輯變化?

回答

2

我不知道爲什麼允許的國家選項已從商店視圖中的設置中刪除。但是查看代碼表明,如果存在信息,則使用該信息。因此,您可以將數據輸入到core_config_data(作用域:stores,scope_id:your_store_id,值:AT,AB,AC ...

0

尊重Magento 2標準的正確答案是重載magento/。後端的/ etc/adminhtml 你應該嘗試: 供應商/模塊名在/ 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>