php-allegro-rest-api icon indicating copy to clipboard operation
php-allegro-rest-api copied to clipboard

You can't set multiple values of a filter

Open retrowaver opened this issue 6 years ago • 2 comments

Let's say I'm making the following call, which works fine:

$api->offers->listing->get([
	'phrase' => 'sukienka',
	'category.id' => 124264,
	'parameter.11323' => 2 // używane
]);

The thing is, parameter.11323 could have multiple values, i.e. both 2 (używane) and 246514 (nowe z defektem), but there's seemingly no way to pass them both. Putting them into an array ('parameter.11323' => ['2', '246514']) doesn't work, because http_build_query() transforms them into parameter.11323[0]=2&parameter.11323[1]=246514, while API expects something like parameter.11323=2&parameter.11323=246514 (as stated here).

retrowaver avatar Aug 15 '18 20:08 retrowaver

Cool, now we know they don't use PHP. Sorry it took me so long to reply, I'll try my best to give it a look soon-ish.

Wiatrogon avatar Sep 13 '18 05:09 Wiatrogon

I've made pull request that solves this problem

bigsiter avatar Nov 27 '18 08:11 bigsiter