Automattic\WooCommerce\Blocks\Shipping
ShippingController::remove_shipping_settings()
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() ShippingController::remove shipping settings WC 9.3.1
public function remove_shipping_settings( $settings ) { if ( CartCheckoutUtils::is_checkout_block_default() && $this->local_pickup_enabled ) { foreach ( $settings as $index => $setting ) { if ( 'woocommerce_shipping_cost_requires_address' === $setting['id'] ) { $settings[ $index ]['desc'] = sprintf( /* translators: %s: URL to the documentation. */ __( 'Hide shipping costs until an address is entered (Not available when using the <a href="%s">Local pickup options powered by the Checkout block</a>)', 'woocommerce' ), 'https://woocommerce.com/document/woocommerce-blocks-local-pickup/' ); $settings[ $index ]['disabled'] = true; $settings[ $index ]['value'] = 'no'; break; } } } return $settings; }