WC-Local-Pickup/woocommerce-local-pickup-time

Location Hook Not Working as Expected

Closed this issue · 2 comments

Describe the bug
I followed this https://wordpress.org/support/topic/can-you-give-an-example-of-how-to-change-the-location-of-the-pickup-time-box/ but somehow, the pickup time box is always in the default location.

Am I doing something wrong?

To Reproduce
Steps to reproduce the behavior:
Here is the code in functions.php

add_filter( 'local_pickup_time_select_location', 'my_custom_location_function' );
function my_custom_location_function( $location ) {
	$location = 'woocommerce_before_order_notes';

	return $location;

Expected behavior
The Local Pickup Time should output in the location specified by the hook.

Isolating the problem (mark completed items with an [x]):

  • I have deactivated other plugins and confirmed this bug occurs when only WooCommerce and this plugin are active.
  • This bug happens with a default WordPress theme active, or Storefront.
  • I can reproduce this bug consistently using the steps above.

WordPress Environment

  • Website URL:
  • PHP Version:
  • WordPress Version:
  • WooCommerce Version:
  • Plugin Version:
  • WordPress Timezone Setting:
  • WordPress Date Format Setting:
  • WordPress Time Format Setting:
  • All Plugin Start/End Pickup Time Settings:
  • Plugin Pickup Time Interval Setting:
  • Plugin Pickup Time Delay Setting:
  • Plugin Orders Per Interval:
  • Plugin Pickup Time Open Days Ahead Setting:

References

Hi Tim,

I hope you’re doing fine.

I’m reaching you to know if you solved this bug or if you have any solution to relocate the pickup time box ?

After several tries of others plugins, yours is the best one so… 😀

@bantunesm I know this is well overdue, but I have determined why there might be problems with this. And actually, choosing the location of the Pickup Time is going to be deprecated as of the next release. In version 1.4.0 there will be an option to link the Pickup Time specifically to the Local Pickup shipping method, and this change moves the Pickup Time to be output along with the "Local Pickup" shipping method selection radio button. There is not a lot of flexibility with that as newer versions of WooCommerce have introduced and AJAX handling of the checkout totals that will refresh without a full page refresh. This will cause problems for users where the Pickup Time selection would need a large amount of custom code to manage that field along with a shipping change to update a whole different part of the page. It's possible that this feature could return in the future in a non-deprecated way but it will be low on the priority list.