I'm looking for a way to create a product list/table that shows all available products, including all children. The idea behind this is allowing the user to simply add all the items he wants to the cart instead of having to choose between variants on all the product pages.
What I got so far, is reading directly from the database and displaying all the product info I want:
<?php
$myDatabase = JFactory::getDBO();
$query = "SELECT * FROM #__hikashop_product WHERE 1";
$myDatabase->setQuery($query);
$result = $myDatabase->query();
$rows = $myDatabase->loadAssocList();
?>
<table>
<tr>
<td>name</td>
<td>code</td>
</tr>
<?php
foreach($rows as $row){
if(!strstr($row['product_code'],"N")){
?>
<tr>
<td><?php echo $row['product_name']; ?></td>
<td><?php echo $row['product_code']; ?></td>
</tr>
<?php }} ?>
</table>
Displaying the correct prices, however, is way more difficult. We have different discounts, currencies...
Is there any way to do this properly?
Thanks for any help,
nik