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:
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.
-
WooCommerce7+ million installs
do_action( 'woocommerce_before_single_product' )templates/content-single-product.php:27 -
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 -
ShopEngine90,000+ installs
do_action( 'woocommerce_before_single_product' )core/page-templates/hooks/single.php:36 -
ShopLentor80,000+ installs
do_action( 'woocommerce_before_single_product' )wl-woo-templates/single-product.php:29 -
Xpro Addons40,000+ installs
do_action( 'woocommerce_before_single_product', $product_id )classes/class-ajax-handler.php:735 -
Simple Membership40,000+ installs
do_action( 'woocommerce_before_single_product' )views/template-overrides/woocommerce/content-single-product.php:27 -
Extra Product Options For WooCommerce30,000+ installs
do_action( 'woocommerce_before_single_product' )public/class-thwepof-public.php:374 -
Thim Elementor Kit20,000+ installs
do_action( 'woocommerce_before_single_product' )inc/modules/single-product/class-init.php:105 -
LA-Studio Element Kit for Elementor10,000+ installs
do_action( 'woocommerce_before_single_product' )includes/modules/woocommerce/documents/product.php:87 -
Genesis Connect for WooCommerce10,000+ installs
do_action( 'woocommerce_before_single_product' )templates/single-product.php:55 -
Event Booking Manager for WooCommerce6,000+ installs
do_action( 'woocommerce_before_single_product' )templates/single-events.php:103 -
Spexo Addons for Elementor6,000+ installs
do_action( 'woocommerce_before_single_product' )inc/widgets/woo-add-to-cart.php:2951 -
Ibtana5,000+ installs
do_action( 'woocommerce_before_single_product' )inc/tpl/iepa-single-product.php:5 -
WowStore4,000+ installs
do_action( 'woocommerce_before_single_product' )addons/builder/templates/page.php:84 -
Ultimate Store Kit3,000+ installs
do_action( 'woocommerce_before_single_product' )includes/builder/templates/woocommerce/edit-address.php:32 -
Kadence for WooCommerce and Elementor3,000+ installs
do_action( 'woocommerce_before_single_product' )templates/product-elementor.php:29 -
Responsive Addons for Elementor3,000+ installs
do_action( 'woocommerce_before_single_product' )includes/modules-manager/theme-builder/templates/woocommerce/single-product.php:28 -
The Pack Elementor addon2,000+ installs
do_action( 'woocommerce_before_single_product' )includes/header-footer/includes/modules/woocommerce/documents/product.php:129 -
E-cab Taxi Booking Manager for Woocommerce2,000+ installs
do_action( 'woocommerce_before_single_product' )templates/single_page/mptbm_details.php:39 -
WC Builder1,000+ installs
do_action( 'woocommerce_before_single_product' )woo-templates/content-single-product.php:27 -
Travelly1,000+ installs
do_action( 'woocommerce_before_single_product' )templates/single_page/single-ttbm.php:51 -
Booking and Rental Manager for Bike1,000+ installs
do_action( 'woocommerce_before_single_product' )inc/rbfw_shortcodes.php:680 -
Catalog Booster & Product Catalog Mode for WooCommerce1,000+ installs
do_action( 'woocommerce_before_single_product' )includes/woocat_cart.php:56 -
Bus Ticket Booking with Seat Reservation700+ installs
do_action( 'woocommerce_before_single_product' )inc/WBTM_Event_Shortcodes.php:89 -
ShopPress600+ installs
do_action( 'woocommerce_before_single_product' )public/templates/editor-single-product.php:19 -
ST Elementor Addons500+ installs
do_action( 'woocommerce_before_single_product' )theme-builder/includes/modules-manager/theme-builder/templates/woocommerce/single-product.php:28 -
STAGGS400+ installs
do_action( 'woocommerce_before_single_product' )public/templates/inline/template-classic.php:35 -
StoreBuild400+ installs
do_action( 'woocommerce_before_single_product' )public/woocommerce/content-single-product.php:27 -
Noah Shop Builder for WooCommerce400+ installs
do_action( 'woocommerce_before_single_product' )includes/Templates/Types/SingleProduct.php:71 -
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 -
Appointment Booking Plugin for WooCommerce200+ installs
do_action( 'woocommerce_before_single_product' )templates/single_page/mpwpb_details.php:61 -
Shopready100+ installs
do_action( 'woocommerce_before_single_product' )src/extension/templates/presets/product/content-one.php:27 -
ShopMaker90+ installs
do_action( 'woocommerce_before_single_product' )templates/sm-redirect/content-single-product.php:27 -
Pronto80+ installs
do_action( 'woocommerce_before_single_product' )theme/single-product.php:28 -
Pizza builder for WooCommerce30+ installs
do_action( 'woocommerce_before_single_product' )templates/pizza/quick-view.php:25 -
Reactor: Core30+ installs
do_action( 'woocommerce_before_single_product' )inc/api/v1/templates/woo/add-to-cart.php:105 -
Nekto Core30+ installs
do_action( 'woocommerce_before_single_product' )woocommerce/content-single-product.php:33 -
ShopCred30+ installs
do_action( 'woocommerce_before_single_product' )includes/builder/page.php:36 -
Educat Elementor LMS Addon20+ installs
do_action( 'woocommerce_before_single_product' )admin/theme-builder/includes/modules/woocommerce/documents/product.php:129 -
Seraphinite Bulk Discounts for WooCommerce20+ installs
do_action( 'woocommerce_before_single_product' )main.php:59 -
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 -
Themofy Addons for Elementor10+ installs
do_action( 'woocommerce_before_single_product' )modules/theme-builder/includes/class-locations.php:927 -
Custom Builder for Elementor and WooCommerce10+ installs
do_action( 'woocommerce_before_single_product' )templates/woocommerce/content-single-product.php:41 -
Onex Custom Woo Builder10+ installs
do_action( 'woocommerce_before_single_product' )templates/woocommerce/content-single-product.php:41 -
Comparis10+ installs
do_action( 'woocommerce_before_single_product' )templates/woocommerce/content-single-product.php:21 -
NoorPDP10+ installs
do_action( 'woocommerce_before_single_product' )templates/single-product-layout.php:31 -
WEBD Woo Event BookingsFewer than 10 installs
do_action( 'woocommerce_before_single_product' )templates/content-single-product.php:30 -
UnikForce Elementor WooCommerce BuilderFewer than 10 installs
do_action( 'woocommerce_before_single_product' )woo-templates/single-product.php:29 -
Single Page ShoppingFewer than 10 installs
do_action( 'woocommerce_before_single_product' )templates/single-product-override/content-single-product.php:18 -
CardGrid for WooCommerceFewer than 10 installs
do_action( 'woocommerce_before_single_product' )templates/engine-wrapper.php:79 -
ShopGlutFewer than 10 installs
do_action( 'woocommerce_before_single_product' )modules/product-page/frontend/class-shopglut-product-page.php:240 -
Preloader StudioFewer than 10 installs
do_action( 'woocommerce_before_single_product' )templates/single-product.php:30 -
DestinX Product Configurator for WooCommerceFewer than 10 installs
do_action( 'woocommerce_before_single_product' )woocommerce/content-single-product.php:7 -
Zadex Page BuilderFewer than 10 installs
do_action( 'woocommerce_before_single_product' )includes/WooCommerce/WooCommerce.php:224 -
SingleGrid PDP Builder for WooCommerceFewer than 10 installs
do_action( 'woocommerce_before_single_product' )includes/templates/single-product-template.php:44 -
Polanger Dating for WordPressFewer than 10 installs
do_action( 'woocommerce_before_single_product' )templates/integrations/woocommerce/single-product.php:20 -
Xcodesol Shop BuilderFewer than 10 installs
do_action( 'woocommerce_before_single_product' )renderers/single-product.php:29 -
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.