WordPress filter hook

woocommerce_is_purchasable

Defined by WooCommerce and fired by 29 plugins in total, running on 7.1M+ sites between them.

“Filters whether a product is purchasable.”

How to use woocommerce_is_purchasable

It's a filter: your callback receives the value and 1 more argument, and must return the (changed) value. Add this to your theme's functions.php or a small custom plugin:

functions.php
add_filter( 'woocommerce_is_purchasable', function( $purchasable, $object ) {
	// Change $purchasable here.
	return $purchasable;
}, 10, 2 );

Argument names come from YITH WooCommerce Gift Cards's source. Other plugins may pass different values: check the call in the plugin you're targeting below.

29 plugins that fire woocommerce_is_purchasable

Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.

  1. WooCommerce icon WooCommerce7+ million installs apply_filters( 'woocommerce_is_purchasable', $this->exists() && $this->is_viewable() && '' !== $this->get_price(), $this ) includes/abstracts/abstract-wc-product.php:1875
  2. FunnelKit icon FunnelKit30,000+ installs apply_filters( 'woocommerce_is_purchasable', $variation->exists() && ( 'publish' === $own_status || current_user_can( 'edit_post', $id ) ) && $has_price, $variation ) modules/bundles/includes/products/repository.php:1202
  3. YITH WooCommerce Gift Cards icon YITH WooCommerce Gift Cards10,000+ installs apply_filters( 'woocommerce_is_purchasable', $purchasable, $this ) includes/class-yith-wc-product-gift-card.php:106
  4. Product Bundle Builder for WooCommerce icon Product Bundle Builder for WooCommerce6,000+ installs apply_filters( 'woocommerce_is_purchasable', $this->exists() && ( 'publish' === $this->get_status() || current_user_can( 'edit_post', $this->get_id() ) ), $this ) src/ProductBundle.php:711
  5. WPS Bookings for WooCommerce icon WPS Bookings for WooCommerce3,000+ installs apply_filters( 'woocommerce_is_purchasable', true, $this ) includes/class-wc-product-mwb-booking.php:79
  6. YITH WooCommerce Product Bundles icon YITH WooCommerce Product Bundles3,000+ installs apply_filters( 'woocommerce_is_purchasable', $purchasable, $this ) includes/objects/class.yith-wc-product-bundle.php:111
  7. Subscriptions for WooCommerce Recurring Payments with Membership Content Restriction icon Subscriptions for WooCommerce Recurring Payments with Membership Content Restriction700+ installs apply_filters( 'woocommerce_is_purchasable', $purchasable, $this ) src/Features/SubscriptionBox/Services/ProductType.php:57
  8. GIFT4U icon GIFT4U200+ installs apply_filters( 'woocommerce_is_purchasable', $this->exists() && ( 'publish' === $this->get_status() || current_user_can( 'edit_post', $this->get_id() ) ) && $price_cond, $this ) inc/classes/g4u-product-giftcard.php:27
  9. Salevo Boost Sales for WooCommerce icon Salevo Boost Sales for WooCommerce200+ installs apply_filters( 'woocommerce_is_purchasable', $purchasable, $this ) includes/wbs_product_bundle.php:108
  10. Store credit / Gift cards for woocommerce icon Store credit / Gift cards for woocommerce100+ installs apply_filters( 'woocommerce_is_purchasable', $this->exists() && ( 'publish' === $this->get_status() || current_user_can( 'edit_post', $this->get_id() ) ), $this ) admin/class-store-credit-product.php:34
  11. BundleBoss icon BundleBoss80+ installs apply_filters( 'woocommerce_is_purchasable', $purchasable, $this ) includes/class-bundle-boss-product-bundle.php:905
  12. Stachethemes Seat Planner Lite icon Stachethemes Seat Planner Lite60+ installs apply_filters( 'woocommerce_is_purchasable', $condition, $this ) includes/woocommerce/product/class.auditorium-product.php:43
  13. Leat icon Leat30+ installs apply_filters( 'woocommerce_is_purchasable', $purchasable, $this ) src/Infrastructure/WooCommerce/GiftcardProduct.php:145
  14. Wallet Ready Gift Cards for WooCommerce by GiftRocketWP icon Wallet Ready Gift Cards for WooCommerce by GiftRocketWP30+ installs apply_filters( 'woocommerce_is_purchasable', $purchasable, $this ) backend/class-wc-product-wxgiftcard.php:78
  15. Presentero icon Presentero30+ installs apply_filters( 'woocommerce_is_purchasable', $purchasable, $this ) includes/class-presentero-gc-product-gift-card.php:75
  16. BookingHive icon BookingHive10+ installs apply_filters( 'woocommerce_is_purchasable', $this->exists() && 'publish' === $this->get_status(), $this ) src/Modules/Addons/Hooks/Admin/Product/AddonProduct.php:96
  17. MaxtDesign Product Bundles icon MaxtDesign Product Bundles10+ installs apply_filters( 'woocommerce_is_purchasable', $this->md_bnd_purchasable_memo, $this ) src/Product/WC_Product_Bundle.php:176
  18. Beacon Bookings icon Beacon Bookings10+ installs apply_filters( 'woocommerce_is_purchasable', $ok, $this ) includes/class-product.php:75
  19. QODE Product Bundles for WooCommerce icon QODE Product Bundles for WooCommerce10+ installs apply_filters( 'woocommerce_is_purchasable', $purchasable, $this ) inc/bundle-product/woocommerce/class-wc-product-qode-bundle-product.php:128
  20. Codeholt Bundles for WooCommerce icon Codeholt Bundles for WooCommerceFewer than 10 installs apply_filters( 'woocommerce_is_purchasable', $purchasable, $this ) includes/class-cbfw-product-bundle.php:137
  21. Comet LevelUp for WooCommerce icon Comet LevelUp for WooCommerceFewer than 10 installs apply_filters( 'woocommerce_is_purchasable', true ) includes/LiveTests/test_catalog_mode.php:28
  22. Giftlark icon GiftlarkFewer than 10 installs apply_filters( 'woocommerce_is_purchasable', $ok, $this ) includes/class-gvgc-product-gift-card.php:55
  23. BrainlessITC Gift Cards for WooCommerce icon BrainlessITC Gift Cards for WooCommerceFewer than 10 installs apply_filters( 'woocommerce_is_purchasable', $purchasable, $this ) src/Product/GiftCardProduct.php:101
  24. Recuriva icon RecurivaFewer than 10 installs apply_filters( 'woocommerce_is_purchasable', $purchasable, $this ) packages/core/src/Integrations/WooCommerce/SubscriptionProduct.php:62
  25. RT Auction Product for WooCommerce icon RT Auction Product for WooCommerceFewer than 10 installs apply_filters( 'woocommerce_is_purchasable', $ok, $this ) models/class-rtapw-auction-product.php:18
  26. The Yeti Dev Bookings Lite icon The Yeti Dev Bookings LiteFewer than 10 installs apply_filters( 'woocommerce_is_purchasable', $this->exists() && 'publish' === $this->get_status(), $this ) includes/class-tydb-product.php:21
  27. SlotNova Booking for WooCommerce icon SlotNova Booking for WooCommerceFewer than 10 installs apply_filters( 'woocommerce_is_purchasable', true, $this ) includes/class-wc-product-slotnova.php:68
  28. Book’d by WooNinjas icon Book’d by WooNinjasFewer than 10 installs apply_filters( 'woocommerce_is_purchasable', $purchasable, $this ) includes/product.php:82
  29. OWH Domain WHOIS RDAP icon OWH Domain WHOIS RDAPFewer than 10 installs apply_filters( 'woocommerce_is_purchasable', $purchasable, $this ) includes/class-wc-product-domain.php:279

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.