How can I add html code on WooCommerce after singl

2020-03-08 06:20发布

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

Here is the screenshot:

enter image description here

Regards Golam Rabbi

2条回答
成全新的幸福
2楼-- · 2020-03-08 06:29
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!';       
    }
}
查看更多
劳资没心,怎么记你
3楼-- · 2020-03-08 06:35
add_action( 'woocommerce_product_after_tabs', 'my_product_after_tabs' );
function my_product_after_tabs() {
    echo 'html';
}

Or when overwriting and adjusting

https://github.com/woocommerce/woocommerce/blob/master/templates/single-product/tabs/tabs.php

https://github.com/woocommerce/woocommerce/blob/master/templates/single-product/related.php

查看更多
登录 后发表回答