Post by planert360 » Sat Dec 27, 2014 5:16 pm

Heres my dilema, I have a text option set up for a product, but I need to limit it to only 5 characters. I have found how to limit all text options, but I cannot do this, as eventually some will be limited to 7, 10, 15, etc characters.

I cannot locate where the options are stored (Im new to editing code) and not sure if I could find the php or tpl file that handles each individual option? I know the option ID of the option I want to limit. I also thought maybe I could add a new option type, whereas instead of calling it 'text' I could call it 'text 5' which would be a text field limited to 5 characters, or 'text 7' to limit to 7, etc.

Latest opencart ver.

Newbie

Posts

Joined
Sat Dec 27, 2014 5:09 pm

Post by planert360 » Tue Dec 30, 2014 4:38 am

So the only input anyone has are the guys pming me looking for money to fix this? I figured the forum would be more helpful then this.

Newbie

Posts

Joined
Sat Dec 27, 2014 5:09 pm

Post by GoldenTongs » Wed Dec 31, 2014 1:54 am

sad to say it is the one thing OC lacks, is a helpful community
i like OC since moving from CC
but it does lack community support
but really these days that can be said for most scripts

i am not sure what you need exactly
but you probably need to look here:
catalog/view/theme/default/template/product/product.tpl

options start on line 178
i think your looking for line 251
you may be able to use maxlength="X"

you may find this page useful
http://stackoverflow.com/questions/1046 ... essing-php

also learn how to use vqmod if you not done so already just so you you not changing anything in original files
(you write the changes in xml file instead)

http://Lilphones.com
Image


Active Member

Posts

Joined
Sun Jul 29, 2012 5:26 pm

Post by planert360 » Thu Jan 01, 2015 9:45 am

Thank you, thats about where I got with my own searching, however when I put a maxlength in there, it limits all text input options. This is what im trying to avoid as some text boxes I want a 5 character limit, some 7, some 10, ect.

When I go to my page and inspect the code from the user end, I can click the text box and see the code calling for "Option [235]" or "Option [237]" I figured these options had to be stored somewhere... if I could find that somewhere, I could limit the code in there so it would be a "per option basis". But maybe it doesn't work like that?

Why I need it: I run a custom Vinyl Decal company, and I'm trying to implement a streamlined solution to custom decals. I have "plain" products set up that you can input your own text, but for some I need to limit it.

Example: I do commercial vehicle decals, including DOT numbers and Vin information. I have two separate products, one for inputting your DOT number, one for putting in your VIN number. The way it is now, I look at the invoice and see the "DOT option" with numbers. I copy that, input "US DOT" in front of it, then set it to the plotter. I have had one individual write out his DOT number, then in the same box typed "VIN" followed by his vin. If I print this up, he would have been able to separate the letters and make 2 decals for the price of one. I did contact him and issue a refund, however I'm still out the processing fee. I want to put a 7 character limit on the DOT text field, and an 8 limit on VIN

Newbie

Posts

Joined
Sat Dec 27, 2014 5:09 pm

Post by kirkhall » Fri Jan 02, 2015 8:45 am

Hi,
We needed to limit the number of characters a customer could enter for pretty much the same reason you need them and we have it working now. It’s a beautiful thing.
I did have to pay someone to do this for me and I don’t feel right just posting the solution here without permission since that is how this person earns a living.
With that said here are some clues.
He used a free extension, one that I tried to make work myself called Product Options Max Length which is at http://bit.ly/1zXMBIO. I failed because the xml file had not been updated since OC version 1.5.5.1 and I have no clue how to update and I needed it for 1.5.6.4 which is what we are using. I realize you are on some version of 2.0 since this is the 2.0 section but maybe you can try it and figure out the changes that need to be made for your OC version. It’s just one vqmod file to make this happen in my case…..no changes to any core files.
I find that paying someone to just get it done is the best way if I spend more than an hour trying to figure out an issue myself without much progress but that’s just me. I have a guy on retainer so to speak and it is worth every penny and it’s not a lot of pennies either. I do like altering things myself when I can and I always try but sometimes I just can’t as in this case.
So, have a look at the extension and hopefully you can figure it out. If not, I know a guy.
Here are some screenshots showing how this works.

Admin
Image

Store Front
Image

Active Member

Posts

Joined
Thu May 22, 2014 11:31 am
Location - Missouri, USA
Who is online

Users browsing this forum: No registered users and 30 guests