I am trying to show a custom product attributes value in my woocommerce tab the attributes is named specification. Below is my code which outputs nothing. Ideas?
add_filter( 'woocommerce_product_tabs', 'woo_new_product_tab' );
function woo_new_product_tab( $tabs ) {
// Adds the new tab
$tabs['test_tab'] = array(
'title' => __( 'Features', 'woocommerce' ),
'priority' => 50,
'callback' => 'woo_new_product_tab_content'
);
return $tabs;
} function woo_new_product_tab_content() {
// The new tab content
$pa_value = get_post_meta($product->id, 'pa_specification', true);
echo $pa_value;
}
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire