Hi,
The code was provided by kyratn on the other thread. I've not tested it myself. Here is the code with the modifications we talked about in the other thread included:
<!-- product characteristics values -->
<span class="listing-char listing-show-characteristics">
<?php
$database = JFactory::getDBO();
$query="SELECT group_concat(product_id) AS product_ids FROM #__hikashop_product WHERE (product_parent_id=".$this->row->product_id.") AND product_quantity>0 AND product_published > 0";
$database->setQuery($query);
$parent_product_ids=$database->loadColumns();
$query = 'SELECT * FROM #__hikashop_variant AS v LEFT JOIN #__hikashop_characteristic AS c ON v.variant_characteristic_id=c.characteristic_id WHERE characteristic_parent_id=XXX AND variant_product_id IN ('.implode(',',$parent_product_ids).') GROUP BY characteristic_id ORDER BY c.characteristic_ordering ASC';
$database->setQuery($query);
$rows = $database->loadObjectList();
foreach($rows as $row){
echo $row->characteristic_value." ";;
}
?>
</span>
<!-- end -->
this code is to be placed in product / listing_img_title via the menu Display>Views.
Note however that this is only a crude version of the complete solution:
- there is no selection of the variant
- there is no possibility to add the variant directly to the cart from there, or see the different prices / stocks
/ images of each variant if you display that information on the listing.
- you'll likely need a bit of CSS as you have less space available than on the product details page
So it's not something we could implement like that in HikaShop.
We already have on our todo list the capability to have variants directly displayed and selectable on the listing. We've had it for years.
However, a complete solution is not easy and it raises several issues that make it difficult for us to implement it in a generic way compared to a solution specific to the needs of one shop.