Привет всем!
Питаюсь добавить тут сортировка по рандомно но почему то выдает ошибка помогите если не сложно.
$sql=" select *,p.product_id as related_id from " . DB_PREFIX . "product p LEFT JOIN " . DB_PREFIX . "product_to_store p2s ON (p.product_id = p2s.product_id) where p.product_id in (select product_id from " . DB_PREFIX . "product_to_category where category_id in (SELECT category_id FROM " . DB_PREFIX . "product_to_category where product_id=".(int)$product_id.")) AND p.status = '1' AND p.date_available <= NOW() AND p2s.store_id = '" . (int)$this->config->get('config_store_id') . "'limit 8";
$query = $this->db->query($sql);