Jump to content

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


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

 

Share this post


Link to post
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.

Share this post


Link to post
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...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More