VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: TAIWAR on October 07, 2013, 19:07:48 PM

Title: How modify link pdf product VM 2 to open in onother windows ?
Post by: TAIWAR on October 07, 2013, 19:07:48 PM
Hello
I use pdf button Virtumart 2.0.22a
By defaut when we click on pdf button, another page open but I want it open in another page. How to chnage it please ?

Thank you.
Title: Re: How modify link pdf product VM 2 to open in onother windows ?
Post by: Maxim Pishnyak on October 10, 2013, 09:44:23 AM
Use target attribute for url html tag.

Your URL?
Title: Re: How modify link pdf product VM 2 to open in onother windows ?
Post by: TAIWAR on October 11, 2013, 10:04:21 AM
http://demoboutique.swebcreation.com/power-tools/interieur/drill-detail.html

Where do I have to add the target attribute ?

And then I try to change pdf product preview with pdf.php (delete line ask question) but that s not the right file.

Title: Re: How modify link pdf product VM 2 to open in onother windows ?
Post by: Maxim Pishnyak on October 11, 2013, 13:12:14 PM
I used Firebug and find corresponding row in product details template file
echo $this->linkIcon($link . '&format=pdf', 'COM_VIRTUEMART_PDF', 'pdf_button', 'pdf_icon', false);
Did you see it?
Title: Re: How modify link pdf product VM 2 to open in onother windows ?
Post by: TAIWAR on October 11, 2013, 14:39:57 PM
With firebug  I found this :

<div class="icons">
<a href="/drill-detail.pdf?tmpl=component" title="PDF">
<img alt="PDF" src="/templates/demoboutiqueswebcreation/images/pdf_button.png">
</a>

But I found the file with the code echo $this->linkIcon($link . '&format=pdf', 'COM_VIRTUEMART_PDF', 'pdf_button', 'pdf_icon', false); (defaut.php)
where I can add target="_blank" ?



Title: Re: How modify link pdf product VM 2 to open in onother windows ?
Post by: Maxim Pishnyak on October 11, 2013, 19:03:36 PM
You should be able to use not only Firebug, but also text search for finding some commands.
I see that linkIcon declared in components\com_virtuemart\helpers\vmview.php
Title: Re: How modify link pdf product VM 2 to open in onother windows ?
Post by: TAIWAR on October 14, 2013, 14:50:46 PM
Ok thank you, I modify this line and have the pdf in popup target and not in onother windows page...But now the add to cart button not ok...

/www/components/com_virtuemart/helpers/vmview.php

LINE 28
function linkIcon($link,$target=_blank ,$altText ='',$boutonName,$verifyConfigValue=false, $modal = true, $use_icon=true,$use_text=false)


/www/components/com_virtuemart/views/productdetails/tmpl/default.php

LINE 131 to 135 

echo $this->linkIcon($link . '&format=pdf', 'COM_VIRTUEMART_PDF', 'pdf_button', 'pdf_button', false);
      
       }
       echo $this->linkIcon($link . '&print=1', 'COM_VIRTUEMART_PRINT', 'printButton', 'printButton');
       echo $this->linkIcon($MailLink, 'COM_VIRTUEMART_EMAIL', 'emailButton', 'emailButton');

Title: Re: How modify link pdf product VM 2 to open in onother windows ?
Post by: TAIWAR on October 16, 2013, 16:09:03 PM
The add to cart is solved (it because my file cart.php was empty... don't know why...)
But I always have the pdf on popup and not in another windows page...
Title: Re: How modify link pdf product VM 2 to open in onother windows ?
Post by: TAIWAR on October 22, 2013, 11:03:07 AM
any idea please...
Title: Re: How modify link pdf product VM 2 to open in onother windows ?
Post by: TAIWAR on October 28, 2013, 22:19:53 PM
 :( :( :( Someone ???