admin管理员组文章数量:1323714
I found and implemented the following code. I need the Additional Information to display BEFORE the Product Description content. I have been looking through posts for hours with no luck.
add_filter( 'woocommerce_product_tabs', function( $tabs ) {
unset( $tabs['additional_information'] );
return $tabs;
}, 98 );
add_filter( 'woocommerce_product_tabs', function( $tabs ) {
$tabs['description']['callback'] = function() {
global $product;
wc_get_template( 'single-product/tabs/description.php' );
if ( $product && ( $product->has_attributes() || apply_filters(
'wc_product_enable_dimensions_display', $product->has_weight() || $product->has_dimensions() ) ) )
wc_get_template( 'single-product/tabs/additional-information.php' );
}
};
return $tabs;
}, 98 );
I found and implemented the following code. I need the Additional Information to display BEFORE the Product Description content. I have been looking through posts for hours with no luck.
add_filter( 'woocommerce_product_tabs', function( $tabs ) {
unset( $tabs['additional_information'] );
return $tabs;
}, 98 );
add_filter( 'woocommerce_product_tabs', function( $tabs ) {
$tabs['description']['callback'] = function() {
global $product;
wc_get_template( 'single-product/tabs/description.php' );
if ( $product && ( $product->has_attributes() || apply_filters(
'wc_product_enable_dimensions_display', $product->has_weight() || $product->has_dimensions() ) ) )
wc_get_template( 'single-product/tabs/additional-information.php' );
}
};
return $tabs;
}, 98 );
Share
Improve this question
asked Sep 9, 2020 at 17:15
user3096199user3096199
211 silver badge3 bronze badges
1 Answer
Reset to default 0Literally just swap the order of them in the code:
add_filter( 'woocommerce_product_tabs', function( $tabs ) {
$tabs['description']['callback'] = function() {
global $product;
if ( $product && ( $product->has_attributes() || apply_filters(
'wc_product_enable_dimensions_display', $product->has_weight() || $product->has_dimensions() ) ) )
wc_get_template( 'single-product/tabs/additional-information.php' );
}
wc_get_template( 'single-product/tabs/description.php' );
};
return $tabs;
}, 98 );
本文标签: woocommerce offtopicChange order of combined product tabs
版权声明:本文标题:woocommerce offtopic - Change order of combined product tabs 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742127929a2422027.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论