News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

BillTo input fields default value change to placeholder

Started by ronjb, July 22, 2013, 12:26:24 PM

Previous topic - Next topic

ronjb

Where can i find the file where i can change the <input value="" (to) placeholder=""> so the user wouldn't have to delete the default value i put in for sample on the shopper fields manager?

I have searched for hours but all i found is the table

<tr>
    <td>
           <label>etc</label>
   </td>

   <td>
           <?php echo $field['formcode'] ?>
   </td>
</tr>

So can anybody help me find this formcode source??

please help have spent lots of time looking for this but i just can't find it.. :(

Thanks a lot in advance

Maxim Pishnyak

So you are not able to create some constant default value in Shopper Fields VM section at backend?
You can support Community by voting for Project on the JED
https://extensions.joomla.org/extension/virtuemart/#reviews
Join us at
https://twitter.com/virtuemart

ronjb

i can but if the user inputs he's value they have to delete the default value i have set on the shoppers fields,, so what i want to do is switch or change the default value to be on a <input placeholder=""> and not as a value so that the user don't have to delete the default i have set..

here's what the site looks: http://papyrusinc.com/services/in-house-services/user/editaddresscartBT

and this is what i'm trying to get, http://www.w3schools.com/tags/tryit.asp?filename=tryhtml5_input_placeholder

i just need to find the place where this <?php echo $field['formcode'] ?> points to so i can somehow change the value as a placeholder

Thanks in advance

Maxim Pishnyak

Quote from: ronjb on July 24, 2013, 14:54:16 PM
i can but if the user inputs he's value
can you don't allow user to input he's value THERE?
You can support Community by voting for Project on the JED
https://extensions.joomla.org/extension/virtuemart/#reviews
Join us at
https://twitter.com/virtuemart

ronjb

Quote from: Maxim Pishnyak on July 24, 2013, 16:59:28 PM
Quote from: ronjb on July 24, 2013, 14:54:16 PM
i can but if the user inputs he's value
can you don't allow user to input he's value THERE?

i want to allow the users to input there own value but they don't have to delete the default value i set,, it will be auto deleted once the user click the input textbox field..

just like this http://www.w3schools.com/tags/tryit.asp?filename=tryhtml5_input_placeholder

Maxim Pishnyak

It's possible to add default value to the VM user field label.

Also VM user field description (tip cloud) could be used for describing customers behavior of this specific field.

Could you make a little experiment about that and post here link?
You can support Community by voting for Project on the JED
https://extensions.joomla.org/extension/virtuemart/#reviews
Join us at
https://twitter.com/virtuemart

ronjb

Quote from: Maxim Pishnyak on July 24, 2013, 22:18:15 PM
It's possible to add default value to the VM user field label.

Also VM user field description (tip cloud) could be used for describing customers behavior of this specific field.

Could you make a little experiment about that and post here link?

I tried the  VM user field description (tip cloud), and it just adds a title on the <td> of the label of the user field input textbox, have you seen the link i provided
--> http://www.w3schools.com/tags/tryit.asp?filename=tryhtml5_input_placeholder this is what i'm after for, not a title.. but to add a placeholder or switch the default value that i have input the show in a placeholder,, please see the link i have provided,,

Thanks, i just really want to know where is <?php echo $field['formcode'] ?> gets its source.. and can be the default value be change to a placeholder?

Maxim Pishnyak

We don't support hacks to VM I think.

But if you really don't like built in features of VM User Fields, I made a text search in com_virtuemart.2.0.22 archive (with the help of Total Commander):
com_virtuemart.2.0.22\administrator\components\com_virtuemart\models\customfields.php
com_virtuemart.2.0.22\administrator\components\com_virtuemart\models\userfields.php
com_virtuemart.2.0.22\administrator\components\com_virtuemart\views\orders\tmpl\order.php
com_virtuemart.2.0.22\administrator\components\com_virtuemart\views\user\tmpl\edit_shipto.php
com_virtuemart.2.0.22\administrator\components\com_virtuemart\views\user\tmpl\edit_shopper.php
com_virtuemart.2.0.22\components\com_virtuemart\views\user\tmpl\edit_address_userfields.php

From which file do you want to start?
You can support Community by voting for Project on the JED
https://extensions.joomla.org/extension/virtuemart/#reviews
Join us at
https://twitter.com/virtuemart

Stonedfury

Quote from: Maxim Pishnyak on July 27, 2013, 16:04:11 PM
We don't support hacks to VM I think.

But if you really don't like built in features of VM User Fields, I made a text search in com_virtuemart.2.0.22 archive (with the help of Total Commander):
com_virtuemart.2.0.22\administrator\components\com_virtuemart\models\customfields.php
com_virtuemart.2.0.22\administrator\components\com_virtuemart\models\userfields.php
com_virtuemart.2.0.22\administrator\components\com_virtuemart\views\orders\tmpl\order.php
com_virtuemart.2.0.22\administrator\components\com_virtuemart\views\user\tmpl\edit_shipto.php
com_virtuemart.2.0.22\administrator\components\com_virtuemart\views\user\tmpl\edit_shopper.php
com_virtuemart.2.0.22\components\com_virtuemart\views\user\tmpl\edit_address_userfields.php

From which file do you want to start?
I am not sure what file he would have to edit but I can say that it is possible without hacking VM. Just use template overrides.
I would check these 2 files first
com_virtuemart.2.0.22\administrator\components\com_virtuemart\models\customfields.php
com_virtuemart.2.0.22\administrator\components\com_virtuemart\models\userfields.php
No such thing as a stupid question, only a stupid answer. I won't ask if I know the answer or found it using the search as you suggested.

Maxim Pishnyak

Quote from: Stonedfury on July 30, 2013, 18:55:59 PM
I am not sure what file he would have to edit but I can say that it is possible without hacking VM. Just use template overrides.
I would check these 2 files first
com_virtuemart.2.0.22\administrator\components\com_virtuemart\models\customfields.php
com_virtuemart.2.0.22\administrator\components\com_virtuemart\models\userfields.php
Interesting, how it's possible to make template overrides for files in models folder?
You can support Community by voting for Project on the JED
https://extensions.joomla.org/extension/virtuemart/#reviews
Join us at
https://twitter.com/virtuemart

florihana

hey, all

this could be resolved by add this syntax:
placeholder="' . $_prefix.$_fld->name .'"

in this filed:
administrator/components/com_virtuemart/models/userfields.php

find related $_return['fields'][$_fld->name]['formcode']

inside this return html string, somme code like:

<input type="text" id="'
. $_prefix.$_fld->name . '_field" name="' . $_prefix.$_fld->name.'" size="' . $_fld->size
. '" value="' . $_return['fields'][$_fld->name]['value'] .'" '
. ($_fld->required ? ' class="required"' : '')
. ($_fld->maxlength ? ' maxlength="' . $_fld->maxlength . '"' : '')
. $readonly . ' />


add this: placeholder="' . $_prefix.$_fld->name .'" inside

then you sould be able see your form had placeholder value:

<input type="text" placeholder="company" id="company_field" name="company" size="30" value="" maxlength="50">

here is the screen shot: