Move product meta to the description tab in WooCommerce

元气小坏坏 提交于 2020-01-14 14:40:11

问题


How to move the product meta to the beginning of the product description tab? I try:

remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_meta', 40 );
add_action( 'woocommerce_product_tabs_description', 'woocommerce_template_single_meta', 10 );

Remove works, but add_action() doesn't.


回答1:


You can keep:

remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_meta', 40 );

To add the single product meta inside the description tab you can not use hooks…

You need first to override single-product/tabs/description.php template via your theme as explained in this official documentation.

Once you have copied the file to the woocommerce folder inside your active theme, open edit single-product/tabs/description.php file and add the following line inside it:

wc_get_template( 'single-product/meta.php' );

It will displays the product meta information inside the product description tab.



来源:https://stackoverflow.com/questions/57790167/move-product-meta-to-the-description-tab-in-woocommerce

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!