Hi,
I am developping a recommender system module and would like to use prestashop related products module for recommended products display. However, I am struggling with the documentation for data structure to pass this template.
Actually, I am loading my products like that:
$products = array();
foreach($recommendations as $recommendation) {
array_push($products, (array) new Product($recommendation['id_product'], false, '1'));
}
And pass that $products variable to the template: "module:ptsrelatedproducts/views/templates/hook/ptsrelatedproducts.tpl".
It displays some products but with a lot of missing information like images, links, js events, etc.
Does anyone know how to reuse that template ? Which datatype should I send in the $products array ? Is there any reusable function to format that data ?
I am working on prestashop 1.7.1
Thanks in advance
Simon