Author Topic: How modify link pdf product VM 2 to open in onother windows ?  (Read 1188 times)

TAIWAR

  • Jr. Member
  • **
  • Posts: 219
How modify link pdf product VM 2 to open in onother windows ?
« 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.

Maxim Pishnyak

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 2657
Re: How modify link pdf product VM 2 to open in onother windows ?
« Reply #1 on: October 10, 2013, 09:44:23 am »
Use target attribute for url html tag.

Your URL?

TAIWAR

  • Jr. Member
  • **
  • Posts: 219
Re: How modify link pdf product VM 2 to open in onother windows ?
« Reply #2 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.


Maxim Pishnyak

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 2657
Re: How modify link pdf product VM 2 to open in onother windows ?
« Reply #3 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?

TAIWAR

  • Jr. Member
  • **
  • Posts: 219
Re: How modify link pdf product VM 2 to open in onother windows ?
« Reply #4 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" ?




Maxim Pishnyak

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 2657
Re: How modify link pdf product VM 2 to open in onother windows ?
« Reply #5 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

TAIWAR

  • Jr. Member
  • **
  • Posts: 219
Re: How modify link pdf product VM 2 to open in onother windows ?
« Reply #6 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');


TAIWAR

  • Jr. Member
  • **
  • Posts: 219
Re: How modify link pdf product VM 2 to open in onother windows ?
« Reply #7 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...

TAIWAR

  • Jr. Member
  • **
  • Posts: 219
Re: How modify link pdf product VM 2 to open in onother windows ?
« Reply #8 on: October 22, 2013, 11:03:07 am »
any idea please...

TAIWAR

  • Jr. Member
  • **
  • Posts: 219
Re: How modify link pdf product VM 2 to open in onother windows ?
« Reply #9 on: October 28, 2013, 22:19:53 pm »
 :( :( :( Someone ???