Solution for : Get custom attribute in woocommerce
Below is code/function to Get custom attribute in woocommerce.
If attribute key is "pa_specification"
function woo_new_product_tab_content() {
// The new tab content
global $post;
$product_id = $post->ID;
$product = new WC_Product( $product_id );
$pa_value = $product->get_attribute('pa_specification');
echo $pa_value;
}

No comments:
Post a Comment