Make meta query treat meta_value as 1 or 0
If I understand it correctly.. What you’re looking for can be achieved using the CASE statement in MySQL, where you would use the following in the ORDER BY clause: # group the quantity meta into two groups CASE # group one – all quantities that are 1 or more; we flag them as “1” WHEN … Read more