I've build a module to make a custom page with some products. I've tried to
//get all products
$products_partial = Product::getProducts($this->context->language->id, 0, 1000, 'name', 'asc');
$products = Product::getProductsProperties($this->context->language->id, $products_partial);
foreach ($products as $product)
{
//here comes some logic to select some products (not relevant for this question)
//echo the image ID
$results[] = $product;
}
$this->context->smarty->assign(array(
'products' => $results
));
//this is a copy of themes/default/product-list.tpl
$this->setTemplate("product-list.tpl");
Now all products are shown, but without the right image. It turns out that $product['id_image'] is set to 'en_default', but I don't know why. But why?
I've tried to search for the problem on the PrestaShop forums, and I found people with the same problem (1, 2), but there was no solution given.
Look at a function, that sets the
en_default
and I think it is clear, why it does, what it does.This is from 1.5 version.