Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Location Hook Not Working as Expected #94

Closed
3 tasks
timnolte opened this issue Sep 6, 2020 · 2 comments · Fixed by #150
Closed
3 tasks

Location Hook Not Working as Expected #94

timnolte opened this issue Sep 6, 2020 · 2 comments · Fixed by #150
Assignees
Labels
Milestone

Comments

@timnolte
Copy link
Member

timnolte commented Sep 6, 2020

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

@bantunesm
Copy link

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… 😀

@timnolte timnolte added this to the 1.6.0 milestone Jan 23, 2021
@timnolte
Copy link
Member Author

timnolte commented Apr 3, 2022

@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.

@timnolte timnolte modified the milestones: 1.6.0, 1.4.0 Apr 3, 2022
timnolte added a commit to timnolte/woocommerce-local-pickup-time that referenced this issue Apr 4, 2022
* Updates NPM & Composer dependencies.
* Moves the plugins settings to WooCommerce->Settings->Shipping->Local
  Pickup Time settings.
* Reformats some of the plugin settings display.
* Adds new settings screenshots.
* Removes checks that prevent loading the Admin class during AJAX
  calls.
* Adds the ability to change whether the Pickup Time is required on
  checkout via a plugin setting. Closes WC-Local-Pickup#71
* Adds the ability to link Pickup Time to a Local Pickup Shipping
  Method. Closes WC-Local-Pickup#23 / Closes WC-Local-Pickup#94
* Changes output of Pickup Time selection. Closes WC-Local-Pickup#103 / Closed WC-Local-Pickup#104
* Changes the Pickup Time select field options to use a blank entry
  for the default upon load. Closes WC-Local-Pickup#123
timnolte added a commit that referenced this issue Apr 4, 2022
* Updates NPM & Composer dependencies.
* Moves the plugins settings to WooCommerce->Settings->Shipping->Local
  Pickup Time settings.
* Reformats some of the plugin settings display.
* Adds new settings screenshots.
* Removes checks that prevent loading the Admin class during AJAX
  calls.
* Adds the ability to change whether the Pickup Time is required on
  checkout via a plugin setting. Closes #71
* Adds the ability to link Pickup Time to a Local Pickup Shipping
  Method. Closes #23 / Closes #94
* Changes output of Pickup Time selection. Closes #103 / Closed #104
* Changes the Pickup Time select field options to use a blank entry
  for the default upon load. Closes #123
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants