• Resolved johnegg

    (@johnegg)


    I have added code to functions to make the Eircode (zip code) required but when I go to checkout it still says “optional” for eircode. Im not using any checkout field plugins. This is teh code im using:

    add_filter( ‘woocommerce_checkout_fields’, ‘make_shipping_eircode_required’, 99 );
    function make_shipping_eircode_required( $fields ) {
    if ( isset( $fields[‘shipping’][‘shipping_eircode’] ) ) {
    $fields[‘shipping’][‘shipping_eircode’][‘required’] = true;
    // Optionally update the label to show it’s required.
    $fields[‘shipping’][‘shipping_eircode’][‘label’] = __( ‘Eircode *’, ‘your-text-domain’ );
    }
    return $fields;
    }

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Make eircode not optional’ is closed to new replies.