Automattic\WooCommerce\Blocks\Shipping

ShippingController::remove_shipping_settingspublicWC 1.0

When using the cart and checkout blocks this method is used to adjust core shipping settings via a filter hook.

Метод класса: ShippingController{}

Хуков нет.

Возвращает

Массив|Разное. The filtered settings.

Использование

$ShippingController = new ShippingController();
$ShippingController->remove_shipping_settings( $settings );
$settings(массив) (обязательный)
The default WC shipping settings.

Код ShippingController::remove_shipping_settings() WC 10.4.3

public function remove_shipping_settings( $settings ) {
	if ( CartCheckoutUtils::is_cart_block_default() ) {
		foreach ( $settings as $index => $setting ) {
			if ( 'woocommerce_enable_shipping_calc' === $setting['id'] ) {
				$settings[ $index ]['desc_tip'] = sprintf(
				/* translators: %s: URL to the documentation. */
					__( 'This feature is not available when using the <a href="%s">Cart and checkout blocks</a>. Shipping will be calculated at checkout.', 'woocommerce' ),
					'https://woocommerce.com/document/woocommerce-store-editing/customizing-cart-and-checkout/'
				);
				$settings[ $index ]['disabled'] = true;
				$settings[ $index ]['value']    = 'no';
				break;
			}
		}
	}

	return $settings;
}