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


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

| improve this answer | |
  • 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. – Suman Maharjan Dec 5 '19 at 7:14
  • Then another way you can hide by jQuery as per store. – Vrajesh Patel Dec 5 '19 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. – Suman Maharjan Dec 5 '19 at 7:19
  • Then you can override block from vendor to in your custom modue. – Vrajesh Patel Dec 5 '19 at 7:22
  • Thanks pal, I'm thinking same about that, hope this will works. Thanks, anyway. – Suman Maharjan Dec 5 '19 at 7:24

/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... :)

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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