Filtering orders by service attribute not working
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Filtering orders by service attribute not working
Laravel framework version: 9.52.4
Aimeos Laravel version: ~2022.10
PHP Version: 8.2.4
Environment: Linux
Hello,
Filtering orders by service attributes is not working.
I tried with "Service attribute code" and "Service attribute value".
There are no results, but I know that an order exists with the attribute.
How to reproduce:
Aimeos Laravel version: ~2022.10
PHP Version: 8.2.4
Environment: Linux
Hello,
Filtering orders by service attributes is not working.
I tried with "Service attribute code" and "Service attribute value".
There are no results, but I know that an order exists with the attribute.
How to reproduce:
- Go to the orders section /admin/default/jqadm/search/order
- Click on the magnifying glass to open the search modal
- Select "Service attribute value"
- Select "=="
- Input an existing service attribute value added through the order
Re: Filtering orders by service attribute not working
I've been digging and apparently you have to put the attribute value in quotes in the input field
.
It's getting saved like that in the database.
This is like this because the values are saved as json in the database right?
The quotes should be added to the attribute value automatically when filtering.

It's getting saved like that in the database.
This is like this because the values are saved as json in the database right?
The quotes should be added to the attribute value automatically when filtering.
Re: Filtering orders by service attribute not working
Yes, the data is JSON encoded and can be an array or an object too ("[...]" or "{...}") so adding quotes by default won't help.
There are only two possible options:
1.) Use a LIKE search ("%val%") which is extremely slow when the number of orders is high
2.) Remove the ability to search for product/service attributes
There are only two possible options:
1.) Use a LIKE search ("%val%") which is extremely slow when the number of orders is high
2.) Remove the ability to search for product/service attributes
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos,
give us a star
If you like Aimeos,

Re: Filtering orders by service attribute not working
I think the problem might be in the backend (the "list.php" template file for the orders), perhaps I'm missing a config that adds the quotes automatically when searching for attribute values? I have attempted to search for attribute values on a clean installation of Aimeos and I get the same result there, you simply have to add the quotes if you search for attribute values. It seems counter intuitive and I have been searching for a while before actually looking at the database and SQL, finding out with surprise that the attribute is being saved with quotes and that it's being queried without any quotes.
Re: Filtering orders by service attribute not working
Like said, order product/service attribute values can also be arrays or objects ("[...]" or "{...}") and adding quotes automatically, the search won't find anything too.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos,
give us a star
If you like Aimeos,

Re: Filtering orders by service attribute not working
Perhaps a solution would be if json_decode fails on the input, the input should be enquoted?
I need to check where exactly it's being parsed.
I need to check where exactly it's being parsed.