Field Validation fails after upgrade
-
I have this code snippet to validate WC fields.
add_filter( 'woocommerce_add_to_cart_validation', 'validate_fields', 1, 3 ); function validate_fields( $passed, $product_id, $pid = null) { global $woocommerce; if( isset( $pid ) ) { $all_fields = apply_filters( 'wccpf/load/all_fields', $product_id ); foreach ( $all_fields as $fields ) { foreach ( $fields as $field ) { // my validation code here } } } return $passed; }
It use to work fine but after upgrading to Version 1.3.4 I get the foloowing error message:
Warning: Invalid argument supplied for foreach() in .../wp-content/plugins/code-snippets/php/snippet-ops.php(383) : eval()'d code on line 8
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Field Validation fails after upgrade’ is closed to new replies.