Skip to content

Instantly share code, notes, and snippets.

View artisanpixel's full-sized avatar

Joshua Naylor artisanpixel

View GitHub Profile
@artisanpixel
artisanpixel / local-pickup-plus-conditional-payments.php
Last active August 25, 2021 17:00
WooCommerce Local Pickup Plus - Conditional Payments based on Pickup Location
<?php
/*
** Show and hide payment gateways based on local pickup plus locations
** Tested with Local Pickup Plus 2.3.11 and WooCommerce 3.3.5
*/
add_filter( 'woocommerce_available_payment_gateways', function ( $available_gateways ) {
// pass in the array of location ID's - same as the post ID of the locatoin visible in the URL