I want to add "Buy on Amazon" button on my product page. I was successful in adding it with this code:
<a href="<?php echo $this->getProduct()->getamazonurl(); ?>"><img src="/media/wysiwyg/buy_on_amazon.png"></a>
I created an attribute amazonurl & added it to the required attributes set. Now I can enter the link of my product in that field. Problem is I'm not selling all the products that are listed on my website, so I want this button to appear only if there is a value (URL) entered in attribute's field. How do I do it? Because currently it's appearing regardless of the value entered.