• Resolved lili0allen

    (@lili0allen)


    Hi, I just realise no matter it’s a text field or select or radio button field, if the value is “0”, I cannot add that product into cart. Is this a bug?

    Thanks
    Allen

    • This topic was modified 5 years, 10 months ago by lili0allen.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter lili0allen

    (@lili0allen)

    just want to clarify, this issue happens if the field is Required, and it would not allow “0” value.

    Plugin Contributor sarkparanjothi

    (@sarkparanjothi)

    Hi @lili0allen,
    For validation we are used empty function we are miss understand it.
    This issue will be fix next version.

    Please follow the instruction: Go to plugins/wc-fields-factory/includes/wcff-validator.php

    open the file and find

    !empty($_val)

    and replace with

    trim( $_val ) != “”

    Thanks

    Thread Starter lili0allen

    (@lili0allen)

    Thanks for your reply, mate. Actually I tried the same solution before. It resolves half of the issue, which I can add the product to cart even though the value is “0”. However, that “0” field won’t display as an attribute in the cart.

    For now, I just use CAPITAL letter “O” to replace value “0”. If you can solve display issue in cart, that would be awesome.

    Cheers

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Could not accept value 0’ is closed to new replies.