How to filter by price ?

56 views
Skip to first unread message

Pixo

unread,
Mar 25, 2012, 5:35:19 PM3/25/12
to Fotolia API
Hello,
I've got a problem to filter relults by price using getSearchResults
function :
I would want to filter by price on License M but cant do it, Here is
my code :

$arrayFilter['max_price_x']=5;
$results=$api->getSearchResults(
array(
'words'=>$pParams['k_filter'],
'cat1_id'=>$pParams['c_filter'],
'filters'=>$arrayFilter,
'language_id'=>Fotolia_Api::LANGUAGE_ID_FR_FR,
'limit'=>18));

Do I have to replace "$arrayFilter['max_price_x']=5" by
"$arrayFilter['max_price_M']=5" ? It seems that it doesn't works
also...
Any help ?

Olivier Sirven

unread,
Mar 26, 2012, 4:41:43 AM3/26/12
to Fotol...@googlegroups.com

Hi,

Filtering by price can only be done using XS or X price as pointed out
by the documentation.

--
Oliv

Pixo

unread,
Mar 26, 2012, 5:59:34 AM3/26/12
to Fotolia API
Hello Oliv, I don't well understand...
Could you correct this code ?
$arrayFilter['max_price_x']=5;
$results=$api->getSearchResults(
array(
'words'=>$pParams['k_filter'],
'cat1_id'=>$pParams['c_filter'],
'filters'=>$arrayFilter,

'language_id'=>Fotolia_Api::LANGUAGE_ID_FR_FR,
'limit'=>18));

I would want results only width price<=5

Thnaks for your support

Olivier Sirven

unread,
Mar 26, 2012, 7:47:27 AM3/26/12
to Fotol...@googlegroups.com

On 2012-03-26 11:59:34, Pixo wrote:
> Hello Oliv, I don't well understand...
> Could you correct this code ?
> $arrayFilter['max_price_x']=5;
> $results=$api->getSearchResults(
> array(
> 'words'=>$pParams['k_filter'],
> 'cat1_id'=>$pParams['c_filter'],
> 'filters'=>$arrayFilter,
>
> 'language_id'=>Fotolia_Api::LANGUAGE_ID_FR_FR,
> 'limit'=>18));
>
> I would want results only width price<=5
>
> Thnaks for your support

Filtering files having extended license price below 5 credits
(max_price_x = 5) does not make any sense: you won't find any images
having such low extended license pricing.

As I understand it, you want to filter based on standard license, so the
correct filter should be max_price_xs. I suggest to define it to 1 so
you have in return the cheapest available files

--
Oliv

Pixo

unread,
Mar 26, 2012, 10:06:58 AM3/26/12
to Fotolia API
Sorry but not it's not clear...
I want filter on "Standard M" license with prices in range of (0 to
30€)
Is my code below correct ?
$arrayFilter['max_price_M']=30;
$results=$api->getSearchResults(
                        array(
                      'words'=>'toto',
                        'cat1_id'=>1232455,
                        'filters'=>$arrayFilter,

'language_id'=>Fotolia_Api::LANGUAGE_ID_FR_FR,
                        'limit'=>18));

thanks.

Olivier Sirven

unread,
Mar 26, 2012, 10:51:40 AM3/26/12
to Fotol...@googlegroups.com
On 2012-03-26 16:06:58, Pixo wrote:
> Sorry but not it's not clear...
> I want filter on "Standard M" license with prices in range of (0 to
> 30ᅵ)

Like I said ealier, it's not possible to filter on "Standard M" license.

Reply all
Reply to author
Forward
0 new messages