Describe the bug
As you can see, parent is called on the end.
```
//CartController.php
/**
* @see FrontController::initContent()
*/
public function initContent()
{
//..
$presenter = new CartPresenter();
$presented_cart = $presenter->present($this->context->cart, $shouldSeparateGifts = true);
$this->context->smarty->assign([
'cart' => $presented_cart,
'static_token' => Tools::getToken(false),
]);
//..
parent::initContent();
}
On the end FrontendController::initContent is called, and it call
assignGeneralPurposeVariables, overriding 'cart'.
```
// FrontController.php
protected function assignGeneralPurposeVariables()
{
$templateVars = array(
'cart' => $this->cart_presenter->present($this->context->cart),
'currency' => $this->getTemplateVarCurrency(),
'customer' => $this->getTemplateVarCustomer(),
'language' => $this->objectPresenter->present($this->context->language),
'page' => $this->getTemplateVarPage(),
'shop' => $this->getTemplateVarShop(),
'urls' => $this->getTemplateVarUrls(),
'configuration' => $this->getTemplateVarConfiguration(),
'field_required' => $this->context->customer->validateFieldsRequiredDatabase(),
'breadcrumb' => $this->getBreadcrumb(),
'link' => $this->context->link,
'time' => time(),
'static_token' => Tools::getToken(false),
'token' => Tools::getToken(),
);
//..
$this->context->smarty->assign($templateVars);
//..
}
that mean that this smarty->assign from CartController do nothing.
Possible chained bug?
none known
How to fix?
just move that parent::initContent() on the top o the CartControllerCore::initContent() function
Hi @Bonobomagno,
Thanks for your report.
Ping @PrestaShop/prestashop-core-developers what do you think?
Thanks!
Up :)
Feel free to create a pull request, we will be happy to review and merge it :)
Hello @Bonobomagno ,
Since we had no news from you for more than 30 days, I'll close this ticket to avoid cluttering up the backlog. Please note that you can always create a new one if further information pops up.
Thanks!
Most helpful comment
Up :)