admin管理员组

文章数量:1122832

can someone help me with this issue ? I want to add a button in my product page and name it (contact seller) and I want to link this button to the seller page. how can I do it ?

here is a screenshot for what i'm looking to achieve

can someone help me with this issue ? I want to add a button in my product page and name it (contact seller) and I want to link this button to the seller page. how can I do it ?

here is a screenshot for what i'm looking to achieve

Share Improve this question asked Jun 17, 2019 at 16:03 Ahmed HaibaAhmed Haiba 11 bronze badge
Add a comment  | 

1 Answer 1

Reset to default 0

You can use woocommerce_single_product_summary hook to add custom button in the single product page in WooCommerce. Please check following example. Custom link added and button class is given to display it like a button.

add_action( 'woocommerce_single_product_summary', 'wpso_add_seller_button', 15 );
function wpso_add_seller_button() {
    echo '<a href="https://example.com" class="button">Contact Seller</a>';
}

本文标签: woocommerce offtopicHow to add contact seller button in product page