WordPress action hook

woocommerce_before_single_product

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

“WooCommerce single product hooks.”

How to use woocommerce_before_single_product

It's an action: your callback runs at that point and receives 1 argument. Nothing needs to be returned. Add this to your theme's functions.php or a small custom plugin:

functions.php
add_action( 'woocommerce_before_single_product', function( $product_id ) {
	// Your code runs here.
}, 10, 1 );

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

58 plugins that fire woocommerce_before_single_product

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

  1. WooCommerce icon WooCommerce7+ million installs do_action( 'woocommerce_before_single_product' ) templates/content-single-product.php:27
  2. Royal Addons for Elementor icon Royal Addons for Elementor600,000+ installs do_action( 'woocommerce_before_single_product' ) modules/theme-builder/woocommerce/product-add-to-cart/widgets/wpr-product-add-to-cart.php:2109
  3. ShopEngine icon ShopEngine90,000+ installs do_action( 'woocommerce_before_single_product' ) core/page-templates/hooks/single.php:36
  4. ShopLentor icon ShopLentor80,000+ installs do_action( 'woocommerce_before_single_product' ) wl-woo-templates/single-product.php:29
  5. Xpro Addons icon Xpro Addons40,000+ installs do_action( 'woocommerce_before_single_product', $product_id ) classes/class-ajax-handler.php:735
  6. Simple Membership icon Simple Membership40,000+ installs do_action( 'woocommerce_before_single_product' ) views/template-overrides/woocommerce/content-single-product.php:27
  7. Extra Product Options For WooCommerce icon Extra Product Options For WooCommerce30,000+ installs do_action( 'woocommerce_before_single_product' ) public/class-thwepof-public.php:374
  8. Thim Elementor Kit icon Thim Elementor Kit20,000+ installs do_action( 'woocommerce_before_single_product' ) inc/modules/single-product/class-init.php:105
  9. LA-Studio Element Kit for Elementor icon LA-Studio Element Kit for Elementor10,000+ installs do_action( 'woocommerce_before_single_product' ) includes/modules/woocommerce/documents/product.php:87
  10. Genesis Connect for WooCommerce icon Genesis Connect for WooCommerce10,000+ installs do_action( 'woocommerce_before_single_product' ) templates/single-product.php:55
  11. Event Booking Manager for WooCommerce icon Event Booking Manager for WooCommerce6,000+ installs do_action( 'woocommerce_before_single_product' ) templates/single-events.php:103
  12. Spexo Addons for Elementor icon Spexo Addons for Elementor6,000+ installs do_action( 'woocommerce_before_single_product' ) inc/widgets/woo-add-to-cart.php:2951
  13. Ibtana icon Ibtana5,000+ installs do_action( 'woocommerce_before_single_product' ) inc/tpl/iepa-single-product.php:5
  14. WowStore icon WowStore4,000+ installs do_action( 'woocommerce_before_single_product' ) addons/builder/templates/page.php:84
  15. Ultimate Store Kit icon Ultimate Store Kit3,000+ installs do_action( 'woocommerce_before_single_product' ) includes/builder/templates/woocommerce/edit-address.php:32
  16. Kadence for WooCommerce and Elementor icon Kadence for WooCommerce and Elementor3,000+ installs do_action( 'woocommerce_before_single_product' ) templates/product-elementor.php:29
  17. Responsive Addons for Elementor icon Responsive Addons for Elementor3,000+ installs do_action( 'woocommerce_before_single_product' ) includes/modules-manager/theme-builder/templates/woocommerce/single-product.php:28
  18. The Pack Elementor addon icon The Pack Elementor addon2,000+ installs do_action( 'woocommerce_before_single_product' ) includes/header-footer/includes/modules/woocommerce/documents/product.php:129
  19. E-cab Taxi Booking Manager for Woocommerce icon E-cab Taxi Booking Manager for Woocommerce2,000+ installs do_action( 'woocommerce_before_single_product' ) templates/single_page/mptbm_details.php:39
  20. WC Builder icon WC Builder1,000+ installs do_action( 'woocommerce_before_single_product' ) woo-templates/content-single-product.php:27
  21. Travelly icon Travelly1,000+ installs do_action( 'woocommerce_before_single_product' ) templates/single_page/single-ttbm.php:51
  22. Booking and Rental Manager for Bike icon Booking and Rental Manager for Bike1,000+ installs do_action( 'woocommerce_before_single_product' ) inc/rbfw_shortcodes.php:680
  23. Catalog Booster & Product Catalog Mode for WooCommerce icon Catalog Booster & Product Catalog Mode for WooCommerce1,000+ installs do_action( 'woocommerce_before_single_product' ) includes/woocat_cart.php:56
  24. Bus Ticket Booking with Seat Reservation icon Bus Ticket Booking with Seat Reservation700+ installs do_action( 'woocommerce_before_single_product' ) inc/WBTM_Event_Shortcodes.php:89
  25. ShopPress icon ShopPress600+ installs do_action( 'woocommerce_before_single_product' ) public/templates/editor-single-product.php:19
  26. ST Elementor Addons icon ST Elementor Addons500+ installs do_action( 'woocommerce_before_single_product' ) theme-builder/includes/modules-manager/theme-builder/templates/woocommerce/single-product.php:28
  27. STAGGS icon STAGGS400+ installs do_action( 'woocommerce_before_single_product' ) public/templates/inline/template-classic.php:35
  28. StoreBuild icon StoreBuild400+ installs do_action( 'woocommerce_before_single_product' ) public/woocommerce/content-single-product.php:27
  29. Noah Shop Builder for WooCommerce icon Noah Shop Builder for WooCommerce400+ installs do_action( 'woocommerce_before_single_product' ) includes/Templates/Types/SingleProduct.php:71
  30. CRT Addons Builder and Widgets for Elementor icon CRT Addons Builder and Widgets for Elementor300+ installs do_action( 'woocommerce_before_single_product' ) includes/customizer/addons/modules/woocommerce/crt-product-add-to-cart.php:2104
  31. Appointment Booking Plugin for WooCommerce icon Appointment Booking Plugin for WooCommerce200+ installs do_action( 'woocommerce_before_single_product' ) templates/single_page/mpwpb_details.php:61
  32. Shopready icon Shopready100+ installs do_action( 'woocommerce_before_single_product' ) src/extension/templates/presets/product/content-one.php:27
  33. ShopMaker icon ShopMaker90+ installs do_action( 'woocommerce_before_single_product' ) templates/sm-redirect/content-single-product.php:27
  34. Pronto icon Pronto80+ installs do_action( 'woocommerce_before_single_product' ) theme/single-product.php:28
  35. Pizza builder for WooCommerce icon Pizza builder for WooCommerce30+ installs do_action( 'woocommerce_before_single_product' ) templates/pizza/quick-view.php:25
  36. Reactor: Core icon Reactor: Core30+ installs do_action( 'woocommerce_before_single_product' ) inc/api/v1/templates/woo/add-to-cart.php:105
  37. Nekto Core icon Nekto Core30+ installs do_action( 'woocommerce_before_single_product' ) woocommerce/content-single-product.php:33
  38. ShopCred icon ShopCred30+ installs do_action( 'woocommerce_before_single_product' ) includes/builder/page.php:36
  39. Educat Elementor LMS Addon icon Educat Elementor LMS Addon20+ installs do_action( 'woocommerce_before_single_product' ) admin/theme-builder/includes/modules/woocommerce/documents/product.php:129
  40. Seraphinite Bulk Discounts for WooCommerce icon Seraphinite Bulk Discounts for WooCommerce20+ installs do_action( 'woocommerce_before_single_product' ) main.php:59
  41. Elite Elementor Addons and Widgets icon Elite Elementor Addons and Widgets20+ installs do_action( 'woocommerce_before_single_product' ) modules/theme-builder/woocommerce/product-add-to-cart/widgets/elite-product-add-to-cart.php:2109
  42. Themofy Addons for Elementor icon Themofy Addons for Elementor10+ installs do_action( 'woocommerce_before_single_product' ) modules/theme-builder/includes/class-locations.php:927
  43. Custom Builder for Elementor and WooCommerce icon Custom Builder for Elementor and WooCommerce10+ installs do_action( 'woocommerce_before_single_product' ) templates/woocommerce/content-single-product.php:41
  44. Onex Custom Woo Builder icon Onex Custom Woo Builder10+ installs do_action( 'woocommerce_before_single_product' ) templates/woocommerce/content-single-product.php:41
  45. Comparis icon Comparis10+ installs do_action( 'woocommerce_before_single_product' ) templates/woocommerce/content-single-product.php:21
  46. NoorPDP icon NoorPDP10+ installs do_action( 'woocommerce_before_single_product' ) templates/single-product-layout.php:31
  47. WEBD Woo Event Bookings icon WEBD Woo Event BookingsFewer than 10 installs do_action( 'woocommerce_before_single_product' ) templates/content-single-product.php:30
  48. UnikForce Elementor WooCommerce Builder icon UnikForce Elementor WooCommerce BuilderFewer than 10 installs do_action( 'woocommerce_before_single_product' ) woo-templates/single-product.php:29
  49. Single Page Shopping icon Single Page ShoppingFewer than 10 installs do_action( 'woocommerce_before_single_product' ) templates/single-product-override/content-single-product.php:18
  50. CardGrid for WooCommerce icon CardGrid for WooCommerceFewer than 10 installs do_action( 'woocommerce_before_single_product' ) templates/engine-wrapper.php:79
  51. ShopGlut icon ShopGlutFewer than 10 installs do_action( 'woocommerce_before_single_product' ) modules/product-page/frontend/class-shopglut-product-page.php:240
  52. Preloader Studio icon Preloader StudioFewer than 10 installs do_action( 'woocommerce_before_single_product' ) templates/single-product.php:30
  53. DestinX Product Configurator for WooCommerce icon DestinX Product Configurator for WooCommerceFewer than 10 installs do_action( 'woocommerce_before_single_product' ) woocommerce/content-single-product.php:7
  54. Zadex Page Builder icon Zadex Page BuilderFewer than 10 installs do_action( 'woocommerce_before_single_product' ) includes/WooCommerce/WooCommerce.php:224
  55. SingleGrid PDP Builder for WooCommerce icon SingleGrid PDP Builder for WooCommerceFewer than 10 installs do_action( 'woocommerce_before_single_product' ) includes/templates/single-product-template.php:44
  56. Polanger Dating for WordPress icon Polanger Dating for WordPressFewer than 10 installs do_action( 'woocommerce_before_single_product' ) templates/integrations/woocommerce/single-product.php:20
  57. Xcodesol Shop Builder icon Xcodesol Shop BuilderFewer than 10 installs do_action( 'woocommerce_before_single_product' ) renderers/single-product.php:29
  58. Asuka Product Designer icon Asuka Product DesignerFewer than 10 installs do_action( 'woocommerce_before_single_product' ) templates/frontend/woocommerce-product-full-width.php:27

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.