Custom Woocommerce checkout filed yields a Json error when validating [closed]

I figured this out. What fixed it was I needed to use isset in the conditional. old code: if (!$_POST[‘delivery’]){ wc_add_notice( sprintf(__(‘You must accept Additional Shipping Conditions.’, ‘themename’)) ,’error’ ); } if (!$_POST[‘customer’]){ wc_add_notice( sprintf(__(‘You must accept responsibility for address misplacement.’, ‘themename’)) ,’error’ ); } Correct code using isset: if (!isset($_POST[‘delivery’])){ wc_add_notice( sprintf(__(‘You must accept … Read more

Problem with conditional woocommerce custom checkout field

Ok, I figured it out (finally) Instead of using the code above to add a new custom field, I changed it to this: add_filter( ‘woocommerce_checkout_fields’, ‘custom_override_checkout_fields’ ); function custom_override_checkout_fields ( $fields ) { $fields[‘order’][‘the_script’] = array ( woocommerce_form_field ( ‘the_script’, array( ‘type’ => ‘textarea’, ‘class’ => array(‘extracheckoutinfo form-row-wide’), ‘label’ => __(‘What is the script?’), ‘placeholder’ … Read more

Get Third Level Categories WooCommerce

I Solved it by my Self $args = array( ‘hierarchical’ => 1, ‘show_option_none’ => ”, ‘hide_empty’ => 0, ‘parent’ => $number = 16, ‘taxonomy’ => ‘product_cat’ ); $subcats = get_categories($args); echo ‘<div class=”wooc_sclist”>’; foreach ($subcats as $sc) { $link = get_term_link($sc->slug, $sc->taxonomy); echo ‘<ul><a href=”‘ . $link . ‘”>’ . $sc->name . ‘</a>’.$sc->term_id; $args2 = … Read more