Jump to content

"Shop context types other than "single shop" are not supported"


kierweb

Recommended Posts

I built a payment module for Prestashop, and it was working fine in v1.7.6.x   ...  but since trying it in v1.7.7.7 I keep getting the following error when trying to Validate the order.  Any ideas?

PHP Fatal error:  Uncaught PrestaShopBundle\Exception\NotImplementedException: Shop context types other than "single shop" are not supported

 

Link to comment
Share on other sites

  • 1 month later...
        $shop = Context::getContext()->shop;
        if (!Validate::isLoadedObject($shop)) {
            $shop = new Shop((int) Configuration::get('PS_SHOP_DEFAULT'));
        }
        //Important to setContext
        Shop::setContext($shop::CONTEXT_SHOP, $shop->id);
        $this->context->shop = $shop;
        $this->context->cookie->id_shop = $shop->id;

Just before calling $module->validateOrder() method, place the code above.

  • Thanks 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...