News:

Support the VirtueMart project and become a member

Main Menu

Adding additional files eg product instructions/specs NOT downloads.

Started by craig_wild, November 16, 2011, 05:37:03 AM

Previous topic - Next topic

Tamakom

Quote from: captainahab on September 04, 2012, 22:52:02 PM
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.

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

I appreciate your understanding.

Thank in advance

Swanky-Pixels

#16
This subject is causing me no end of problems!

Using Joomla 2.5.7 and VM 2.0.12b Problem example here http://www.urbanenergyuk.com/air-source-heat-pump-distributor/air-source-heat-pump-cylinders/gledhill/gledhill-heat-pump-cylinder-210l-detail

I have 200+ products and each has a PDF spec sheet

I was adding product, then add main image then I uploaded the PDF same method in product all worked fine and the PDF would download. But I did not like the CSS

Thats when I found this forum post.

I added custom field called PDF then added custom field to test product, selected existing PDF all works great and CSS is better.

But I then tried uploading a PDF via media files but is states The server supports mime type recognition Supported filetypes for thumbnail creation GIF, JPG, PNG, WBMP

What have a done wrong? Is my only option to upload via FTP?
"I am always doing what i can not do in order to learn how to do it"


https://www.swankypixels.com
http://www.cotswold-designs.co.uk

PolishedGeek

Oh Captain, my captain (like you haven't heard that before, right? LOL)....Could you share a link or screenshot of the final result of your mod?
~ Deb Cinkus, CEO
Polished Geek, LLC   |    www.PolishedGeek.com

Creators of JoomLister - eBay Lister for Joomla!

SnowBunny

See I don't understand why VM2 does not have the option to have a downloadable spec sheet on the product pages. You can upload pdf media to the product but there is no way to display it or automatically link it to the product.

So frustrating to have to edit code for something that should be a standard feature..