Automattic\WooCommerce\Blocks\Shipping

ShippingController::force_shipping_enabled()publicWC 1.0

Force shipping to be enabled if the Checkout block is in use on the Checkout page.

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

Хуков нет.

Возвращает

true|false. Whether shipping should continue to be enabled/disabled.

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

$ShippingController = new ShippingController();
$ShippingController->force_shipping_enabled( $enabled );
$enabled(true|false) (обязательный)
Whether shipping is currently enabled.

Код ShippingController::force_shipping_enabled() WC 7.7.2

public function force_shipping_enabled( $enabled ) {
	if ( CartCheckoutUtils::is_checkout_block_default() ) {
		return true;
	}
	return $enabled;
}