VirtueMart Forum

VirtueMart 2 + 3 + 4 => Product creation => Topic started by: treodude on July 11, 2013, 12:43:24 PM

Title: Custom Fields Capital Letters Only
Post by: treodude on July 11, 2013, 12:43:24 PM
Dear Virtuemart Forum,

For our webshop it is necessary that the text customers put in, is in capitals.
Is there any way that I can disable small letters, or make all letters automatically capital?

Using J2.5.9 and VM2.0.20b

Kind regards,

Treodude
Title: Re: Custom Fields Capital Letters Only
Post by: Maxim Pishnyak on July 11, 2013, 21:31:58 PM
Just googled "capitalize php"
http://php.net/manual/en/function.strtoupper.php
Title: Re: Custom Fields Capital Letters Only
Post by: treodude on July 15, 2013, 13:16:33 PM
Thanks!

Only one problem. I am not that big of a php expert, and neither do I know where to find all files.
I have a shopping cart as well, the one from VM AIO, which displays the letters, and all other default VM places where you can see your chosen products.

Where can I find the files in which I have to edit this in?

Kind regards,

Treodude
Title: Re: Custom Fields Capital Letters Only
Post by: Maxim Pishnyak on July 15, 2013, 22:17:39 PM
Could you post here link where do you want upper case?
Title: Re: Custom Fields Capital Letters Only
Post by: treodude on July 17, 2013, 14:55:42 PM
http://www.edsclassic.com/index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=42&virtuemart_category_id=10&Itemid=163

If you go to this link, you will find (one of the several) where the Custom Field is; VUL HIER JE KENTEKEN IN (Dutch for; insert here your car license number)

Basically, actually has to be capitals. I think it is the best to convert the Customer Input the moment the Input is made. So, capitalize the value automaticaly, so it shows up everywhere in capitals.
This might be better because besides the locations noted above, there are several other locations where the license number shows up, and all of them have to be capitalized.
Title: Re: Custom Fields Capital Letters Only
Post by: Maxim Pishnyak on July 17, 2013, 16:03:26 PM
You know what plugin with its files need to be explored in your case.
Title: Re: Custom Fields Capital Letters Only
Post by: treodude on August 08, 2013, 14:50:20 PM
Well, I will try, since there are too many plugins too explain, but I think I can handle it.

Thanks for your help!
Title: Re: Custom Fields Capital Letters Only
Post by: treodude on August 09, 2013, 13:27:39 PM
Well, eehm, I have one more question.

It is sufficient enough to capitalize the input inmediatly.
I searched in the plugins/vmcustom/textinput/index.php for the variable the input was, but I can't find it.

Where do I have to insert that capitalize line in order to capitalize all?

Kind regards,

Treodude
Title: Re: Custom Fields Capital Letters Only
Post by: Maxim Pishnyak on August 09, 2013, 13:56:44 PM
Did you try to work with this part:
<input class="<?php echo $class ?>" type="text" value="" size="<?php echo $this->params->custom_size ?>" name="customPlugin[<?php echo $viewData[0]->virtuemart_customfield_id ?>][<?php echo $this->_name?>][comment]"><br />

?
Title: Re: Custom Fields Capital Letters Only
Post by: treodude on August 09, 2013, 16:27:07 PM
*textinput.php, not index.php

And in textinput.php, I cannot find the line you mentioned.
Maybe the wrong file?

Also, I jsut upgraded to J2.5.14 and VM2.0.22a
Title: Re: Custom Fields Capital Letters Only
Post by: Maxim Pishnyak on August 09, 2013, 22:31:25 PM
default.php in com_virtuemart.2.0.22_ext_aio\admin\plugins\vmcustom\textinput\textinput\tmpl\
is also part of textinput plugin
Title: Re: Custom Fields Capital Letters Only
Post by: treodude on August 13, 2013, 16:09:29 PM
Thanks, I found the file, but how should I modify it?

The link you sent first was about mentioning a valuable to become uppercase, "string" strtoupper ("string" $string).
But I don't see any valuable, and I have also taken a look at the examples, but I still don't know.

Can you please help once more?

Kind regards,

Treodude