Tuesday, 27 October 2015

display attributes & SKU of products in Woocommerce

=======================display SKU When $product is pre defined on page===========

<p>SKU :&nbsp;<?php echo $product->get_sku(); ?><?php echo apply_filters( 'woocommerce_short_description', $post->post_excerpt ) ?><br>
                              <?php echo $product->get_attribute( 'your_attr' );
                $array=get_post_meta($product->id);
         ?>
                         
 =====================Get attributes when $product is defined on page=================

//fetching attributes have name Care Instruction
     Care Instruction : <?php echo  $product->get_attribute( 'Care Instruction' ); ?>

No comments:

Post a Comment