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

Add dropdown to Contact Us

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 09-03-2004, 11:14 AM
  lyncca's Avatar 
lyncca lyncca is offline
 

X-Adept
  
Join Date: Nov 2003
Location: Fort Worth, Texas
Posts: 455
 

Default Add dropdown to Contact Us

Hey everyone

I am needing to add an additional question and dropdown box to the contact us page. I know how to delete fields, but wasn't sure what I needed to do to go about adding a dropdown box.

It would be something like:

Code:
Which of the following best describes you? - Dropdown A - Dropdown B - Dropdown C

Thanks in advance for any help
Reply With Quote
  #2  
Old 09-03-2004, 11:50 AM
  Jon's Avatar 
Jon Jon is offline
 

X-Guru
  
Join Date: Oct 2002
Location: Vancouver, Canada
Posts: 4,200
 

Default

Version?
Reply With Quote
  #3  
Old 09-03-2004, 12:00 PM
  lyncca's Avatar 
lyncca lyncca is offline
 

X-Adept
  
Join Date: Nov 2003
Location: Fort Worth, Texas
Posts: 455
 

Default

Oh crap. I don't have it in my sig since all these are client carts of different versions.

This one is: 3.5.10
Reply With Quote
  #4  
Old 09-03-2004, 03:49 PM
  Jon's Avatar 
Jon Jon is offline
 

X-Guru
  
Join Date: Oct 2002
Location: Vancouver, Canada
Posts: 4,200
 

Default

No worries, I understand that I can't guarantee this will work because I haven't done it, but it should. Just backup first of course.

Open up /skin1/help/contactus.tpl

Use code similar to this, substituting language, etc. and place it where in the html you want it to appear.

Code:
<tr valign=middle> <td class=FormButton>What option best describes you?:</td> <td><font class=Star>*</font></td> <td nowrap> <select name=describeself class="form"> <option value=""{if $userinfo.describeself eq "" AND $describeself eq ""} selected{/if}>Please Select an Option</option> <option{if $userinfo.describeself eq "Option A"} selected{/if}>Option A</option> <option{if $userinfo.describeself eq "Option B"} selected{/if}>Option B</option> <option{if $userinfo.describeself eq "Option C"} selected{/if}>Option C</option> </select> {if $fillerror ne "" and $userinfo.describeself eq ""}<font class=Star>&lt;&lt;</font>{/if} </td> </tr>

Only include these 2 lines if you want it mandatory:

Code:
<font class=Star>*</font> {if $fillerror ne "" and $userinfo.describeself eq ""}<font class=Star>&lt;&lt;</font>{/if}

If you want it mandatory open include/help.php and find:

Code:
$fillerror = (empty($contact["firstname"]) || empty($contact["lastname"]) || empty($contact["email"]) || empty($contact["subject"]) || empty($contact["body"]));

And replace with:

Code:
$fillerror = (empty($contact["firstname"]) || empty($contact["lastname"]) || empty($contact["email"]) || empty($contact["subject"]) || empty($contact["body"]) || empty($contact["describeself"]));

Open /skin1/mail/help_contactus.tpl

Where you want the info to appear put (create language variables if you want):

Described self as: {$contact.describeself}
Reply With Quote
  #5  
Old 09-08-2004, 11:27 AM
  lyncca's Avatar 
lyncca lyncca is offline
 

X-Adept
  
Join Date: Nov 2003
Location: Fort Worth, Texas
Posts: 455
 

Default

Thanks Jon!

Worked perfectly!
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 02:20 PM.

   

 
X-Cart forums © 2001-2020