Jump to content

Customization Field enlarge box width


Recommended Posts

In the customization I need to widen the box of the Text Field because I would like the client to put some comments in it.
I have tried the product.tpl file but could not sort it out

any clues where to enlarge the Text box width and height?

Link to comment
Share on other sites

Hi rgauci,

The customizable text field was only designed to handle a short message up to 255 characters. It is not designed for customers to enter comments. There is a text area on the third (address) step when checking out for customer comments.

If you wanted to do this, you would need to modify the database field value in ps_customized_data, changing the type from varchar(255) to text. You would then need to change the customizable text fields in product.tpl in your theme directory to text areas. For example:

<input type="text" name="textField{$field.id_customization_field}" id="textField{$customizationField}" value="{if isset($textFields.$key)}{$textFields.$key|stripslashes}{/if}" class="customization_block_input" />



to something like:

<textarea name="textField{$field.id_customization_field}" id="textField{$customizationField}" class="customization_block_input">{if isset($textFields.$key)}{$textFields.$key|stripslashes}{/if}</textarea>



Note that I haven't tested this code.

Rocky

Link to comment
Share on other sites

Thanks Rocky

It worked perfectly. Exactly what I wanted.....

I just added

rows="6" cols="85"

before the
class="customization_block_input"


just to make it a little bit wider similar to the Comments box of the contact form

many thanks again
Link to comment
Share on other sites

  • 11 months later...
Hi rgauci,
--- deleted ---



hi rocky...
ive try this trick but theres some problem
when user submit data from textarea the script will stripslashes the data, this will cause a problem to end-of-line.
after the page refreshed all end-of-line will become rn if you using windows or n

if submiting
hello
world



after the page refreshed will become

hellornworld



ok ive try to trace the problem ive found out that addTextFieldToProduct on Cart.php handle this

 
       public function addTextFieldToProduct($id_product, $index, $textValue)
       {
               global $cookie;

               $cookie->{'textFields_'.intval($id_product).'_'.intval($index)} = pSQL($textValue);
               return true;
       }



ive try to remove pSQL() function

 
       public function addTextFieldToProduct($id_product, $index, $textValue)
       {
               global $cookie;

               $cookie->{'textFields_'.intval($id_product).'_'.intval($index)} = $textValue;
               return true;
       }



well this is work, all end-of-line didnt get stripslashes

but now a now an error comes up (pop-up) when click add to cart button. the error message on snapshoot
btw even there is an error popup comes the product will go to cart after we reload or go to cart detail

you can try it @ http://kartunama.biz/


anyone can help me out... ty

24566_aQtoMLmnPNGZNY1Ni9Et_t

Link to comment
Share on other sites

  • 5 months later...
  • 3 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...