Yes, the problem is that my customer doesn't want to enter manually one-by-one each product related to other products. So in the meantime he wants to display the related products module, and if it doesn't has related products, display other products from the same category. What I'm trying to do in the `show_default.php` template of the `product` view is something like this:
<div class="shop-product-related">
<div class="shop-title-container">
<h1>
Related Products
</h1>
<?php
$html = $renderer->render('product-related-products', array('style' => 'default'), null);
if (empty($html)) {
$html = $renderer->render('category-products', array('style' => 'default'), null);
}
echo $html;
?>
</div>
</div>
But I don't know how to render a "other products from this same category" module. So I was thinking there must be something like:
$catClass = hikashop_get('class.category');
$category = $catClass->get($this->element->category_id);
$products = $category->getProducts();
foreach ($product in $products) {
if ($product->product_id != $this->element->product_id) {
.....
}
}
Is it possible?