W
W
wowastrom2019-08-02 18:47:50
opencart
wowastrom, 2019-08-02 18:47:50

How to add the ability to enter 0 in option.type == 'text'?

Hello The
question is this. There is a text option - I enter any values ​​it works fine, but if I enter 0 - it says that it is necessary to fill in the field, I enter 00 works, how to add the ability to enter just 0.
Sincerely, Stromov Vladimir

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Z
zoozag, 2019-08-05
@wowastrom

In the check of options when adding products to the cart, a check for empty is used.
The following values ​​are treated as null:
"" (empty string)
0 (integer)
0.0 (float)
"0" (string)
NULL
FALSE
array() (empty array)
Rewrite this check

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question