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.9.5

apply_filters('woocommerce_shipping_calculator_enable_state') is found 2 times:

  • /includes/class-wc-cart.php line 1658
    				 * @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'];
    				// Takes care of late unsetting of checkout fields via hooks (woocommerce_checkout_fields, woocommerce_shipping_fields).
    				$checkout_state_field_exists = isset( $checkout_fields['shipping']['shipping_state'] );
    				if ( $state_enabled && $state_required && ! $this->get_customer()->get_shipping_state() && $checkout_state_field_exists ) {
    					return false;
    				}
    
  • /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