Jump to content

Cannot access product page in font office - Prestashop 1.7


Recommended Posts

Hi all, 

Not sure what happened, but out of a sudden I am not able access the product page when I click on a product in my FO.

This is the error I'm getting 

Fatal error: Uncaught Exception: CartPresenter can only present instance of Cart in C:\xampp\htdocs\prestashop\src\Adapter\Presenter\Cart\CartPresenter.php:315 Stack trace: #0
C:\xampp\htdocs\prestashop\classes\controller\FrontController.php(501):PrestaShop\PrestaShop\Adapter\Presenter\Cart\CartPresenter->present(NULL) #1
C:\xampp\htdocs\prestashop\classes\controller\FrontController.php(567):FrontControllerCore->assignGeneralPurposeVariables() #2 C:\xampp\htdocs\prestashop\classes\controller\Controller.php(306):FontControllerCore->initContent() #3
C:\xampp\htdocs\prestashop\classes\Dispatcher.php(518): ControllerCore->run() #4
C:\xampp\htdocs\prestashop\index.php(28): DispatcherCore->dispatch() #5
{main} thrown in C:\xampp\htdocs\prestashop\src\Adapter\Presenter\Cart\CartPresenter.php on line 315

I've tried uninstalling and reinstalling the shopping cart module, but nothing changes. I couldn't find any other solutions anywhere for this.

Can anyone help me out please? Its pretty urgent.

Edited by bkprestashop (see edit history)
Link to comment
Share on other sites

From what I see, this seems to be the problem:

PrestaShop\PrestaShop\Adapter\Presenter\Cart\CartPresenter->present(NULL)

 

In assignGeneralPurposeVariables() method, the method that causes you the error is called

'cart' => $this->cart_presenter->present($this->context->cart)

and $this->context->cart is null

 

The assignGeneralPurposeVariables() method is called in init_content(), but in init(), this->context->cart is initialized.

Between init() and initContent() the actionFrontControllerAfterInit hook is executed, I think of a module that acts on that hook, overwrites $this-context->cart, and makes it null.

 

Edited by Ress (see edit history)
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...