WordPress filter hook
woocommerce_cart_needs_shipping
Defined by WooCommerce and fired by 40 plugins in total, running on 7.1M+ sites between them.
“Hooks”
How to use woocommerce_cart_needs_shipping
It's a filter: your callback receives the value, and must return the (changed) value.
Add this to your theme's functions.php or a small custom plugin:
add_filter( 'woocommerce_cart_needs_shipping', function( $needs_shipping ) {
// Change $needs_shipping here.
return $needs_shipping;
}, 10, 1 );Argument names come from WooCommerce's source. Other plugins may pass different values: check the call in the plugin you're targeting below.
40 plugins that fire woocommerce_cart_needs_shipping
Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.
-
WooCommerce7+ million installs
apply_filters( 'woocommerce_cart_needs_shipping', $needs_shipping )includes/class-wc-cart.php:1869 -
Booster for WooCommerce30,000+ installs
apply_filters( 'woocommerce_cart_needs_shipping', $needs_shipping )includes/class-wcj-payment-gateways-by-shipping.php:98 -
Custom Payment Gateways for WooCommerce8,000+ installs
apply_filters( 'woocommerce_cart_needs_shipping', $needs_shipping )includes/class-wc-gateway-alg-custom-template.php:227 -
Cash On Pickup for WooCommerce7,000+ installs
apply_filters( 'woocommerce_cart_needs_shipping', $needs_shipping )classes/class.wc-cop.php:475 -
GoDaddy Payments for WooCommerce3,000+ installs
apply_filters( 'woocommerce_cart_needs_shipping', true )src/Gateways/PayInPersonGateway.php:609 -
Invoice Payment Gateway for WooCommerce2,000+ installs
apply_filters( 'woocommerce_cart_needs_shipping', $needs_shipping )includes/class-wc-invoice-gateway.php:256 -
Pay in Store WooCommerce Payment Gateway2,000+ installs
apply_filters( 'woocommerce_cart_needs_shipping', $needs_shipping )classes/WC_Gateway_PayInStore.php:140 -
Invoice Gateway for WooCommerce2,000+ installs
apply_filters( 'woocommerce_cart_needs_shipping', $needs_shipping )Models/Gateways/IGFW_Invoice_Gateway.php:289 -
BLAZING Email Transfer Payment Gateway2,000+ installs
apply_filters( 'woocommerce_cart_needs_shipping', $needs_shipping )class-betpg-email-transfer-gateway.php:234 -
BjornTech Swish for WooCommerce2,000+ installs
apply_filters( 'woocommerce_cart_needs_shipping', $needs_shipping )classes/woo-swish-payment-gateway.php:2978 -
Novalnet Payment Gateway for WooCommerce1,000+ installs
apply_filters( 'woocommerce_cart_needs_shipping', $needs_shipping )includes/class-wc-novalnet-validation.php:216 -
CloudPayments Gateway for WooCommerce500+ installs
apply_filters( 'woocommerce_cart_needs_shipping', $needs_shipping )inc/wc-cloud-payments-gateway.php:1081 -
Payment Gateways by Shipping for WooCommerce400+ installs
apply_filters( 'woocommerce_cart_needs_shipping', $needs_shipping )includes/class-alg-wc-pgbsm-core.php:165 -
Payment gateway200+ installs
apply_filters( 'woocommerce_cart_needs_shipping', $needs_shipping )includes/class-wc-robokassa-method.php:2691 -
B2B Invoice Payment Method for WooCommerce100+ installs
apply_filters( 'woocommerce_cart_needs_shipping', $needs_shipping )Controller/Gateways/IPGW_Invoice_Gateway.php:294 -
PayPal Checkout Payment for WooCommerce in Japan100+ installs
apply_filters( 'woocommerce_cart_needs_shipping', $needs_shipping )includes/class-wc-gateway-ppec-plugin.php:477 -
WooPOS Gift Cards for WooCommerce80+ installs
apply_filters( 'woocommerce_cart_needs_shipping', $needs_shipping )includes/features/isc/isc-class.php:151 -
Paiement par Carte DAHABIA et Carte CIB for WooCommerce70+ installs
apply_filters( 'woocommerce_cart_needs_shipping', $needs_shipping )includes/class-wc-satimipay-gateway.php:540 -
Cash on Delivery of Russian Post or EMS For WooCommerce70+ installs
apply_filters( 'woocommerce_cart_needs_shipping', $needs_shipping )cod-payment-gateway-russian-post.php:158 -
CdekPay60+ installs
apply_filters( 'woocommerce_cart_needs_shipping', $needs_shipping )includes/class-wc-cdekpay-gateway.php:393 -
Credit Online Smart by BT Direct50+ installs
apply_filters( 'woocommerce_cart_needs_shipping', $needs_shipping )src/XFactor_Gateway_Krunity.php:887 -
TipTopPay Gateway for WooCommerce40+ installs
apply_filters( 'woocommerce_cart_needs_shipping', $needs_shipping )inc/wc-tiptoppay-gateway.php:891 -
PAK Custom Payment Gateways for WooCommerce40+ installs
apply_filters( 'woocommerce_cart_needs_shipping', $is_shipping_needed )src/GatewayProcessor.php:279 -
All BD Mobile Payments Gateway30+ installs
apply_filters( 'woocommerce_cart_needs_shipping', $needs_shipping )gateways/bKash.php:156 -
Payment Gateway for Sparco on WooCommerce20+ installs
apply_filters( 'woocommerce_cart_needs_shipping', $needs_shipping )includes/class-wc-sparco-payment-gateway.php:238 -
Wallet & Store Credit for WooCommerce20+ installs
apply_filters( 'woocommerce_cart_needs_shipping', $needs_shipping )includes/wallet-gateway.php:167 -
xMoney Payments20+ installs
apply_filters( 'woocommerce_cart_needs_shipping', $needs_shipping )includes/class-xmoney-payments-gateway.php:260 -
BD Mobile Payments Gateway10+ installs
apply_filters( 'woocommerce_cart_needs_shipping', $needs_shipping )includes/gateways/bkash/class-wc-gateway-bKash.php:155 -
wp-shkeeper-plugin10+ installs
apply_filters( 'woocommerce_cart_needs_shipping', $needs_shipping )includes/class-wc-payment-gateway-shkeeper.php:163 -
Qonnex Finance spread payment option for WooCommerce10+ installs
apply_filters( 'woocommerce_cart_needs_shipping', $needs_shipping )woocommerce-gateway-gespreid-betalen.php:100 -
Subscriptions & Recurring Payments for WooCommerce10+ installs
apply_filters( 'woocommerce_cart_needs_shipping', $needs_shipping )inc/payment-methods/awc-paypal/inc_files/class-awc-paypal-payment-methods-for-subscription.php:449 -
Hoovi BNPL10+ installs
apply_filters( 'woocommerce_cart_needs_shipping', $needs_shipping )src/Gateway.php:329 -
PnP (Pick and Pay) Payment Gateway For Woocommerce10+ installs
apply_filters( 'woocommerce_cart_needs_shipping', $needs_shipping )pnp.php:146 -
Gateway Payougo Checkout10+ installs
apply_filters( 'woocommerce_cart_needs_shipping', $needs_shipping )includes/class-wc-gateway-pyg-plugin.php:460 -
Pay by Cash for Woocommerce10+ installs
apply_filters( 'woocommerce_cart_needs_shipping', $needs_shipping )class-wc-gateway-pay-by-cash.php:121 -
Invoice Payment10+ installs
apply_filters( 'woocommerce_cart_needs_shipping', $needs_shipping )includes/Handlers/PaymentGateway.php:315 -
Collect Payment Gateway Plugin for WooCommerce10+ installs
apply_filters( 'woocommerce_cart_needs_shipping', $needs_shipping )includes/class-wc-gateway-collect.php:354 -
TonderFewer than 10 installs
apply_filters( 'woocommerce_cart_needs_shipping', $needs_shipping )zplit-payment-for-woocommerce.php:159 -
Buy Now Pay Later for WooCommerceFewer than 10 installs
apply_filters( 'woocommerce_cart_needs_shipping', $needs_shipping )includes/postpaid.php:265 -
E-Transfer GatewayFewer than 10 installs
apply_filters( 'woocommerce_cart_needs_shipping', $needs_shipping )gateway-interac.php:162
Need a customisation built on this hook?
Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.