Set Allowed Countries in Store View

In Magento 1.4, I was able to install allowed countries

at a level Store View

, so I could have Website

with one Store

and more Store Views

for each of my countries: enter image description here

Now in Magento 2 I can install allowed countries

on Website

and not on Store View

, the setup Store View

looks like this: enter image description here

Why do I want to change this? I need to set a different one store contact address

for each of these Store View

s because I, for example. there is Argentinian and Bulgarian Store View

, so I want to set different addresses but use the same Website

/ Store

.

Unfortunately I also cannot change store contact address

per Store View

, this also only works at the level Website

.

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

?

+3


source to share


2 answers


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



+2


source


the correct answer, which is about Magento 2 standardization, is overloading system.xml magento / Backend / etc / adminhtml. You should try: Manufacturer / 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>

      

Don't forget to add an 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>

      

0


source







All Articles