Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

Trouble with my PDF download button

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 07-12-2005, 01:36 AM
 
dazybabes dazybabes is offline
 

Advanced Member
  
Join Date: Mar 2005
Posts: 70
 

Default Trouble with my PDF download button

I am trying to get my x-cart to show a PDF Download button when there is a PDF available to download.

I have created an extra field for PDF's so that if the product has a PDF you can just put y or yes and it will show button and then created a pdf folder with a file based on the productcode.

If I leave it as hardcode text so that it just says "Download PDF" in rolloverable text it works fine, but what I want to do is create a button that appears, which to some extent works but the link doesnt?

Code:
{if $extra_fields[1].field_value} {include file="buttons/pdf_button.tpl" style="button" href="http://www.kitinfo.co.uk/kitwarehouse/pdffiles/{$products[product].productcode}.pdf"} {/if}

I have created a pdf_button.tpl and a folder to place the pdfs in named on just their productcodes.

The problem is the code seems to mess up and it brings in some coding??

[img]http://www.kitinfo.co.uk/Images/download.jpg
[/img]

if I leave it like this it works fine??

Code:
{if $extra_fields[1].field_value} download {/if}

Anyone any ideas??
__________________
X-Cart Version 4.0.3
Reply With Quote
  #2  
Old 07-22-2005, 08:41 AM
 
xgarb xgarb is offline
 

eXpert
  
Join Date: Jul 2004
Location: UK
Posts: 263
 

Default

Here's what I've just done which may help you...

I've only got one 'option' which is the PDF so I just changed modules/Extra_Fields/product.tpl

to the following

Code:
{section name=field loop=$extra_fields} {if $extra_fields[field].active eq "Y" && $extra_fields[field].field_value} <TR><TD width="30%"> Download PDF: </TD><TD> <a href="PDF/{$extra_fields[field].field_value}.pdf"> [img]{$ImagesDir}/pdf.gif[/img]</a> </TD> </TR> {/if} {/section}

My one option in the add product page is a text box for the client to put the name of the PDF file in (no file suffix). I upload all the his PDFs to /PDF and they appear for a product that has an associated PDF.
__________________
Core version: 5.5.xx
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 01:45 AM.

   

 
X-Cart forums © 2001-2020