1

I have two stores (e.g.:store 1 and 2). Both have different shipping destinations.

Under the website scope, I had set for Store 1 Japan for the Allow Countries. And for Store 2 are non-eu countries (US, Canada etc).

However, the problem is when I go to checkout shipping page, it list out the country which has also in Default config, I mean it needs to show US,Canada but not Japan, but unfortunately Japan is also showing in the list.

As we can see in the image that in the admin panel setting Japan is not included in the allowed country list in first image. But in checkout shipping page Japan is now showing in the country option. Is this possible, only to show allowed country in the website scope for the country option?

enter image description here

enter image description here

3 Answers 3

1

You can change Customer Configuration

Stores > Settings > Configuration > Customers > Customer Configuration

Determines the scope of customer accounts in the store hierarchy. Options:

  • Global - Customer account information is shared with every website and store in the Magento installation.
  • Per Website - Customer account information is limited to the website where the account was created.

From Global to Per Website

6
  • Thanks for a reply. But I've already tried to set customer account information From Global to Per Website, unfortunately not working. Setting customer account information From Global to Per Website will certainly display allowed countries but it also includes the Default config country (I mean to say Japan-it is my default config country). I really don't know why it has been displayed. Dec 5, 2019 at 7:14
  • Then another way you can hide by jQuery as per store. Dec 5, 2019 at 7:17
  • 1
    I tried to edit the core file vendor/magento/module-checkout/Block/Checkout/DirectoryDataProcessor.php like this: foreach ($countryOptions as $countryOption) { if (empty($countryOption['value']) || in_array($countryOption['value'], $topCountryCodes)) { $headOptions[] = $countryOption; } /*else { $tailOptions[] = $countryOption; }*/ } this will solve the issue but I think editing core file is not a good option. Dec 5, 2019 at 7:19
  • Then you can override block from vendor to in your custom modue. Dec 5, 2019 at 7:22
  • 1
    This option worked for me on V2.3.5 Oct 13, 2021 at 13:28
0

/var/www/html/magento233/vendor/magento/module-ui/Component/Form/Element/AbstractOptionsField.php Line No. 73

$config['options'] = array_values(array_replace_recursive($config['options'], $options));

Replace With This :-

$config['options'] = array_values(array_replace_recursive($options,$config['options']));

And Check If Working Well Then Overwrite This File... :)

0

I know this is an old question, but maybe someone will need it.
I use M2.4.0. I have two websites with one store each.
The most important information: We made a migration from M1.9.3
We had defined countries for both stores, and it worked fine. Problem shown when client wanted to add another country to the list. When we added this country nothing changed on the checkout page. The reason for that was, because in core_config_data we had defined allowed countries per store: enter image description here and in M2.4 we can set allowed countries per website. Deleting those two records solved the problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.