Author Topic: Downloadable file in the product description  (Read 1521 times)

Tamakom

  • Beginner
  • *
  • Posts: 42
Downloadable file in the product description
« on: September 19, 2012, 22:30:32 pm »
Dear virtuemart´s friends
I could not find the specific subject

 I have a product, but I need to add a lot of literature. I think I have a downloadable file in the product description so that visitors can download. (pdf, doc, exe, dwf, jpg, gif, flv, VWM, ....). How I can do this in virtuemart 2.0.10?

Thanks in advance

jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 26910
  • Always on vacation
    • Jenkin Hill Internet
Re: Downloadable file in the product description
« Reply #1 on: September 20, 2012, 11:56:11 am »
You can use custom fields for this:  http://forum.virtuemart.net/index.php?topic=93337.msg327528#msg327528

Or provide a link to the document file wherever you like - http://forum.virtuemart.net/index.php?topic=99225.msg327903#msg327903
Kelvyn

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Currently using VM.3.2.15.9866 on Joomla 3.8.10 PHP 7.0.30

Testing VM.3.2.15.9898 on J3.8.10

Tamakom

  • Beginner
  • *
  • Posts: 42
Re: Downloadable file in the product description
« Reply #2 on: September 24, 2012, 04:56:51 am »
You can use custom fields for this:  http://forum.virtuemart.net/index.php?topic=93337.msg327528#msg327528

Or provide a link to the document file wherever you like - http://forum.virtuemart.net/index.php?topic=99225.msg327903#msg327903

Dear jenkinhill
Thank you for the link.
It seems that this path will help me.


Hi All

this might be a hack or whatever, but this is what I've done and it works....
_______________________________________________________________________________________________
<?php
$pdf_download = 'images/stories/virtuemart/product/'.$this->YagProduct->sku.'.pdf';

if (file_exists($pdf_download)) {
   ?>
   <div id="product_pdf_download">
      <a href="<?php echo $pdf_download; ?>" target="blank">Download Datasheet</a>
   </div>   
   <?php } ?>
__________________________________________________________________________________________________
So all I've done is copied all the pdf's into the product folder and made sure they've got the same name as the SKU

that mod is in the productdetails/default.php

Hope it helps someone...

James

Dear James
For the comment that jenkinhill write down, I guess the solution you give is a success. So I have to ask Where paste that code?. "I'm below the line beginning" so I have to ask possibly basic structures.

I do not understand how this is done. Should I create a new folder where? .... The code I paste into (\ components \ com_virtuemart \ views \ ProductDetails \ tmpl \ default.php) ....?
In what line?

In my inexperience, I've never seen "YagProduct", that's code itself is custom virtuemart or you?

I appreciate your understanding.

Thank in advance

mikhelee

  • Beginner
  • *
  • Posts: 1
Re: Downloadable file in the product description
« Reply #3 on: September 24, 2012, 12:22:39 pm »
set it to pending first to see if you get an invoice. later change as you like - but you will have to actually test? with a fake credit card purchase? I think.

Tamakom

  • Beginner
  • *
  • Posts: 42
Re: Downloadable file in the product description
« Reply #4 on: September 24, 2012, 14:11:14 pm »
set it to pending first to see if you get an invoice. later change as you like - but you will have to actually test? with a fake credit card purchase? I think.

I did not understand this answer. I do not see the problem concerns I raise.

Regards

jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 26910
  • Always on vacation
    • Jenkin Hill Internet
Re: Downloadable file in the product description
« Reply #5 on: September 24, 2012, 23:50:38 pm »
"Yagproduct" translates to Your Product. And you put the code into the template at wherever you want to file link to display on your page.
Kelvyn

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Currently using VM.3.2.15.9866 on Joomla 3.8.10 PHP 7.0.30

Testing VM.3.2.15.9898 on J3.8.10

Tamakom

  • Beginner
  • *
  • Posts: 42
Re: Downloadable file in the product description
« Reply #6 on: September 25, 2012, 03:35:04 am »
"Yagproduct" translates to Your Product. And you put the code into the template at wherever you want to file link to display on your page.

Thank you jenkinhill