You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It looks to me that it's doing a string vs int comparison in the database engine itself - which isnt uncommon with JSON fields. An example of one of the workarounds we've done elsewhere is here -
$this->builder->orderByRaw("cast({$actualColumn} as {$castType}) {$direction}");
I suspect the simplest solution might be to use the field mapping functionality this driver provides to make a 'price' field which you store as an int, or alternatively to make a query scope which would then let you apply the casting.
Bug description
Hello!
I am trying to filter some product collection on my site using:
{{ collection:products as="products" paginate="24" price:gt="2000" }}
and it seems broken. Some products with a lower price than the conditon still appear in the results.
It also seems that the collection ordering in the CP is broken too (if I order items by price, the result is… interesting :-) )
You can see the initial discussion about this here: duncanmcclean/simple-commerce#1216
How to reproduce
Logs
Environment
Additional details
Thanks!
The text was updated successfully, but these errors were encountered: