Hi,
I do have such query which displays characteristic values of the product in product listing:
<?php
$database = JFactory::getDBO();
$query="SELECT group_concat(product_id) as product_ids from `ozi8g_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->loadResult();
$this->row->product_id=$parent_product_ids;
$cat_id = '21';
$query = 'select * from ozi8g_hikashop_variant as v left join ozi8g_hikashop_characteristic as c on v.variant_characteristic_id=c.characteristic_id where characteristic_parent_id='.$cat_id.' and variant_product_id in ('.$parent_product_ids.') GROUP BY characteristic_id ORDER BY `c`.`characteristic_ordering` ASC';
$database->setQuery($query);
$rows = $database->loadObjectList();
foreach($rows as $row){
echo '<span class="tz-pchars">'.$row->characteristic_value.'</span>';
}
?>
Now the issue that i have 2 size characteristics. One for clothes and second for shoes with different id's. Is there a way to have dynamic characteristic_parent_id? I have spent some time but only what i could think is to set id based on category id which works well but it gives other issues for module which display random products...
Could Anyone with better knowledge give some hint please?
Thanks