Question

I think I found a bug in opencart so in the featured module there is an autocomplete box which suggests products but it seems to skip a whole bunch. After examining the code it looks like it all boils down to this database query:

SELECT * 
FROM calcproduct p 
LEFT JOIN calcproduct_description pd ON (p.product_id = pd.product_id) 
WHERE pd.language_id = '1' AND LCASE(pd.name) LIKE 'ti %' 
GROUP BY p.product_id 
ORDER BY pd.name ASC LIMIT 0,20

When I run the query manually for example I have two products:

TI | 83 | Brand New
TI | 83 | Like New

It only finds one of them and it's doing this for other products as well. Does anyone have any clue why this happens?

It has to be the like part of the query i took out the group by and order by and even the first where clause. I tried changing the column from utf_8 to latin_1.

enter image description here

enter image description here

enter image description here

Was it helpful?

Solution 2

I figure it out there was a space in front of those product name that weren't showing up

OTHER TIPS

If that 83 is the p.product_id field, then you would only ever get one of those two rows. Any fields which are grouped, where two or more rows have the same value, will collapse down into a single row.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top