单个产品汇总后如何在WooCommerce上添加html代码

一个产品摘要后, 如何在woocommerce上添加HTML代码?

这是屏幕截图:

单个产品汇总后如何在WooCommerce上添加html代码

问候戈兰拉比


#1


add_action( 'woocommerce_product_after_tabs', 'my_product_after_tabs' );
function my_product_after_tabs() {
    echo 'html';
}

或覆盖和调整时

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


#2


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


一个产品摘要后, 如何在woocommerce上添加HTML代码?

这是屏幕截图:

单个产品汇总后如何在WooCommerce上添加html代码

问候戈兰拉比


#4


add_action( 'woocommerce_product_after_tabs', 'my_product_after_tabs' );
function my_product_after_tabs() {
    echo 'html';
}

或覆盖和调整时

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


#5


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!';       
    }
}

来源:

https://www.srcmini02.com/62611.html

微信公众号
手机浏览(小程序)
0
分享到:
没有账号? 忘记密码?