Set Pickup/Delivery using link

Adding a _GET parameter to any link to set user option to be pickup or delivery (Requires WPPizza v3.19.3+)

This will only work if

  • – your delivery options are not set to “No delivery offered / pickup only”
  • – have “Allow order pickup by customer” enabled (WPPizza -> Order Settings)
  • – enabled this functionality generally in WPPizza -> Order Settings : Global

example:

/**********************************************************
	add  ?delivery or ?pickup parameter to a link 
	something like 
**********************************************************/
<a href="http[s]://[my-domain.com]/?pickup">Some link text </a> /* set to pickup */
<a href="http[s]://[my-domain.com]/?delivery">Some link text</a> /* set to delivery*/
<a href="http[s]://[my-domain.com]/?foo=1&bar=2&pickup">Some link text</a> /* set to pickup */
<a href="http[s]://[my-domain.com]/?foo=1&bar=2&delivery">Some link text</a> /* set to delivery*/
<a href="http[s]://[my-domain.com]/?foo=1&bar=2&pickup">Some link text</a> /* set to pickup */
<a href="http[s]://[my-domain.com]/?foo=1&bar=2&delivery">Some link text</a> /* set to delivery*/
<a href="http[s]://[my-domain.com]/?foo=1&bar=2&pickup=1">Some link text</a> /* set to pickup */
<a href="http[s]://[my-domain.com]/?foo=1&bar=2&delivery=1">Some link text</a> /* set to delivery*/
...etc...

If the “pickup” and or “delivery” parameter is already being used elsewhere, you can change this by using a constant like so in your wp-config.php:

define('WPPIZZA_GET_DELIVERY', 'x4delivery');
define('WPPIZZA_GET_PICKUP', 'x4pickup');

in which case the links above would then need to be

&x4delivery
&x4pickup

respectively