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

Larger Text Area For Product Options

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 03-28-2006, 06:31 AM
 
johnoc johnoc is offline
 

Member
  
Join Date: Mar 2003
Location: Hampshire, England
Posts: 12
 

Default Larger Text Area For Product Options

We have been trawling the forum for a clear answer to this question but as yet we have not found one.

We are currently upgrading to Version 4.0.16.
We would like to make the text area larger in the product options so that customers can add a gift message and be able to view their entire message as they type. We are sure it requires code in the template area but what the code is and more to the point where to put it is a small mystery! Our option class is Message with a text field as it's option.
Reply With Quote
  #2  
Old 03-28-2006, 07:17 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default

You need to edit skin1/modules/Product_Options/customer_options.tpl. Change this bit of code to text field:

Code:
<INPUT id="po{$v.classid}" type="text" name="{$poname}" value="{$v.default|escape}">
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #3  
Old 03-28-2006, 07:40 AM
 
johnoc johnoc is offline
 

Member
  
Join Date: Mar 2003
Location: Hampshire, England
Posts: 12
 

Default

Thanks for the swift reply Balinor -

We only want to create a larger text area for one option class which is the "Message" the other option classes that require text are fine as the standard issue text box.
Is this possible or will we need to make all the text boxes the same size in this area?
If this is possible, do you have any advice on the code we need to use.

Thanks.
Reply With Quote
  #4  
Old 03-28-2006, 10:11 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default

Ok, try this. Replace this:

Code:
<INPUT id="po{$v.classid}" type="text" name="{$poname}" value="{$v.default|escape}">

with this:

Code:
{if $v.classtext eq 'option text here'} <textarea id="po{$v.classid}" type="text" name="{$poname}" value="{$v.default|escape}" cols="60" rows="10"></textarea> {else} <INPUT id="po{$v.classid}" type="text" name="{$poname}" value="{$v.default|escape}">{/if}

replace 'option text here' with the actual Option text of the option you want to display the text field for. Let me know if it works for you.
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #5  
Old 03-29-2006, 06:47 AM
 
johnoc johnoc is offline
 

Member
  
Join Date: Mar 2003
Location: Hampshire, England
Posts: 12
 

Default

Tried the code out and it worked thank you so much - you helped resolve a very agrivating problem that was sending us all here a little crazy!!! - Alison.

__________________
X-Cart version 4.1.0
PHP 4.4.2
MySQL Server 4.0.26-log
MySQL Client 5.0.21
Web Server Apache
Perl 5.008008
Reply With Quote
  #6  
Old 09-08-2006, 07:51 PM
 
yages yages is offline
 

eXpert
  
Join Date: Sep 2004
Location: Australia
Posts: 332
 

Default Re: Larger Text Area For Product Options

How do you stop the text from continuing on the same line
I want it to auto drop to the next line when it comes to the end of the box
__________________
yages
x-cart version 4.5.5
Reply With Quote
  #7  
Old 09-08-2006, 08:33 PM
 
inebriate inebriate is offline
 

eXpert
  
Join Date: May 2006
Posts: 301
 

Default Re: Larger Text Area For Product Options

in textarea add wrap=hard, or soft...depending if you want the carriage return to be included or not, also this may not work on all browsers
__________________
x-cart pro 4.0.18
linux
www.fabric8d.com (currently undergoing construction)
Reply With Quote
  #8  
Old 09-08-2006, 09:00 PM
 
yages yages is offline
 

eXpert
  
Join Date: Sep 2004
Location: Australia
Posts: 332
 

Default Re: Larger Text Area For Product Options

add the word wrap=hard in text area, did not work
I am using firefox browser
__________________
yages
x-cart version 4.5.5
Reply With Quote
  #9  
Old 09-08-2006, 09:41 PM
 
inebriate inebriate is offline
 

eXpert
  
Join Date: May 2006
Posts: 301
 

Default Re: Larger Text Area For Product Options

dont think wrapping works in firefox
probably possible to make it compatible with all 3 using javascript
__________________
x-cart pro 4.0.18
linux
www.fabric8d.com (currently undergoing construction)
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 06:38 AM.

   

 
X-Cart forums © 2001-2020