Automattic\WooCommerce\StoreApi\Utilities
LocalPickupUtils::is_local_pickup_enabled()
Checks if WC Blocks local pickup is enabled.
Method of the class: LocalPickupUtils{}
No Hooks.
Return
true|false
. True if local pickup is enabled.
Usage
$result = LocalPickupUtils::is_local_pickup_enabled();
LocalPickupUtils::is_local_pickup_enabled() LocalPickupUtils::is local pickup enabled code WC 9.4.2
public static function is_local_pickup_enabled() { // Get option directly to avoid early translation function call. // See https://github.com/woocommerce/woocommerce/pull/47113. $pickup_location_settings = get_option( 'woocommerce_pickup_location_settings', [ 'enabled' => 'no', ] ); if ( empty( $pickup_location_settings['enabled'] ) ) { $pickup_location_settings['enabled'] = 'no'; } return wc_string_to_bool( $pickup_location_settings['enabled'] ); }