I'm using prestashop 1.7 and I need to display a list of products of one given category in my custom module's front template.
Currently I get the
$products
like this in the display controller of my module:
public function initContent()
{
parent::initContent();
$products = Product::getProducts(Context::getContext()->language->id, 0, NULL, 'id_product', 'ASC', 3);
$products_all = Product::getProductsProperties($this->context->language->id, $products);
$this->context->smarty->assign(array(
'products' => $products_all
));
$this->context->smarty->assign('products', $products_all);
$this->setTemplate('module:goodies/views/templates/front/display.tpl');
}
In the view I copied the content of the product miniature tpl file.
But I get this exception:
I have correctly uploaded a cover for the product and got one product when displaying my products array with print_r.
As I said I never modified the tpl listing product part.
What am I missing here ?
Thanks for your time.