1b.app
Link copied -

The filter in products by additional field does not work correctly if you specify 0 in the value

Тут https://baza.cn.ua/admin/shop/products/?filtercustomkodkategoriirozetka23=&f... &fromfiltercustomzalishok25=0&tofiltercustomzalishok25=0&filtercdatefrom=&filtercdateto=&filtertags=&filtermodel=&filtershare=&categoryid=1594&searchLine=
I filter by these parameters http://prntscr.com/u1mmaa
That is, I have a field "Overage" and I filter the values where in this field "0" http://prntscr.com/u1mn1o
If I filter the value 1, 2, 3 etc. then everything works fine, but if you set it to 0 it doesn't work
Original question is available on version: ru

Answers:

Good afternoon, Vlad Valerievich.
The filter is working correctly.
https://prnt.sc/u1nrgx
In the field from and to you need to set values from 1
And in order to filter 0, you need to check the box as in the screenshot (Out of stock)
https://prnt.sc/u1nrt8
and click filter.
And get the desired result
https://prnt.sc/u1ns49
18.08.2020, 17:06
Original comment available on version: ru

Куприян Владислав Валерьевич
Baza.cn.ua / Integrator (FOP Kupriyan)
And where does "out of stock" I filter by an additional field that has a numeric type, 0 is also a number, I write values \u200b\u200bin this field, why can't I filter by 0 ?
18.08.2020, 17:25
Original comment available on version: ru

Good afternoon, Vlad Valerievich.
0 is also a number in mathematics, and programmatically 0 is perceived as - or not available.
Therefore, 0 cannot be filtered. And that is why it is issued separately - Out of stock.
19.08.2020, 09:06
Original comment available on version: ru

Куприян Владислав Валерьевич
Baza.cn.ua / Integrator (FOP Kupriyan)
Somehow I do not understand the logic of the functional
Look, I created an additional product field, the type is numeric
I write in it any numbers from 0 to 999999
The fact that I connected all this with the presence, let's not consider this task at all, since I just came up with such a crutch, since there is no filter in the system by the amount of residue in the products
So I created a field in which I write values and it comes out according to your logic, I can’t filter products by this field in which I wrote 0 in this field (that is, it was 1, then I wrote 0 there)
What is the logic here that I cannot filter products
20.08.2020, 18:49
Original comment available on version: ru

Good afternoon, Vlad Valerievich.
You can filter by a numerical value from 1 to 999999 or by the absence of this value if you have 0 set. Since 0 is programmatically perceived as the absence of a value.
21.08.2020, 10:15
Original comment available on version: ru

That is, if you entered in the field from and to 0 and clicked filter, it is programmatically perceived in the same way as if nothing is entered in these fields and you clicked filter, the result is the same.
http://i.imgur.com/0AIHc0e.png
21.08.2020, 10:23
Original comment available on version: ru

Куприян Владислав Валерьевич
Baza.cn.ua / Integrator (FOP Kupriyan)
Why are you explaining to me how it works now, I understand it perfectly
I don’t understand the logic why it works this way, in any systems you can filter a numeric value by any data, even though it’s 0, even though it’s 999999, why does it turn out that the system cannot filter by 0, can you modify it somehow?
21.08.2020, 10:40
Original comment available on version: ru


Kupriyan Vlad Valerievich wrote:
I don't understand the logic why it works like this

Because that's how the php programming language works

in any systems, you can filter a numeric value by any data, even though it is 0, even though it is 999999, why do you get that the system cannot filter by 0

you can sort from 0 to any value, from largest to smallest, or vice versa, if you make this field sortable
21.08.2020, 11:03
Original comment available on version: ru

Куприян Владислав Валерьевич
Baza.cn.ua / Integrator (FOP Kupriyan)

Alexander Shedko wrote:
Because that's how the php programming language works

Does that mean you can't do it?

Alexander Shedko wrote:
you can sort from 0 to any value, from largest to smallest, or vice versa, if you make this field sortable

Is it possible to sort additional product fields?
21.08.2020, 11:36
Original comment available on version: ru


The filter in products by additional field does not work correctly if you specify 0 in the value

I told you that the filter works correctly, if you need to sort additional fields or if you have any other wishes for the box functionality, then these are improvements.
21.08.2020, 11:51
Original comment available on version: ru

Куприян Владислав Валерьевич
Baza.cn.ua / Integrator (FOP Kupriyan)
1. You said that you can sort, how to do it, if not, how much will the revision cost?
2. You can modify that it would be possible to specify from 0 to 0 in the filter and the system showed all records in which in this additional field 0, if so, how much will it cost?
21.08.2020, 12:14
Original comment available on version: ru


Vladislav, I understand the essence of your appeal, but please specify why to filter from zero to zero https://prnt.sc/u1mmaa if there is a special checkbox "out of stock" https://prnt.sc/u52l7a ? If you need to filter from zero to a certain number, then you can enter zero and the number you need, and the filter will work correctly (example from zero to three): https://prnt.sc/u52mls plus, if other fields are taken into account https://prnt.sc/u52o91 growth, I think, in principle, cannot take on the value 0, you also do not see goods with a price of 0.
24.08.2020, 19:47
Original comment available on version: ru

Куприян Владислав Валерьевич
Baza.cn.ua / Integrator (FOP Kupriyan)

Alexander Shedko wrote:
The filter in products by additional field does not work correctly if you specify 0 in the value. I told you that the filter works correctly, if you need to sort additional fields or if you have any other wishes for the box functionality, then these are improvements.

You said that you can sort, now you say that this is a refinement, how much will it cost?
24.08.2020, 21:29
Original comment available on version: ru

Куприян Владислав Валерьевич
Baza.cn.ua / Integrator (FOP Kupriyan)

Kupriyan Vlad Valerievich The client wrote:
You said that you can sort, now you say that this is a refinement, how much will it cost?

???
02.09.2020, 23:47
Original comment available on version: ru

Please join the conversation. If you have something to say - please write a comment. You will need a mobile phone and an SMS code for identification to enter. Log in and comment