• Resolved mehdiwac1994

    (@mehdiwac1994)


    i want add button in this block
    </p>
    i find this block appreas by this hook show image
    </p>
    how to add the button in this hook ?

    i used theme woodmart

    • This topic was modified 5 years, 2 months ago by mehdiwac1994.
    • This topic was modified 5 years, 2 months ago by mehdiwac1994.
    • This topic was modified 5 years, 2 months ago by mehdiwac1994.

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • This is the framework:

    add_filter( 'woocommerce_before_shop_loop_item_title', 'custom_button', 20 );
    function custom_button() {
      print '<button>My button</button>';
    }

    Sorry, not tested.

    However, I think you need to hook a bit later in the code to get to the location you want. In the core WooCommerce plugin, you would use:
    add_filter( 'woocommerce_single_product_summary', 'custom_button', 35 );
    (Priority 30 is the ‘Select Options’ button)

    Thread Starter mehdiwac1994

    (@mehdiwac1994)

    the code is work

    but i want display button in hover On product i want display button Under the button “LIRE LA SUITE”

    The new button is not where you wanted it. You will need to find the right hook.

    Try:
    add_filter( 'woocommerce_single_product_summary', 'custom_button', 35 );

    I don’t know if that will work because your theme hooks may vary from the standard WooCommerce hooks.

    Look for:
    ‘woocommerce_template_single_add_to_cart’, and your custom hook will go in with a slightly higher priority.

    Getting it to show on product hover will need some custom css, but that would be development work which you are unlikely to get through a forum answer.

    Thread Starter mehdiwac1994

    (@mehdiwac1994)

    Thanks you Bro @lorro FOR YOUR SUPPOR I have found that HOOK RESPONSABLE ON DISPLAY IN HOVER

    THANKS

    • This reply was modified 5 years, 2 months ago by mehdiwac1994.
    • This reply was modified 5 years, 2 months ago by mehdiwac1994.
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘add button with hook’ is closed to new replies.