How to Hide the City and State Fields From the Reservation Table
If you’re looking to hide the city and state reservation fields from the reservation table in WooCommerce Delivery Slots, this guide will show you how to do so.
If you want to allow customers only to enter a ZIP/Postcode in the reservation process, you can. Right now, it’s possible to hide state and city fields but not country because it’s a required field.
Here’s the code snippet to get this done:
/**
* Disable City and State fields.
*
* @return void
*/
function iconic_wds_reservation_table_disable_address_fields() {
?>
<script>
jQuery( function() {
wp.hooks.addFilter( 'iconic_wds_reservation_table_city_visible', 'wds', function() {
return false;
} );
wp.hooks.addFilter( 'iconic_wds_reservation_table_state_visible', 'wds', function() {
return false;
} );
} );
</script>
<?php
}
add_action( 'wp_footer', 'iconic_wds_reservation_table_disable_address_fields' );
WooCommerce Delivery Slots
Let customers choose their preferred WooCommerce delivery date and time right from your WooCommerce checkout page. With WooCommerce Delivery Slots, you can set a flexible delivery schedule to suit you and your customers.
Was this helpful?
Please let us know if this article was useful. It is the best way to ensure our documentation is as helpful as possible.