Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with filter in products #466

Open
polaije opened this issue Oct 17, 2023 · 2 comments
Open

Error with filter in products #466

polaije opened this issue Oct 17, 2023 · 2 comments

Comments

@polaije
Copy link

polaije commented Oct 17, 2023

Prestashop version : 1.7.39
Nuget Prestasharp version : 1.2.9
dependencies :
.net framework v4.5.2
restsharp 106.11.4
.net standard v2.0

This the code with the filter on active
Dictionary<string, string> filter = new Dictionary<string, string>();
filter.Add("Active", "1");

        string Verif = string.Empty;
        List<product> SelProducts = ProductFact.GetByFilter(filter,"reference_ASC","9999");
        //List<product> SelProducts = ProductFact.GetAll();

And i receive error 👍 👍 Bukimedia.PrestaSharp.PrestaSharpException : '
display: full
filter[Active]: 1
sort: reference_ASC
limit: 9999

with details 👍 {"\r\ndisplay: full\r\nfilter[Active]: 1\r\nsort: reference_ASC\r\nlimit: 9999\r\ndate: 1\r\nws_key: UI3VEQPH1KBANWRKHY5Q65FW9EIBFUG2\r\n\r\n\n<prestashop xmlns:xlink="http://www.w3.org/1999/xlink\">\n\n\n\n\n\n\n\n HttpStatusCode: BadRequest"}

I dont understand, because this code works in another application.

Can you help ?
Jean-Marie

@sanctusmob
Copy link
Contributor

Hi Jean-Marie,

The issue seems to be with the filter key. In the filter, try using "active" in lowercase instead of "Active":
filter.Add("active", "1");

Hope this helps!

@polaije
Copy link
Author

polaije commented Oct 7, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants