VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: dfeg on June 23, 2013, 16:40:49 PM

Title: Open product in new page from category page
Post by: dfeg on June 23, 2013, 16:40:49 PM
Hi
I@m looking for links from the category page to the product details pages to open in a new window/tab. i was able to do this in VM1 by using <?php echo $product_flypage ?> in a link with target="_blank" but the links seem to be build differently in vm2 and i'm struggling to figure out how to do this.
Thanks
Title: Re: Open product in new page from category page
Post by: dfeg on June 23, 2013, 17:30:23 PM
I've found the answer myself. staring at me

<a href="<?php echo $product->link ?>" target="_blank" rel="nofollow">
Title: Re: Open product in new page from category page
Post by: dfeg on June 23, 2013, 17:40:02 PM
found an even neater way of doing it just add  'target' => '_blank' to the array at the end of the link so for the product details buttons

<p>
               <?php // Product Details Button
               echo JHTML::link($product->link, JText::_('COM_VIRTUEMART_PRODUCT_DETAILS'), array('title' => $product->product_name,'class' => 'product-details', 'target' => '_blank'));
               ?>
               </p>