Post by Kristabyte » Sat Aug 05, 2017 5:46 am

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!

Attachments


Newbie

Posts

Joined
Fri Aug 04, 2017 1:08 am
Who is online

Users browsing this forum: No registered users and 95 guests