Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1494257

    Hi support, I’m having trouble with the phone field, which should be mandatory on my website https://www.portolortoacasa.it/ordina-online/.
    I’ve tried several plugins, and this one also works via PHP:
    add_filter( ‘woocommerce_billing_fields’, ‘wps_remove_filter_phone’, 10, 1 );
    function wps_remove_filter_phone( $address_fields ) {
    $address_fields[‘billing_phone’][‘required’] = true;
    return $address_fields;
    }

    But I can’t get it to work. Can you please help me find a solution? Thanks, Gianluca.

    #1494346

    Hey Gianluca,

    Google Gemini suggested this:

    add_filter( 'woocommerce_billing_fields', 'custom_override_billing_fields' );
    function custom_override_billing_fields( $fields ) {
        $fields['billing_phone']['required'] = true;
        return $fields;
    }

    Please note that we can’t provide support for general questions about WooCommerce for example.

    Best regards,
    Rikard

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.