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

Adding a textarea as additional field option to register.php/tpl

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 03-04-2012, 02:00 PM
  tqualizerman's Avatar 
tqualizerman tqualizerman is offline
 

X-Adept
  
Join Date: Jun 2008
Posts: 392
 

Default Adding a textarea as additional field option to register.php/tpl

Hi,

Does anyone know how to go about adding the ability to create a textarea as an additional field option? As it is, only text box, check box and select are available.
__________________
- www.nerdseven.com - Gadgets & Gizmos from Out of This World
- Sound Sensitive T-Shirts That Flash to the Beat of Music (http://www.tqualizer.com)


X-Cart Version 4.1.10
Reply With Quote
  #2  
Old 03-04-2012, 08:00 PM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,823
 

Default Re: Adding a textarea as additional field option to register.php/tpl

There is a variable called {$types} that you would need to add a new entry to.
Currently it supports:

T => "Text"
C => "Checkbox"
S => "Select box"

You will need to add
A=> "Text Area"

This variable is set in:
admin\contact_us_profiles.php and
admin\user_profiles.php

Then say you added the field to "additional info" well you would need to adjust:
main/register_additional_info.tpl after :
{elseif $v.type eq 'C'}
<input type="checkbox" name="additional_values[{$v.fieldid}]" id="additional_values_{$v.fieldid}" value="Y"{if $v.value eq 'Y'} checked="checked"{/if} />

Add:
{elseif $v.type eq 'A'}
<textarea rows="2" cols="20" name="additional_values[{$v.fieldid}]" id="additional_values_{$v.fieldid}" >
{$v.value}</textarea>

Or something along these lines. There may be additional steps required, I have never attempted this. Hopefully though, this will set you on the right path.
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey

XcartGuru
X-cart Tutorials | X-cart 5 Tutorials

Check out the responsive template for X-cart.
Reply With Quote
  #3  
Old 03-04-2012, 09:20 PM
  tqualizerman's Avatar 
tqualizerman tqualizerman is offline
 

X-Adept
  
Join Date: Jun 2008
Posts: 392
 

Default Re: Adding a textarea as additional field option to register.php/tpl

This appears to work 90% of the way - thank you very much!

The last little bit that I'm having trouble figuring out is in the admin section. I can see the textarea's additional field label in an individuals' profile page, but I can't see the actual textarea box that should be beside it. The admin tpl's for profile info look as if they should be able to display the textarea without any modification, so I must be overlooking something obvious.
__________________
- www.nerdseven.com - Gadgets & Gizmos from Out of This World
- Sound Sensitive T-Shirts That Flash to the Beat of Music (http://www.tqualizer.com)


X-Cart Version 4.1.10
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



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:19 AM.

   

 
X-Cart forums © 2001-2020