WooCommerce Visual Hook Guide Single Product Page (Simple and Variable Products)

Welcome to my Woocommerce visual hook guide for the single product page. With this guide you can get a visual understanding where each hook is located so that you can add custom functions with greater ease.To use this Woocommerce visual hook guide for the single product page simply locate the location that you need to use, copy the hook and paste it into your custom function. The functions with the toggle will allow you to expand to see further additional hooks for that location.To use simply follow this simple procedure. In your functions.php file (or functions plugin) and enter the code as follows: “add_action(‘place-hook-here’,’your-PHP-function-here’);” and then place it exactly where you want it to be. How easy it that?

WooCommerce Visual Hook Guide Single Product Page

add_action( 'woocommerce_before_single_product', 'wc_print_notices', 10 );
add_action( 'woocommerce_before_single_product_summary', 'woocommerce_show_product_sale_flash', 10 ); add_action( 'woocommerce_before_single_product_summary', 'woocommerce_show_product_images', 20 );

SALE!

add_action( 'woocommerce_product_thumbnails', 'woocommerce_show_product_thumbnails', 20 );
add_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_title', 5 ); add_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_rating', 10 ); add_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_price', 10 ); add_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_excerpt', 20 ); add_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30 ); add_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_meta', 40 ); add_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_sharing', 50 );

Product Title

$937.99 – $985.50 $ 889.99 – $899.99

This is the short description

woocommerce_before_add_to_cart_form

woocommerce_before_variations_form

Select
Clear selection

woocommerce_before_add_to_cart_button

woocommerce_before_single_variation

woocommerce_single_variation

$937.99  $ 889.99

In Stock

 

woocommerce_after_single_variation

woocommerce_after_add_to_cart_button

woocommerce_after_variations_form

woocommerce_after_add_to_cart_form

woocommerce_product_meta_end

woocommerce_product_meta_end

woocommerce_product_meta_end

woocommerce_share

woocommerce_after_single_product_summary

Product description.

Weight1.35 kg
Dimensions25.3 x 4.2 x 16.3 cm
OptionOption 1, Option 2

You may also like…

Test product

$5.50

woocommerce_after_single_product

Default add_actions for Woocommerce Single Product Page

//The following actions are able to be unhooked or removed add_action( 'woocommerce_before_single_product', 'wc_print_notices', 10 ); add_action( 'woocommerce_before_single_product_summary', 'woocommerce_show_product_sale_flash', 10 ); add_action( 'woocommerce_before_single_product_summary', 'woocommerce_show_product_images', 20 ); add_action( 'woocommerce_product_thumbnails', 'woocommerce_show_product_thumbnails', 20 ); add_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_title', 5 ); add_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_rating', 10 ); add_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_price', 10 ); add_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_excerpt', 20 ); add_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_meta', 40 ); add_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_sharing', 50 ); add_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30 ); add_action( 'woocommerce_simple_add_to_cart', 'woocommerce_simple_add_to_cart', 30 ); add_action( 'woocommerce_grouped_add_to_cart', 'woocommerce_grouped_add_to_cart', 30 ); add_action( 'woocommerce_variable_add_to_cart', 'woocommerce_variable_add_to_cart', 30 ); add_action( 'woocommerce_external_add_to_cart', 'woocommerce_external_add_to_cart', 30 ); add_action( 'woocommerce_single_variation', 'woocommerce_single_variation', 10 ); add_action( 'woocommerce_single_variation', 'woocommerce_single_variation_add_to_cart_button', 20 ); add_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_product_data_tabs', 10 ); add_action( 'woocommerce_after_single_product_summary', 'woocommerce_upsell_display', 15 ); add_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 20 ); add_action( 'woocommerce_review_before', 'woocommerce_review_display_gravatar', 10 ); add_action( 'woocommerce_review_before_comment_meta', 'woocommerce_review_display_rating', 10 ); add_action( 'woocommerce_review_meta', 'woocommerce_review_display_meta', 10 ); add_action( 'woocommerce_review_comment_text', 'woocommerce_review_display_comment_text', 10 );

Where to add this code?

As with most other snippets, you use these hooks with your custom snippets at the end of the theme functions.php file before the closing ?> (if your file has it), or a functions plugin. These hooks will allow you to more precisely place the snippets so that they appear exactly where you want them to. Should you need to style the outputted code place any custom CSS in your themes CSS file, a CSS plugin or the CSS of your child theme.

Do they still work?

Please leave a comment below if you find that one of the hooks no longer works. With each update to Woocommerce there is a chance that something will change that can result  in a hook no longer being part of the page.

Written by John Cook
I've been using WordPress for over 6 years and Woocommerce for over 4 years. In that time I have explored the depths of customizations and helped many online retailers grow and expand their business using the Woocommerce selling platform. My aim here is to help enable Woo users around the globe get even more out of their e-commerce platform of choice.