VirtueMart Forum

VirtueMart 2 + 3 => General Questions => Topic started by: Tamakom on September 19, 2012, 22:30:32 pm

Title: Downloadable file in the product description
Post by: Tamakom 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
Title: Re: Downloadable file in the product description
Post by: jenkinhill 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
Title: Re: Downloadable file in the product description
Post by: Tamakom 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
Title: Re: Downloadable file in the product description
Post by: jenkinhill 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.
Title: Re: Downloadable file in the product description
Post by: Tamakom 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