woocommerce_apply_base_tax_for_local_pickup

woocommerce_apply_base_tax_for_local_pickup

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter

See hook in core

Displaying hooks found in version: woocommerce.8.7.0

apply_filters('woocommerce_apply_base_tax_for_local_pickup') is found 3 times:

  • /includes/abstracts/abstract-wc-order.php line 1705
    		 *
    		 * @since 6.8.0
    		 * @param boolean apply_base_tax Whether apply base tax for local pickup. Default true.
    		 */
    		$apply_base_tax = true === apply_filters( 'woocommerce_apply_base_tax_for_local_pickup', true );
    
    		/**
    		 * Filters local pickup shipping methods.
    		 *
    		 * @since 6.8.0
    		 * @param string[] $local_pickup_methods Local pickup shipping method IDs.
    
  • /includes/class-wc-customer.php line 189
    	public function get_taxable_address() {
    		$tax_based_on = get_option( 'woocommerce_tax_based_on' );
    
    		// Check shipping method at this point to see if we need special handling.
    		if ( true === apply_filters( 'woocommerce_apply_base_tax_for_local_pickup', true ) && count( array_intersect( wc_get_chosen_shipping_method_ids(), apply_filters( 'woocommerce_local_pickup_methods', array( 'legacy_local_pickup', 'local_pickup' ) ) ) ) > 0 ) {
    			$tax_based_on = 'base';
    		}
    
    		if ( 'base' === $tax_based_on ) {
    			$country  = WC()->countries->get_base_country();
    			$state    = WC()->countries->get_base_state();
    
  • /src/Blocks/Shipping/ShippingController.php line 389
    		$chosen_method_id       = explode( ':', $chosen_method )[0];
    		$chosen_method_instance = explode( ':', $chosen_method )[1] ?? 0;
    
    		// phpcs:ignore WooCommerce.Commenting.CommentHooks.MissingHookComment
    		if ( $chosen_method_id && true === apply_filters( 'woocommerce_apply_base_tax_for_local_pickup', true ) && in_array( $chosen_method_id, LocalPickupUtils::get_local_pickup_method_ids(), true ) ) {
    			$pickup_locations = get_option( 'pickup_location_pickup_locations', [] );
    			$pickup_location  = $pickup_locations[ $chosen_method_instance ] ?? [];
    
    			if ( isset( $pickup_location['address'], $pickup_location['address']['country'] ) && ! empty( $pickup_location['address']['country'] ) ) {
    				$address = array(
    					$pickup_locations[ $chosen_method_instance ]['address']['country'],