First off this is not my module - it was developed by rikkouri and can be found here http://www.opencart.com/index.php?route ... 31&page=12
It's free.
It is a brilliant module if you wish to control the number of characters permitted to be entered in a text box.
Unfortunately there is/was a couple of errors which i have sorted out, as the developer has not been about.
I am not associated with this module or Rikkouri, I just want to help out.
Main thing was it would not add to the cart if set to required, so here is the code to sort that :-
At the bottom of the xml file replace the existing code of the last <file> <</file> with
<file name="catalog/view/theme/*/template/product/product.tpl">
<operation>
<search position="replace"><![CDATA[
type="text" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option['option_value']; ?>"
]]></search>
<add><![CDATA[
<?php echo ($option['option_max'] != 0) ? 'maxlength=' . $option['option_max'] : ''; ?> type="text" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option['option_value']; ?>"
]]></add>
</operation>
</file>
If you use or find this mod useful please comment and vote for it.
It's free.
It is a brilliant module if you wish to control the number of characters permitted to be entered in a text box.
Unfortunately there is/was a couple of errors which i have sorted out, as the developer has not been about.
I am not associated with this module or Rikkouri, I just want to help out.
Main thing was it would not add to the cart if set to required, so here is the code to sort that :-
At the bottom of the xml file replace the existing code of the last <file> <</file> with
<file name="catalog/view/theme/*/template/product/product.tpl">
<operation>
<search position="replace"><![CDATA[
type="text" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option['option_value']; ?>"
]]></search>
<add><![CDATA[
<?php echo ($option['option_max'] != 0) ? 'maxlength=' . $option['option_max'] : ''; ?> type="text" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option['option_value']; ?>"
]]></add>
</operation>
</file>
If you use or find this mod useful please comment and vote for it.
I wanted to add some indication for people to know how many characters were available so I added this code.
Place it after
<file name="catalog/view/theme/*/template/product/product.tpl">
You'll find it at the end of the file.
<operation>
<search position="after"><![CDATA[
<input type="text" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option['option_value']; ?>" />
]]></search>
<add><![CDATA[
<?php echo $option['option_max']." Characters Max"; ?>
]]></add>
</operation>
Change Characters Max to anything you wish as this is text.
Place it after
<file name="catalog/view/theme/*/template/product/product.tpl">
You'll find it at the end of the file.
<operation>
<search position="after"><![CDATA[
<input type="text" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option['option_value']; ?>" />
]]></search>
<add><![CDATA[
<?php echo $option['option_max']." Characters Max"; ?>
]]></add>
</operation>
Change Characters Max to anything you wish as this is text.
Hi. Is there something missing from this code. as although it displays the correct character limits, the character limitation no longer works? Am presuming this is direct replacement for the original code?
Thanks for you assistance on carrying on this project for the original poster.
Thanks for you assistance on carrying on this project for the original poster.
No this is added code :- the full code should look like this
<file name="catalog/view/theme/*/template/product/product.tpl">
<operation>
<search position="after"><![CDATA[
<input type="text" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option['option_value']; ?>" />
]]></search>
<add><![CDATA[
<?php echo $option['option_max']." Characters Max"; ?>
]]></add>
</operation>
<operation>
<search position="replace"><![CDATA[
type="text" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option['option_value']; ?>"
]]></search>
<add><![CDATA[
<?php echo ($option['option_max'] != 0) ? 'maxlength=' . $option['option_max'] : ''; ?> type="text" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option['option_value']; ?>"
]]></add>
</operation>
</file>
All it does is add extra text to the end of the text box, so shouldn't effect it in any way.
<file name="catalog/view/theme/*/template/product/product.tpl">
<operation>
<search position="after"><![CDATA[
<input type="text" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option['option_value']; ?>" />
]]></search>
<add><![CDATA[
<?php echo $option['option_max']." Characters Max"; ?>
]]></add>
</operation>
<operation>
<search position="replace"><![CDATA[
type="text" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option['option_value']; ?>"
]]></search>
<add><![CDATA[
<?php echo ($option['option_max'] != 0) ? 'maxlength=' . $option['option_max'] : ''; ?> type="text" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option['option_value']; ?>"
]]></add>
</operation>
</file>
All it does is add extra text to the end of the text box, so shouldn't effect it in any way.
Ok got it all working fine now thanks. Think I had corrupted my xml file somewhere.
Blame it on this constant heatwave we are in the middle of... lol 
This module is going to be a real benefit to a lot of folks with personalised or custom products. Thanks for all the extra work you have put into it 'pcbob'.


