I created a new attribute called “product_support” that’s a text area, so I can fill in some HTML and link to a pdf manual. I’m using the following code:
Thanks Moshe, but didn’t you say that {{ }} does not work in the Attributes? I added the code you suggested around like 90 in catalog/product/view.phtml and added the following to the attribute, but get the same error as mentioned in my post above.:
Hi Guys
I found your thread and it is very similar to what I have been trying to do, but instead of downloading a file I would like to open a link in a popup window.
Any help would be greatly appreciated.
Thanks
Lisa
Did you ever get an answer or work it out for yourself?
Would love to see/hear anything you’ve learned, as I posted the same sort of question today—view here <http://www.magentocommerce.com/boards/viewthread/10274/>.
To open a link in a new window, just target the link to a named window. To open a link in a pop-up window, use the onclick event in the link and call a javascript function popWin that’s already defined in one of the included libraries.
Here’s an example with the link opening in a new window:
<?php $_additional = $this->getAdditionalData(); ?> <!--<?php //var_dump($_additional); ?> use this if you want to dump and view the available attributes for debugging purposes--> <?php if (array_key_exists('warranty', $_additional)):?> <a href="http://media.mycompany.com/warranty/warranty_<?php echo ( $_additional['warranty']['value'] );?>.pdf" target="warr_win">Warranty</a> <?php endif; ?>
Here’s an example with the link opening in a pop-up window:
<?php $_additional = $this->getAdditionalData(); ?> <!--<?php //var_dump($_additional); ?> use this if you want to dump and view the available attributes for debugging purposes--> <?php if (array_key_exists('warranty', $_additional)):?> <a href="#" onclick="popWin('http://media.mycompany.com/warranty/warranty_<?php echo ( $_additional['warranty']['value'] );?>.pdf','warr_win','width=800,height=600,resizable=yes,scrollbars=yes')">Warranty</a> <?php endif; ?>