Phone number mandatory for pickup

Topic summary

A shop owner needs to make phone numbers mandatory for pickup orders to schedule appointments, as their store lacks standard opening hours. Currently, the phone field is only required for delivery orders.

Solutions proposed:

  • Custom code approach: Add PHP code to the theme’s functions.php file that checks if ‘local_pickup’ is selected and marks the billing phone field as required in WooCommerce.

  • Plugin solution: Use Easify Product Options app, which offers a no-code approach with conditional logic. The app can display and require a phone number field specifically when pickup is chosen as the shipping method.

Both solutions use conditional logic to trigger the phone requirement based on the selected shipping method. The plugin option includes visual examples showing the setup process and customer-facing result.

Status: Multiple solutions provided; awaiting original poster’s implementation choice.

Summarized with AI on October 28. AI used: claude-sonnet-4-5-20250929.

Hello

Right now customers have to option to choose pick-up or delivery.

For delivery customers need to leave there phone number and I can make it a mandatory field.

However this field is not mandatory when customers choose pick-up. I need it to be mandatory because we don’t have standard opening hours in our shop. So we need to set up an appointment.

Pleas help me :slightly_smiling_face:

hi @Charcopp14

Hello,

Thanks for reaching out!

To make the phone number field mandatory for customers selecting pick-up, you can implement conditional logic. Here’s how you can do it:

If using a form plugin (like WPForms, Gravity Forms, etc.): You can set up conditional logic that checks if the customer chooses “Pick-up” and then marks the phone number field as required.

If using WooCommerce: You can use custom code to make the phone number field mandatory when the “Pick-up” option is selected. Here’s a sample code you can add to your theme’s functions.php file:

function custom_checkout_fields( $fields ) {
    if ( isset( $_POST['shipping_method'][0] ) && 'local_pickup' === $_POST['shipping_method'][0] ) {
        $fields['billing']['billing_phone']['required'] = true;
    }
    return $fields;
}
add_filter( 'woocommerce_checkout_fields', 'custom_checkout_fields' );

This will ensure that customers choosing pick-up must enter a phone number.

Hi @Charcopp14

I recommend trying Easify Product Options for this. With its conditional logic and number box, you can show or require the phone number field only when customers choose “Pick-up” — exactly what you need for setting appointments. It’s super easy to set up, no coding required. You just create the options, set the logic, and you’re good to go :+1: Here’s how it works:

  • This is the result:

  • This is the app setting:

To ensure the Number Box show up only when Pickup is selected as shipping method, simply set up Conditional Logic in the Advanced Settings like this:

You’ll find this app easy to use, so I hope you give it a try. If you need assistance, just let me know or reach out to Easify! :hugs: