Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
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 🙂
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.
Dotsquares Ltd
Problem Solved? ✔ Accept and Like solution to help future merchants.
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 👍 Here's how it works:
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! 🤗
Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025Discover opportunities to improve SEO with new guidance available from Shopify’s growth...
By Jacqui May 1, 2025