Hello,
I am on prestashop 1.7.6.2 and using custom theme which I want to translate but I am getting the error and blank translation screen.
Except that I have found that when I swich front end of my store to different language it's not working and throwing this error.
I am not sure if it's related to translations of not, but this code is causing it:
# The function itself protected function buildTemplateProduct($products) { $template_products = []; foreach ($products as $product) { $product = (new ProductAssembler($this->context)) ->assembleProduct($product); $presenterFactory = new ProductPresenterFactory($this->context); $presentationSettings = $presenterFactory->getPresentationSettings(); $presenter = new ProductListingPresenter( new ImageRetriever( $this->context->link ), $this->context->link, new PriceFormatter(), new ProductColorsRetriever(), $this->context->getTranslator() ); $template_products[] = $presenter->present( $presentationSettings, $product, $this->context->language ); } return $template_products; } # The products array is deffined at different place but this is the content $products = $category->getProducts( (int)$this->context->language->id, 1, (int)$block['num'], 'date_add', 'ASC' );
I found the for each error resolved here but I didn't find right code to modify.
https://github.com/PrestaShop/PrestaShop/issues/12295
Thanks for any help