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

前端 未结 1 1638
余生分开走
余生分开走 2021-01-07 08:46

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

Here is the screenshot:

Regards Golam Rabbi

相关标签:
1条回答
  • 2021-01-07 09:41

    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!';       
        }
    }
    
    0 讨论(0)
提交回复
热议问题