Нужна помощь. Есть модуль который выводит на главную категории, вот код который отвечает за вывод категории. А как сделать так, чтобы все товары выводились?
foreach ($categories as $category) {
if ($category['top']) {
$img_w = $this->config->get('config_image_category_width');
$img_h = $this->config->get('config_image_category_height');
if ($category['image']) {
$image = $this->model_tool_image->resize($category['image'], $img_w, $img_h);
} else {
$image = $this->model_tool_image->resize('placeholder.png', $img_w, $img_h);
}
$data['categories'][] = array(
'description' => $category['description'],
'name' => $category['name'],
'image' => $image,
'href' => $this->url->link('product/category', 'path=' . $category['category_id'])
);
}
}
Предполагаю что можно как-то так выводить все товары. Вот только никак не получается, кто знает как прошу помощь, а то уже третий день делаю и никак не могу вывести все товары на главную страницу:
$data['products'][] = array(
'product_id' => $result['product_id'],
'thumb' => $image,
'name' => $result['name'],
'description' => mb_substr(strip_tags(html_entity_decode($result['description'], ENT_QUOTES, 'UTF-8')), 0, 100) . '..',
'price' => $price,
'special' => $special,
'tax' => $tax,
'rating' => $result['rating'],
'reviews' => sprintf($this->language->get('text_reviews'), (int)$result['reviews']),
'href' => $this->url->link('product/product', '&product_id=' . $result['product_id'])
);