Filter product by price

Help for integrating the Laravel package
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!
Ivan
Posts: 6
Joined: 15 Jul 2020, 07:59

Filter product by price

Post by Ivan » 15 Jul 2020, 08:05

Hi,
I use aimeos laravel package
How can I filter between two prices.

I tried this filter[&&][][>][product.price]=100&filter[&&][][<][product.price]=150

But I got an error
"title": "Invalid name \"product.price\""

I didn't find any information in documentation about price.
Thank you

User avatar
aimeos
Administrator
Posts: 7955
Joined: 01 Jan 1970, 00:00

Re: Filter product by price

Post by aimeos » 15 Jul 2020, 12:34

The products don't have a property named "product.price". To filter by price, use "index.price:value" to use the indexed prices for the products.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Ivan
Posts: 6
Joined: 15 Jul 2020, 07:59

Re: Filter product by price

Post by Ivan » 20 Jul 2020, 09:31

Hi,
Thank you for reply.
I don't understand how can I build url
I try
filter[&&][][==][index.price:100] or filter[&&][][==][index.price]=100 but it doesn't work
Thank you

User avatar
aimeos
Administrator
Posts: 7955
Joined: 01 Jan 1970, 00:00

Re: Filter product by price

Post by aimeos » 21 Jul 2020, 09:10

Usually, you want to filter by price range, to the filter parameter would be:

Code: Select all

filter[&&][][>=][index.price:value("EUR")]=100&filter[&&][][<=][index.price:value("EUR")]=200
Please keep in mind that you have to urlencode() special characters like "&" and "=".
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Ivan
Posts: 6
Joined: 15 Jul 2020, 07:59

Re: Filter product by price

Post by Ivan » 21 Jul 2020, 12:06

Thank you very much, it works

Post Reply