I have some product info that I would like to manage as categories for two reasons
- enable filtering
- too many values to manage as custom field
I would like to be able to show these categories similar to custom fields (specification on product layout).
In digging the code, it appears I can find these in the database directly
$query = 'SELECT b.* FROM '.hikashop_table('product_category').' AS a LEFT JOIN '.hikashop_table('category').' AS b ON a.category_id=b.category_id WHERE a.product_id = '.$product_id.' ORDER BY a.product_category_id';
$database->setQuery($query);
$element->categories = $database->loadObjectList();
Doing it this way, I will have to search through the categories, get the category parents, and use the parents to decide if it is something I want to display.
Is there are more elegant way to go about this from the product layout?
If you can give me some pointers, I would really appreciate it and will post solution for others when done
Thanks!