Solution for : Get custom attribute in woocommerce
Below is code/function to Get custom attribute in woocommerce.
If attribute key is "pa_specification"
1 2 3 4 5 6 7 8 9 10 11 12 13 | 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