woocommerce_shipping_calculator_enable_state

woocommerce_shipping_calculator_enable_state

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

See hook in core

Displaying hooks found in version: woocommerce.9.5.1

apply_filters('woocommerce_shipping_calculator_enable_state') is found 2 times:

  • /includes/class-wc-cart.php line 1585
    			 * @since 8.4.0
    			 *
    			 * @param bool $show_state Whether to use the state field. Default true.
    			 */
    			$state_enabled  = apply_filters( 'woocommerce_shipping_calculator_enable_state', true );
    			$state_required = isset( $country_fields['shipping_state'] ) && $country_fields['shipping_state']['required'];
    			if ( $state_enabled && $state_required && ! $this->get_customer()->get_shipping_state() ) {
    				return false;
    			}
    			/**
    			 * Filter to not require shipping postcode for shipping calculation, even if it is required at checkout.
    
  • /templates/cart/shipping-calculator.php line 42
    				</select>
    			</p>
    		<?php endif; ?>
    
    		<?php if ( apply_filters( 'woocommerce_shipping_calculator_enable_state', true ) ) : ?>
    			<p class="form-row form-row-wide" id="calc_shipping_state_field">
    				<?php
    				$current_cc = WC()->customer->get_shipping_country();
    				$current_r  = WC()->customer->get_shipping_state();
    				$states     = WC()->countries->get_states( $current_cc );
    
    

Examples using woocommerce_shipping_calculator_enable_state