This module is going to be a real benefit to a lot of folks with personalised or custom products. Thanks for all the extra work you have put into it 'pcbob'.
Apologies, I should have been a little more specific.
I agree this mod is a must for anyone who uses a text box in their products. Unfortunately not heard from the developer in over a month, so unsure if he is continuing with it, and have no way to contact him.
What I would like is for a countdown to be added so you get x/x characters left, and me not being a real coder, I'm struggling.
Also to see it in a text area would be good, something i will look into.
Hopefully Rikkouri will get back into the loop and expand it more, until then I will continue to support his work
I agree this mod is a must for anyone who uses a text box in their products. Unfortunately not heard from the developer in over a month, so unsure if he is continuing with it, and have no way to contact him.
What I would like is for a countdown to be added so you get x/x characters left, and me not being a real coder, I'm struggling.
Also to see it in a text area would be good, something i will look into.
Hopefully Rikkouri will get back into the loop and expand it more, until then I will continue to support his work

NOTE: if anyone renames their admin folder, just changing the referrer in the index page of VQMOD is not sufficient to get this mod to work. There are four instances in the script of this mod, where you have to physically change the coding from 'admin' to 'new_admin_folder_name'
Just thought I'd mention it to stop anyone else scratching their heads and wondering why it had suddenly stopped working.
Just thought I'd mention it to stop anyone else scratching their heads and wondering why it had suddenly stopped working.

there's a new path replace for vqmod so that you don't have to manually modify each path
I installed the xml and sure enough it worked like a champ..the option showed up, and it limited the character space perfectly!... but when I added to cart the TEXT items would not show as a entered options..
So I was thinking maybe my theme was messing it up... so I removed the "product_options_max_length.xml" from the vqmod folder... it now works perfectly with the xml removed???!!
How can that be? Did it somehow change core code? If I need to get it back to normal (no max length) for some reason... how would I?
it's kinda spooked me since I thought vqmod did not alter core files.
Lasa2
So I was thinking maybe my theme was messing it up... so I removed the "product_options_max_length.xml" from the vqmod folder... it now works perfectly with the xml removed???!!
How can that be? Did it somehow change core code? If I need to get it back to normal (no max length) for some reason... how would I?
it's kinda spooked me since I thought vqmod did not alter core files.
Lasa2
vqmod does not replace core files, but it is used to modify any default files on your system
Hi MarketInSG,
Thank you for your comment...that is exactly what I thought but if it doesn't replace core files how come it is still showing the modification even after the "product_options_max_length.xml" has been removed (deleted) from vqmod?
... if the xml modification file is removed the modification should stop... but not this time?
Lasa2
Thank you for your comment...that is exactly what I thought but if it doesn't replace core files how come it is still showing the modification even after the "product_options_max_length.xml" has been removed (deleted) from vqmod?
... if the xml modification file is removed the modification should stop... but not this time?
Lasa2
Yes you are right! My bad, It looked like it was still working but in fact it wasn't once the xml file was removed...
I got confused, seems my eResponsive theme isn't playing nice with the extension, it's not carrying changes made with the xml to the cart.
Thanks again,
Lasa2
I got confused, seems my eResponsive theme isn't playing nice with the extension, it's not carrying changes made with the xml to the cart.
Thanks again,
Lasa2
Lasa did you try the module using the default theme? If not reload it change to the default and try again.
If you get the same result as your theme then it could be another mod causing the issue. If it works then yes it may be your theme. Depending on whether the theme was free or paid, I am willing to help you sort it, as the developer has not been around since June. (I am just a user who sorted and tweaked it)
If a free theme then there is no problem, if it is a paid one then I would suggest you contact them and ask for their help, as you could be in breach of their terms by passing it on, even for help.
Tip: how to remove a mod without deleting it.
In your ftp rename the xml file to something else by ONLY changing the extension
For example new-mod.xml would become new-mod.xmlt
this way you can re-instate the module without digging it out or downloading again.
Hope this helps
If you get the same result as your theme then it could be another mod causing the issue. If it works then yes it may be your theme. Depending on whether the theme was free or paid, I am willing to help you sort it, as the developer has not been around since June. (I am just a user who sorted and tweaked it)
If a free theme then there is no problem, if it is a paid one then I would suggest you contact them and ask for their help, as you could be in breach of their terms by passing it on, even for help.
Tip: how to remove a mod without deleting it.
In your ftp rename the xml file to something else by ONLY changing the extension
For example new-mod.xml would become new-mod.xmlt
this way you can re-instate the module without digging it out or downloading again.
Hope this helps
To save confusion from the original module and my updated one I have uploaded it. It has all the relevant code from above already added so it is just a case of drop it in the xml folder.
I once again state this is not my module, I am a user trying to help this great module work bug free.
I once again state this is not my module, I am a user trying to help this great module work bug free.
Attachments
This is the updated xml with the above code added.
I finally got my site live this weekend and without PCBob's great work on getting this extension sorted, it may have ended up being a Zen Cart powered shop instead.pcbob wrote: I once again state this is not my module, I am a user trying to help this great module work bug free.


