Golam Rabbi
Golam Rabbi

Reputation: 35

How can I add html code on WooCommerce after single product summary

How can I add HTML code on woocommerce after a single product summary?

Here is the screenshot:

enter image description here

Regards Golam Rabbi

Upvotes: 1

Views: 3108

Answers (1)

7uc1f3r
7uc1f3r

Reputation: 29624

You can use the following for this

add_action( 'woocommerce_product_after_tabs', 'my_product_after_tabs' );
function my_product_after_tabs() {
    global $product;
    $product_id = $product->get_id();
    
    if ( $product_id == 1 ) {
        echo 'html 1';
    } elseif ( $product_id == 2 ) {
        echo 'html 2';      
    } elseif ( $product_id == 3 ) {
        echo 'html 3';
    } else {
        echo 'product id not found!';       
    }
}

Upvotes: 2

Related Questions