News:

Looking for documentation? Take a look on our wiki

Main Menu

Get product details button and link text to open in new browser window

Started by Valdez360, July 25, 2013, 19:19:18 PM

Previous topic - Next topic

Valdez360

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>

Maxim Pishnyak

I think I saw a solution for this somewhere on forum. Could you try a search button?
You can support Community by voting for Project on the JED
https://extensions.joomla.org/extension/virtuemart/#reviews
Join us at
https://twitter.com/virtuemart

Valdez360

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.

Maxim Pishnyak

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.
You can support Community by voting for Project on the JED
https://extensions.joomla.org/extension/virtuemart/#reviews
Join us at
https://twitter.com/virtuemart

Valdez360


Valdez360

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

Valdez360

...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>