Skip to content

Instantly share code, notes, and snippets.

@dennisnissle
Created April 23, 2024 09:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dennisnissle/2cd46674dd398799f7bf8f97c724f23d to your computer and use it in GitHub Desktop.
Save dennisnissle/2cd46674dd398799f7bf8f97c724f23d to your computer and use it in GitHub Desktop.
Move pickup location fields to order review wrapper in classic checkout
<?php
add_action( 'woocommerce_checkout_before_order_review', function() {
$fields = \Vendidero\Germanized\Shipments\PickupDelivery::register_classic_checkout_fields( array( 'order' => array() ) );
foreach( $fields['order'] as $key => $field ) {
woocommerce_form_field( $key, $field, wc()->checkout()->get_value( $key ) );
}
}, 20 );
add_action( 'init', function() {
remove_filter( 'woocommerce_checkout_fields', array( 'Vendidero\Germanized\Shipments\PickupDelivery', 'register_classic_checkout_fields' ), 10 );
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment