Hi,
Thanks for the clarification.
It requires some customization of the "vendor | listingcontainer_div" and "vendor | listingcontent_img_title" views in order to load the required data using some SQL queries and display them.
First you need to retrieve the "vendor_id" of all vendors in the listing
$vendor_ids = array();
foreach($this->rows as $row) {
$vendors_ids[ (int)$row->vendor_id ] = (int)$row->vendor_id;
}
Thanks to that, you will be able to load the product counter for the vendors.
$this->product_counter = array();
if(!empty($vendor_ids)) {
$db = JFactory::getDBO();
$query = 'SELECT vendors.vendor_id, count(products.product_id) FROM '.hikamarket::table('vendor') .' AS vendors LEFT JOIN '.hikamarket::table('shop.product').' as products on vendors.vendor_id = products.product_vendor_id WHERE products.product_type = '.$db->Quote('main').' AND products.product_published = 1 AND vendors.vendor_id IN ('.implode(',' $vendor_ids).') GROUP BY vendors.vendor_id;
$db->setQuery($query);
$this->product_counter = $db->loadObjectList('vendor_id');
}
After that, in the "listincontent_img_title" (which is I think the most appropriate view) ; you can check the content of the product_counter array and see if the vendor have products (You can also display that counter in the view).
If so, you can make a new query in order to load the last products of the vendors.
I don't see faster way to achieve that goal using less SQL queries ; so depending the number of vendors in the listing and the number of products in your database, it could ask for more CPU resources.
$query = 'SELECT * FROM '. hikashop_table('product') . ' WHERE product_published = 1 AND product_type = ' . $db->Quote('main') . ' AND product_vendor_id = '.(int)$this->row->vendor_id.' ORDER BY product_created DESC';
$db->setQuery($query, 0, 4);
$vendor_products = $db->loadObjectList('product_id');
For the view content, I recommend you to take a look at the current HikaShop views ; so you can use them as a base to display the products tiles.
www.hikashop.com/support/support/documen...ize-the-display.html
Regards,