[resolved] [Plugin: Woocommerce] Hook numbers (2 posts)

  1. Colin Young
    Posted 2 years ago #

    In the woocommerce hooks file I see lots of numbers mentioned after the add_action line, for example:

    add_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 20 );

    with the above example there are 3 numbers: 10 (woocommerce_output_product_data_tabs), 15 (woocommerce_upsell_display) and 20 (woocommerce_output_related_products)

    I thought if I only wanted to use one add_action I could include the number at the end of the do_action statement in my web page. For example:

    do_action( 'woocommerce_after_single_product_summary', 10 );

    The reason for this is because I want to split the woocommerce_after_single_product_summary to before and after some other content, like having 10, then some other content, then 20.

    Is this possible? I tried it and it didn't make any difference

  2. Colin Young
    Posted 2 years ago #

    It's ok, I've got it.

    Instead of calling the hook I just called the function related to the part of the hook I wanted

Topic Closed

This topic has been closed to new replies.

About this Topic