Prestashop 1.7 Context::getContext() not working in AdminController

118 Views Asked by At

I have created custom admin controller in my custom module but i am not able to use Context::getContext() in my admin controller.

When i try to use that i am getting below error.

Attempted to call an undefined method named "getContext" of class "PrestaShop\PrestaShop\Adapter\Shop\Context". Did you mean to call e.g. "getContextListShopID", "getContextListShopIDUsingCustomerSharingSettings", "getContextShopGroup" or "getContextShopID"?

I have already added this line at the top of my file use PrestaShop\PrestaShop\Adapter\Shop\Context; but still facing same issue.

If anyone have any idea why Context::getContext() doesn't work I would like to hear it.

Thanks

1

There are 1 best solutions below

0
Razes501 On

Just put a \ in front:

\Context::getContext()