久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

如何在 WooCommerce 中合并描述和附加信息選項卡

How can I merge the Description and Additional Information tabs in WooCommerce?(如何在 WooCommerce 中合并描述和附加信息選項卡?)
本文介紹了如何在 WooCommerce 中合并描述和附加信息選項卡?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

限時送ChatGPT賬號..

我正在嘗試將附加信息選項卡與 WooCommerce 中的描述選項卡合并.

I am trying to merge the additional information tab with the description tab in WooCommerce.

目的是在 2 列布局中并排顯示來自兩個選項卡的信息,其中第一列顯示說明,第二列顯示附加信息.

The intention is to display information from both tabs side-by-side in a 2-column layout, where the first column displays the description and the second column the additional information.

這可以用一段可以放在functions.php中的代碼來實現嗎?

Can this be achieved with a piece of code that can be placed in functions.php?

推薦答案

我最終采用了稍微不同的方法,基本上只是禁用了附加詳細信息選項卡并將內容重新添加到 the_content產品(即普通的描述"選項卡).

I ended up taking a slightly different approach, basically just disabled the Additional Details tab and re-adding the content to the_content of the product (that is, the normal Description tab).

// Remove Additional Info tab
add_filter('woocommerce_product_tabs', 'remove_tab_additional_info', 30);
function remove_tab_additional_info($tabs){
    unset( $tabs['additional_information'] );
    return $tabs;
}

// Add original Additional Info tab info to the end of the_content
add_filter('the_content','add_details_to_content', 10, 1);
function add_details_to_content($content){
    if ( is_product() ){
        global $product;
        $content = '<div class="product-description">'.$content.'</div>';

        ob_start();
        ?><div class="product-additional-info"><?php

        $heading = apply_filters( 'woocommerce_product_additional_information_heading', __( 'Additional information', 'woocommerce' ) );
        if ( !empty($heading) ) {
        ?>
            <h3><?php echo esc_html( $heading ); ?></h3>
        <?php }

        do_action( 'woocommerce_product_additional_information', $product );
        ?></div><?php
        $content .= ob_get_clean();
    }
    return $content;
}

這篇關于如何在 WooCommerce 中合并描述和附加信息選項卡?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

Add programmatically a downloadable file to Woocommerce products(以編程方式將可下載文件添加到 Woocommerce 產品)
Get today#39;s total orders count for each product in Woocommerce(獲取今天 Woocommerce 中每種產品的總訂單數)
Add Custom registration fields in WooCommerce and phone field validation issue(在 WooCommerce 和電話字段驗證問題中添加自定義注冊字段)
Add a select field that will change price in Woocommerce simple products(在 Woocommerce 簡單產品中添加一個將更改價格的選擇字段)
Add custom columns to admin products list in WooCommerce 3(在 WooCommerce 3 中將自定義列添加到管理產品列表)
Customizing checkout quot;Place Orderquot; button output html(自定義結帳“下訂單按鈕輸出html)
主站蜘蛛池模板: 91麻豆精品国产91久久久久久久久 | 日本成人中文字幕 | 日本三级韩国三级美三级91 | 国产成人精品一区二区三区视频 | 日韩视频一区二区三区 | 久久久夜| 天天操天天干天天 | 久久精品久久久精品美女 | 国产高潮在线观看 | 国产九九精品 | av网站在线免费观看 | 日韩色网站 | 精品在线一区 | 国产精品不卡视频 | 日韩精品一区在线观看 | www.粉色视频在线观看 | 秋霞午夜鲁丝一区二区老狼 | 日本天天操 | 亚洲永久免费视频 | 四虎在线播放 | 狠狠综合网 | 天天拍夜夜操 | 九色视频丨porny丨丝袜 | 9.1成人看片免费版 国产草草影院 | 欧美一级片免费 | www99热| 88av视频| 黄色av免费看 | 国产在线h| 精品久久久久久久久久久久久久久久 | 欧美午夜精品久久久久免费视 | 91综合在线 | 九九热在线精品 | 国产免费无遮挡 | 玖玖在线观看 | 嫩草视频在线观看 | 国产又黄又粗 | 国产一区二区三区在线 | 日本三级韩国三级美三级91 | 欧美精品亚洲精品 | 99精品网站 |