Post by pcbob » Wed Jul 17, 2013 2:58 am

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.

Newbie

Posts

Joined
Wed Jul 17, 2013 2:45 am

Post by pcbob » Wed Jul 17, 2013 6:54 pm

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.

Newbie

Posts

Joined
Wed Jul 17, 2013 2:45 am

Post by LIBERTY_GUY » Wed Jul 17, 2013 9:32 pm

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.

New member

Posts

Joined
Fri Jun 21, 2013 5:14 pm

Post by pcbob » Wed Jul 17, 2013 10:09 pm

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.

Newbie

Posts

Joined
Wed Jul 17, 2013 2:45 am

Post by LIBERTY_GUY » Wed Jul 17, 2013 10:34 pm

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 ;D

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'.

New member

Posts

Joined
Fri Jun 21, 2013 5:14 pm

Post by pcbob » Wed Jul 17, 2013 10:58 pm

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 :)

Newbie

Posts

Joined
Wed Jul 17, 2013 2:45 am

Post by LIBERTY_GUY » Wed Jul 31, 2013 1:12 pm

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. :choke:

New member

Posts

Joined
Fri Jun 21, 2013 5:14 pm

Post by MarketInSG » Wed Jul 31, 2013 2:11 pm

there's a new path replace for vqmod so that you don't have to manually modify each path


User avatar
Guru Member

Posts

Joined
Wed Nov 16, 2011 11:53 am
Location - Singapore

Post by lasa » Sun Aug 04, 2013 12:03 am

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

Active Member

Posts

Joined
Tue Apr 16, 2013 9:11 am

Post by MarketInSG » Sun Aug 04, 2013 10:42 am

vqmod does not replace core files, but it is used to modify any default files on your system


User avatar
Guru Member

Posts

Joined
Wed Nov 16, 2011 11:53 am
Location - Singapore

Post by lasa » Sun Aug 04, 2013 3:21 pm

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

Active Member

Posts

Joined
Tue Apr 16, 2013 9:11 am

Post by lasa » Sun Aug 04, 2013 4:12 pm

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

Active Member

Posts

Joined
Tue Apr 16, 2013 9:11 am

Post by pcbob » Mon Aug 05, 2013 10:15 am

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

Newbie

Posts

Joined
Wed Jul 17, 2013 2:45 am

Post by pcbob » Mon Aug 05, 2013 10:26 am

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.

Attachments

This is the updated xml with the above code added.


Newbie

Posts

Joined
Wed Jul 17, 2013 2:45 am

Post by LIBERTY_GUY » Tue Aug 06, 2013 1:54 am

pcbob wrote: I once again state this is not my module, I am a user trying to help this great module work bug free.
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. ::) Without being able to limit text length, the basic text input options in OpenCart just wouldn't have been suitable, so a big thank you from one happy user. :)

New member

Posts

Joined
Fri Jun 21, 2013 5:14 pm

Post by butte » Wed Aug 07, 2013 11:18 am

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/.

Guru Member

Posts

Joined
Wed Mar 20, 2013 6:58 am

Post by therealzink » Mon Aug 26, 2013 6:25 am

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?

Newbie

Posts

Joined
Mon Aug 26, 2013 6:07 am

Post by therealzink » Tue Aug 27, 2013 5:55 am

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 :)

Newbie

Posts

Joined
Mon Aug 26, 2013 6:07 am

Post by pcbob » Tue Aug 27, 2013 9:26 am

It's a shame the original developer is not about - rikkouri - as I am sure he would be able to sort it.

Newbie

Posts

Joined
Wed Jul 17, 2013 2:45 am

Post by spigz » Mon Sep 30, 2013 6:41 am

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

Newbie

Posts

Joined
Mon Sep 30, 2013 5:42 am
Who is online

Users browsing this forum: No registered users and 11 guests