0

I created two sites , website 1 and Website 2. Each website has its own store and store view.

For bank transfer, it is only available on Website A and not website B. So I clicked STORES >> Configuration >> Payment Method to do the following setting:

  1. Default Config:

    • Bank Transfer : Enabled
  2. Website 1

    • Bank Transfer : Enabled
  3. Website 2

    • Bank Transfer : Disabled

When I checkout using website 2 , I still see the bank transfer option, despite it being disabled. I even cleared the cache and why such behavior is happening and can someone please advice me? Is this a bug in Magento 2.1.3?

1

For example, Websites Config looks like:

enter image description here

The Payment should be hidden on Website 2. We should check:

  • Clear Magento Cache.
  • Clear Browser Cache(can disable it for testing purpose) or try to use Incognito Browser.
  • Clear Browser Local Storage.
  • Check the third party extensions which relate to payment.
  • I tried a s per what you have suggested but it does not seem to work. I think magneto only show payment on default level for bank transfer. Even when I use the api {storecode}/bhr/rest/V1/carts/mine/payment-methods. It still shows what that is enabled in default site and not in website level. – madi Feb 3 '17 at 4:01
  • @madi See my updated answer. Your Website config should look like that. – Khoa TruongDinh Feb 3 '17 at 5:55
  • Mine is exactly the same setup and I disabled the payment on website level. Even after disabling , I use the web interface and the api, both do not give the right list of enabled payment items. That is why I went super confused. – madi Feb 3 '17 at 7:38
1

Currently parameters from website configuration isn't applied to the corresponding store view due to bug. See #7943 for more details

0

Magento 2 on multi store has bug and it is surprising to see that the bug was not solved by Magento 2 team. Like a version 2.1.3.1 could have been released. Nevertheless, Magento 2 team has been doing a reasonably good job but there are more rooms for improvement.

The fix to the bug is reflected here: https://github.com/magento/magento2/issues/7943

The fix is: Go to : /app/code/Magento/Store/Model/Config/Processor/Fallback.php and change the following code in getWebsiteConfig() method. Here is the fix:

private function getWebsiteConfig(array $websites, $id)
    {
        foreach ($this->scopes->get('websites') as $websiteData) {
            if ($websiteData['website_id'] == $id) {
                $code = $websiteData['code'];
                return isset($websites[$code]) ? $websites[$code] : [];
            }
        }
        return [];
    }

The fix is changing

$code = $websiteData['website'] to $code = $websiteData['code']

An the multi-store setup should work. Cheers!

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.