Hi there--
I'm currently using a vqmod extension that sorts my products from date added, it works wonderfully. I was wondering how I could possibly make the code also sort the "Sold Out" items to the bottom. I found this code in another thread :
$sql .= " ORDER BY if(quantity = 0,1,0),";
if (isset($data['sort']) && in_array($data['sort'], $sort_data)) {
if ($data['sort'] == 'pd.name ' || $data['sort'] == 'p.model') {
$sql .= " LCASE(" . $data['sort'] . ")";
} elseif ($data['sort'] == 'p.price') {
$sql .= " (CASE WHEN special IS NOT NULL THEN special WHEN discount IS NOT NULL THEN discount ELSE p.price END)";
} else {
$sql .= " " .$data['sort'];
}
} else {
$sql .= " p.sort_order";
}
But am not savvy enough to figure out how to apply it, and to where --- I've added my vqmod as an attachment, if anyone would be willing to help I'd greatly appreciate it.
Thanks!
Who is online
Users browsing this forum: No registered users and 22 guests