Nirupam Arya
Nirupam Arya

Reputation: 37

Magento how to show product attribute in product page?

I am using a attribute to show a attribute value in product page code is:

getProductShipping()):?>
Shipping Charges : Rs.getProductShipping(); ?>

it is showing Shipping Charges : Rs. 20 what is the value of attribute. if some products has no value in this product then nothing is showing there but i want to show Free shipping if no value is there. i want the code please help me.

attributes

Upvotes: 0

Views: 110

Answers (1)

Pankaj Pareek
Pankaj Pareek

Reputation: 3856

It can work like this way:

<?php if($product->getProductShipping()) { ?>
   Shipping Charges : Rs. <?php echo $product->getProductShipping(); ?>
<?php } else { ?>   
   Free Shipping
<?php } ?>      

Upvotes: 1

Related Questions