X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Add dropdown to Contact Us (https://forum.x-cart.com/showthread.php?t=9229)

lyncca 09-03-2004 11:14 AM

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 :D

Jon 09-03-2004 11:50 AM

Version?

lyncca 09-03-2004 12:00 PM

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

Jon 09-03-2004 03:49 PM

No worries, I understand that :D 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}

lyncca 09-08-2004 11:27 AM

Thanks Jon!

Worked perfectly!


All times are GMT -8. The time now is 07:32 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.