Skip to content

Instantly share code, notes, and snippets.

  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
This removes the title entirely to get rid of a duplicate sentence, resolving at the same time a <h2> problem...
* Remove the WooCommerce Local Pickup Time plugin checkout page select field title.
* @see
* @see
if ( class_exists( 'Local_Pickup_Time' ) ) {
// Remove the default local pickup time field from the checkout page.
remove_action( apply_filters( 'local_pickup_time_select_location', 'woocommerce_after_order_notes' ), array( Local_Pickup_Time::get_instance(), 'time_select') );
// And add this custom one.
add_action( apply_filters( 'local_pickup_time_select_location', 'woocommerce_after_order_notes' ), 'my_custom_time_select' );
* Add the local pickup time field to the checkout page
* @param object $checkout The checkout object.
function my_custom_time_select( $checkout ) {
echo '<div id="local-pickup-time-select">';
$lpt = Local_Pickup_Time::get_instance();
'type' => 'select',
'class' => array( 'local-pickup-time-select-field form-row-wide' ),
'label' => __( 'Pickup Time', 'woocommerce-local-pickup-time' ),
'required' => true,
'options' => $lpt->build_pickup_time_options(),
$checkout->get_value( 'local_pickup_time_select' )
echo '</div>';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment