| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Mod to set max lenght for product option text fields | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||||
|
|||||||||
Mod to set max lenght for product option text fields
Hi guys,
I want to share a small mod to set the max number of characters for product option text fields. I was asked about this feature several times in the last week and here it is. Example: Monogram field for each product - 3 characters max. http://regalfav.finestshops.com/store/customer/product.php?productid=149 Here is the code: skin1/modules/Product_Options/product_options.tpl change this one: Code:
to this: Code:
Now, just use "optionclass_maxlength" format for product option class. Like "Message_10" to restrict "Message" filed to 10 characters or "Monogram_3" field to restrict Monogram field to 3 characters. Hope this will help somebody. Should work in any version. |
|||||||||
#2
|
|||||||||
|
|||||||||
Nice output, thanx. I am not using it at the moment but could be handy.
__________________
It doesn\'t matter what is done... it is how it is done. ============================= XCart Version: 3.5.3 -> Dmcigars.com XCart Version: 4.1.3.... |
|||||||||
#3
|
|||||||
|
|||||||
Interesting and much cleaner approach than what I had done in the past. I actually modified the table structure to include a couple of new fields to identify type of field (Monogram versus Embroidery as an example), size of field, etc. I then modified the admin interface to allow those fields to be defined easily on a product by product basis. With some strong rules on how to name the type fields, this is interesting.
I also had to adjust the price for monogramming based upon how many characters were entered (first 10 characters for $30, $3 per character thereafter, with a max of 30 as an example). I ended up modifying that in the cart calculation code. Do you have any variable costs issues like this that you have dealt with? Upgrading the cart becomes quite difficult with the way I implemented it and am now ready to rethink it as I am doing an upgrade now.
__________________
-Derrick FreeRangeMinds, LLC |
|||||||
#4
|
|||||||
|
|||||||
I tried implementing this mod, but couldn't find the code: <input type=text name="product_options[{$product_options[product_option].optclass}]" size=32> in skin1/modules/Product_Options/product_options.tpl
I'm using version 4.0.8. Any ideas where I can find it?
__________________
Version 4.0.8 Live |
|||||||
|
|||
X-Cart forums © 2001-2020
|