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

TOS registration checkbox with href in label error

Started by bart198x, June 08, 2015, 21:04:27 PM

Previous topic - Next topic

bart198x

Hi.
VM 3.0.9 J 3.4.1
I have a strange error on registration form from user/edit.php.
I've made 'COM_VIRTUEMART_STORE_FORM_TOS' override to look like : blablablab <a href="some href">REGULAMIN</a> oraz <a href="some href">POLITYKĘ PRYWATNOŚCI</a> blablablabla
Both href works fine in label, but in the general form (in FE) appears additional code like:
after button code
<div class="buttonBar-right">
</div>
appears

"REGULAMIN oraz "
<a href="some href">POLITYKĘ PRYWATNOŚCI</a>
" blablablablabla "> "
what causes a situation like the pictures
Preview photo (weird text is highlighted):

and another photo showing that TOS checkbox label with hrefs works fine:


Tested on default prostar template and my template after clean install, deleting all overrides, all the same result.
If I delete hrefs from label everything works fine so that hrefs makes the problem I think.
Making that kind operation in different places on site doesn't affect the problem.
No JS errors.
I just want to know if that is only my problem, and if not, if that can be fixed and how.

Thanks in advance.

PS. tested even with simple google link :) You can preview problem on http://test.belladonnafashion.pl/sklep/moje-konto
for awhile

bart198x

I'am replaing myself :)
There is some un functionality in this area in file edit_adress_userfields.php line about 68
$descr = empty($field['description'])? $field['title']:$field['description'];
and later the label text is taken to <tr title atribute so that's where render problem appears.
but putting some condition like $descr = ($field['name'] == 'tos')? 'tos': $descr; (for egsample) in override file, this can be bypassed.
so my file after line 68 looks like
$descr = empty($field['description'])? $field['title']:$field['description'];
// Output: Userfields
$descr = ($field['name'] == 'tos')? 'tos': $descr;
?>
<tr title="<?php echo $descr ?>">
<td class="key"  >
<label class="<?php echo $field['name'?>" for="<?php echo $field['name'?>_field">
<?php echo $field['title'] . ($field['required'] ? ' *' ''?>
</label>
</td>
<td>
<?php echo $field['formcode'?>
</td>
</tr>

it looks weird in code but works :) that 'tos' of course must match 'tos' title in user fields field