VirtueMart Forum

VirtueMart 2 + 3 + 4 => Product pricing => Topic started by: Valdez360 on July 25, 2013, 19:19:18 PM

Title: Get product details button and link text to open in new browser window
Post by: Valdez360 on July 25, 2013, 19:19:18 PM
is there any way to get the product details to open in a new window?

the code in the com_virtuemart/category/default.php is:

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

</p>
Title: Re: Get product details button and link text to open in new browser window
Post by: Maxim Pishnyak on July 25, 2013, 22:00:38 PM
I think I saw a solution for this somewhere on forum. Could you try a search button?
Title: Re: Get product details button and link text to open in new browser window
Post by: Valdez360 on July 26, 2013, 16:24:17 PM
Thanks Maxim
I have had a search of this site and also had a look in the Joomla! documentation, but I don't know how to achieve this.

The site uses a fancy pants filter system (custom filters) to select products, but has unpredictable results when the 'back to...' link or back browser button is used from a product page.

The easiest solution, we thought, would be to have the product detail page open in a fresh tab.
Title: Re: Get product details button and link text to open in new browser window
Post by: Maxim Pishnyak on July 26, 2013, 16:38:39 PM
Quick View functionality - https://forum.virtuemart.net/index.php?topic=109953.msg368626
Very close to ready solution. Unfortunately some fix is necessary in add-to-cart process.

By the way some authors of custom VM themes made Quick View feature. 
So it's possible to learn how they did that on their demo web sites.
Or just to buy their designs which are ready to use.
But, hey, there're 174 custom VM themes over Internet.
A lot of work to check them all one by one.
Title: Re: Get product details button and link text to open in new browser window
Post by: Valdez360 on July 26, 2013, 17:26:22 PM
That's brilliant Maxim. I better get started then.
Title: Re: Get product details button and link text to open in new browser window
Post by: Valdez360 on July 26, 2013, 19:09:16 PM
Here is the code I used and works great:

<p>
                            <?php //New Product details button -> open product details page in modal
    
$url JRoute::_('index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=' $product->virtuemart_product_id '&virtuemart_category_id=' $product->virtuemart_category_id '&tmpl=component');
?>

<a class="product-details" href="<?php echo $product->link ?>" target="_blank"><?php echo JText::_('COM_VIRTUEMART_PRODUCT_DETAILS'?></a>
</p>


Many thanks to Bytelord and Maxim
Title: Re: Get product details button and link text to open in new browser window
Post by: Valdez360 on July 27, 2013, 11:16:37 AM
...and here is the line for the new browser window product link text:

<h2><a href="<?php /** Link the text in a new browser window*/ echo $product->link ?>" target="_blank"><?php echo $product->product_name;?></a></h2>