News:

Support the VirtueMart project and become a member

Main Menu

*.pdf extraction

Started by theguy, April 07, 2014, 19:43:13 PM

Previous topic - Next topic

theguy

Hi,

I'm using Virtuemart as a catalog and have 3 media items set for each product: 2 images and 1 pdf file.
I would like to write a php patch that will locate the .pdf file within the media array, hide it from the additional-images div and link it instead to a button I'll generate.

Unfortunately my PHP knowledge is limited but I know from my Java experience it should be something like a variable that gets the file pointer via if and get statement.

I would REALLY appreciate if some PHP rock star could help me with this piece of code and I know it would help others in the future.

Thank you in advance,

Guy.

theguy

I think I should clarify my question...

I'm using Virtuemart as a catalog and have 3 media items set for each product: 2 images and 1 pdf file.

I got 2 tabs showing Product Description and Product Short Description.

This is the way a tab works:

<li>
    <a href="#short-desc" data-toggle="tab">
    <?php echo JText::_('PRODUCT_SHORT_DESC');?>
    </a>
</li>


I wish to have a third tab with href pointing to my pdf that is currently under additional-images div.

Saw a suggestion for something like this:

if (VmConfig::get('pdf_icon', 1) == '1') {
echo '<a href="'.$link.'&format=pdf" target="_blank">PDF</a>';


Can't get it to work. I guess I have a problem with my syntax. This is what I tried:

<li>
    <?php if (VmConfig::get('pdf_icon'1) == '1') {
           
?>

        <?php echo <a href="'.$link.'&format=pdf" target="_blank">PDF</a>;?>
        <?php echo JText::_('PRODUCT_PDF_FILE');?>
    }         
</li>


Can any one help?