Originally Posted by
vinchenzison
Maybe not the best way but I changed the sql statement to give me a random product
The more appropriate solution would changing settings in dca/tl_module.php at line 359 we will add 'RAND'
Code:
'options' => array('DESC','ASC','RAND'),
then we must hack ModuleIsotopeProductList.php, add next lines before $objProductIds = $this->Database->prepare
Code:
if($this->iso_listingSortDirection == 'RAND')
{
$sortingBy = 'RAND()';
}
else
{
$sortingBy = $this->strOrderBySQL;
}
than change $this->strOrderBySQL to $sortingBy in $objProductIds
Code:
$objProductIds = $this->Database->prepare("SELECT DISTINCT p.* FROM tl_iso_product_categories c, tl_iso_products p WHERE p.id=c.pid AND published='1'" . ($this->strFilterSQL ? " AND (" . $this->strFilterSQL . ")" : "") . " AND c.page_id IN (" . implode(',', $this->arrCategories) . ")" . ($this->strSearchSQL ? " AND (" . $this->strSearchSQL . ")" : "") . ($sortingBy ? " ORDER BY " . $sortingBy : ""));
that's all, module complitely works with randome order
P.S. This hack need testing
Bookmarks