5

In Magento 1.4, I was able to set allowed countries on the Store View Level, therefore I could have a Website with one Store und multiple Store Views for each of my countries: enter image description here

Now in Magento 2, I can only set the Allowed Countries on the Website and not on the Store View, the Store View setting looks as follows: enter image description here

Why do I want to change that? I need to be able to set a different store contact address for each of these Store Views, because I e.g. have an Argentinien und a Bulgarian Store View, so I want to set the different addresses but use the same Website/Store.

Unfortunately, I'm also not able to change the Store Contact Address per Store View anymore, this also only works on Website Level.

Am I missing something? Was there a logical change from 1.X to 2.X about the Store Views?

Vickel
  • 7,879
  • 6
  • 35
  • 56
NthDegree
  • 1,301
  • 2
  • 15
  • 29

2 Answers2

3

I don't know why the allowed country option was removed from settings in store view. But looking in the code shows that the information is used if present. So you can just enter the data into core_config_data (scope: stores, scope_id: your_store_id, value: AT,AB,AC...

Jiri Tousek
  • 12,211
  • 5
  • 29
  • 43
skymeissner
  • 228
  • 1
  • 9
3

the correct answer that respects Magento 2 standardization is overloading the system.xml of the magento/Backend/etc/adminhtml. you should try: 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>

Remember to add overridden module - Magento_Backend

Vendor/ModuleName/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>