// product similar
$this->data['products_similar'] = array();
$similar = $this->model_catalog_product->getProductSimilar($this->request->get['product_id'],4);
foreach ($similar as $result) {
if ($result['image']) {
$image = $this->model_tool_image->resize($result['image'], $this->config->get('config_image_related_width'), $this->config->get('config_image_related_height'));
} else {
$image = false;
}
if (($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) {
$price = $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax')));
} else {
$price = false;
}
if ((float)$result['special']) {
$special = $this->currency->format($this->tax->calculate($result['special'], $result['tax_class_id'], $this->config->get('config_tax')));
} else {
$special = false;
}
if ($this->config->get('config_review_status')) {
$rating = (int)$result['rating'];
} else {
$rating = false;
}
$this->data['products_similar'][] = array(
'jan' => $result['jan'],
'product_id' => $result['product_id'],
'thumb' => $image,
'name' => $result['name'],
'upc' => $result['upc'],
'price' => $price,
'attribute_groups' => $this->model_catalog_product->getProductAttributes($result['product_id']),
'special' => $special,
'rating' => $rating,
'reviews' => sprintf($this->language->get('text_reviews'), (int)$result['reviews']),
'href' => $this->url->link('product/product', 'product_id=' . $result['product_id']),
);
}
// product similar
$this->data['products'] = array();
Это я прописываю в контролере
<?php if ($products_similar) { ?>
<div id="tab-similar" class="tab-content">
<div class="box-product" style="border-bottom: 1px solid;border-top: 1px solid;">
<table id="table" style="border-left: 1px solid;width: 100%;border-top: 1px solid;border-right: 1px solid;">
<?php foreach ($products_similar as $product) { ?>
<tr class="hoverrt"style="border: 1px solid;">
<td style="width: 10%;" > <?php if ($product['thumb']) { ?>
<div style="width: 34px;float: left;margin-bottom: 0px;padding: 0px;text-align: center;" class="image"><a href="<?php echo $product['href']; ?>"><img src="<?php echo $product['thumb']; ?>" alt="<?php echo $product['name']; ?>" /></a></div>
<?php } ?> </td>
<td style="width: 200px; text-align: left;"> <div class="name" style="height: auto;"><a style="margin-bottom: 0px;"href="<?php echo $product['href']; ?>"><?php echo $product['jan']; ?></a></div></td>
<td style="width: 93px; text-align: center;"> <?php if ($product['price']) { ?>
<div class="price price12" style=" margin-bottom: 0px; color: #229AC8;height: auto;font-weight: bold;">
<?php if (!$product['special']) { ?>
<?php echo $product['price']; ?>
<?php } else { ?>
<span class="price-old"><?php echo $product['price']; ?></span> <span class="price-new"><?php echo $product['special']; ?></span>
<?php } ?>
</div><?php } ?> </td>
<td style="width: 15%;"><p style=" margin-bottom: 0px;color: #229AC8;height: auto;font-weight: bold;"><?php echo $product['upc']; ?>м.кв</p></td>
</tr>
<?php } ?>
</table>
</div>
</div>
<?php } ?>
А вот это вывожу в вюв
но не могу сообразить как сделать вывод товара если у товара одинаковый jan