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

將簡短描述移動到 Woocommerce 單個產品頁面的選項

Move short description into tabs in Woocommerce single product pages(將簡短描述移動到 Woocommerce 單個產品頁面的選項卡中)
本文介紹了將簡短描述移動到 Woocommerce 單個產品頁面的選項卡中的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

限時送ChatGPT賬號..

在 woocommerce 單一產品頁面中,如何將產品簡短描述移動到自定義產品選項卡中,其中描述和附加信息?

In woocommerce Single Product pages, how do I move the product short description into a custom product tab where the description and the additional information are?

我已將描述和附加信息選項卡從標準位置移至產品摘要所在的右側.但是,我想將產品摘要插入到一個選項卡中,因此基本上它將是 3 個選項卡.

I have moved the description and additional information tab from the standard position to the right side where the product summary is. However I would like to insert the product summary into a tab so essentially it will be 3 tabs.

我用來將標簽移動到圖像右側的代碼是:

The code I have used to move the tabs to the right of the image is:

remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_product_data_tabs', 10 );
add_action( 'woocommerce_single_product_summary', 'woocommerce_output_product_data_tabs', 30 );

推薦答案

您仍然保留以下更改選項卡位置的內容(就像您已經做的那樣):

You still keep the following that change the tabs location (as you already do):

remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_product_data_tabs', 10 );
add_action( 'woocommerce_single_product_summary', 'woocommerce_output_product_data_tabs', 30 );

然后,以下內容會將簡短描述的位置更改為自定義產品選項卡:

Then, the following will change the location of short description to a custom product tab:

// Remove short description
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_excerpt', 20 );

// Add short description to a custom product tab
add_filter( 'woocommerce_product_tabs', 'add_custom_product_tab', 10, 1 );
function add_custom_product_tab( $tabs ) {

    $custom_tab = array(
        'custom_tab' =>  array(
            'title' => __( "Short description", "woocommerce" ),
            'priority' => 12,
            'callback' => 'short_description_tab_content'
        )
    );
    return array_merge( $custom_tab, $tabs );
}

// Custom product tab content
function short_description_tab_content() {
    global $post, $product;

    $short_description = apply_filters( 'woocommerce_short_description', $post->post_excerpt );

    if ( ! $short_description ) {
        return;
    }

    echo '<div class="woocommerce-product-details__short-description">' . $short_description . '</div>'; // WPCS: XSS ok.
}

代碼位于活動子主題(或活動主題)的 function.php 文件中.經測試有效.

Code goes on function.php file of your active child theme (or active theme). Tested and works.

這篇關于將簡短描述移動到 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)
主站蜘蛛池模板: 久久久网 | 四虎影院新网址 | 不卡一区二区在线观看 | 欧美成人aaa级毛片在线视频 | av中文字幕在线播放 | 在线观看国产 | 亚洲视频www | 欧美成人精品一区二区男人看 | 在线播放国产一区二区三区 | 欧美国产日本一区 | 大乳boobs巨大吃奶挤奶 | 91久久国产精品 | 久久99精品国产自在现线小黄鸭 | 91中文 | 日韩免费高清视频 | 九九九久久国产免费 | 国内精品久久久久久久影视简单 | 2020天天操 | 日本成年免费网站 | 日本黄色影片在线观看 | 国产精品夜夜夜一区二区三区尤 | 精品国产一区二区三区观看不卡 | 中文字幕在线播放第一页 | 国产视频线观看永久免费 | 国产成人精品久久二区二区91 | 日韩在线免费 | 久久新| 在线免费91| 中文字字幕一区二区三区四区五区 | 亚洲成人免费在线观看 | 精品一区二区久久久久久久网站 | 精品欧美一区二区三区久久久小说 | 亚洲精品成人在线 | 成人欧美一区二区三区黑人孕妇 | 日本精品一区二区 | 国产精品久久 | 三级在线视频 | 天天干天天想 | 国产精品99久久久久久久vr | 99re在线视频免费观看 | 久久视频精品在线 |