WooCommerce - 将产品描述从选项卡移到摘要中 [英] WooCommerce - Move Product Description out Tabs into Summary

查看:31
本文介绍了WooCommerce - 将产品描述从选项卡移到摘要中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在寻找如何将 Woocommerce 的单个产品页面上的产品描述从选项卡移到主要部分.我只是在任何地方都找不到它!

I've hunted high and low how to move the Product Description on a Single Product page of Woocommerce out of the tabs and in to the main section. I just can't find it anywhere!

如果有人能帮助我,我将不胜感激,因为我有点失去理智!

If anybody can help me out it would be massively appreciated as i'm losing my mind a bit!

谢谢丹

提交后我有了一个想法,所有的钩子都只是函数,所以我创建了一个新函数并包含了产品描述代码:

Just after submitting this I had an idea, all of the hooks are just functions so I created a new function and included the product description code:

function woocommerce_template_product_description() {
   woocommerce_get_template( 'single-product/tabs/description.php' );
 }

add_action( 'woocommerce_single_product_summary', 'woocommerce_template_product_description', 20 );

我不确定这种方法有多完美,但它完成了我需要它做的工作!

I'm not sure how perfect a method that is but it does the job I need it to do!

推荐答案

刚提交这个我就有了一个想法,所有的钩子都是函数,所以我创建了一个新函数并包含了产品描述代码:

Just after submitting this I had an idea, all of the hooks are just functions so I created a new function and included the product description code:

function woocommerce_template_product_description() {
woocommerce_get_template( 'single-product/tabs/description.php' );
}
add_action( 'woocommerce_single_product_summary', 'woocommerce_template_product_description', 20 );

由于最新版本的 woocommerce 这段代码应该仍然像这样工作

since latest versions of woocommerce this code should still work like so

function woocommerce_template_product_description() {
wc_get_template( 'single-product/tabs/description.php' );
}
add_action( 'woocommerce_single_product_summary', 'woocommerce_template_product_description', 20 );`

这篇关于WooCommerce - 将产品描述从选项卡移到摘要中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