For several of those sorts of changes, including where you see something begin "sort of" working, you'll need to flush the vqmod cache -- that yanks away its lollipop and awakens it to pay attention to what has happened that is new. You can also flush your browser cache for the same essential reason. For significant changes, flush caches -- vqmod, browser, and if necessary also /system/cache/.
ok so I install this on my site and of course it didn't let you add to cart so I found this forum and it seems to have everything I need on it however after trying to edit the xml file myself and then uninstalling it from the site I got an error in my Vqlog
REQUEST URI : /index.php/product/33-bridngroom
MOD DETAILS:
modFile : \components\com_mijoshop\opencart\vqmod/xml/product_options_max_length.xml
id : Product Options Max Length
version : 1.0.0
vqmver : 2.1.5
author : rikkouri
SEARCH NOT FOUND (ABORTING MOD): <input type="text" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option['option_value']; ?>" />
not sure what this is but when I tried to reinstall the xml it only seems to change the backend setting and nothing on the front end is effected anymore..... ugh... any ideas on how i can get this thing to work?
REQUEST URI : /index.php/product/33-bridngroom
MOD DETAILS:
modFile : \components\com_mijoshop\opencart\vqmod/xml/product_options_max_length.xml
id : Product Options Max Length
version : 1.0.0
vqmver : 2.1.5
author : rikkouri
SEARCH NOT FOUND (ABORTING MOD): <input type="text" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option['option_value']; ?>" />
not sure what this is but when I tried to reinstall the xml it only seems to change the backend setting and nothing on the front end is effected anymore..... ugh... any ideas on how i can get this thing to work?
Update: it appears to not work with Mijoshop on joolma probably an issue with Vqmod I dont believe Mijoshop software uses the Latest software from opencart and vqmod..... ended up just installing opencart as a stand alone and it seems to work perfectly.....btw Pcbob thank you for the file upload 

Hi,
Anyone else experienced this error on their website when uploading the XML file?
Notice: Undefined index: option_max in /websites/------/------/------/------/public_html/vqmod/vqcache/vq2-catalog_model_catalog_product.php on line 411
Also when the vqmod files are uploaded for this mod, nothing appears? It just provides that error above on the main website and does nothing in admin? Am I missing something? Everything is the latest release.
Thanks...
Spigz
Anyone else experienced this error on their website when uploading the XML file?
Notice: Undefined index: option_max in /websites/------/------/------/------/public_html/vqmod/vqcache/vq2-catalog_model_catalog_product.php on line 411
Also when the vqmod files are uploaded for this mod, nothing appears? It just provides that error above on the main website and does nothing in admin? Am I missing something? Everything is the latest release.
Thanks...
Spigz
Who is online
Users browsing this forum: Google [Bot] and 1 guest