Price Required Not Working
-
Hello,
Using the custom fields add-on, I am able to successfully require various fields – except that of ‘PRICE’. Despite setting the ‘price’ fields to be required on all our forms, users are still able to proceed without inputing a price (of what it is they are selling).I looked at previous threads related to this matter and I tried using the below code, that unfortunately didn’t work. I added it to the functions.php:
add_filter( "adverts_form_load", "customize_adverts_add" ); function customize_adverts_add( $form ) { if( $form['name'] != "advert" ) { return $form; } foreach( $form["field"] as $key => $field ) { if( $field["name"] == "adverts_price" ) { $form["field"][$key]["validators"] = array(); $form["field"][$key]["validators"][] = array( "name" => "is_required" ); } } return $form; }Please Help. Thanks.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘Price Required Not Working’ is closed to new replies.