Skip to main content

Adress information on registration in checkout

More
15 years 7 months ago - 15 years 7 months ago #8512 by onisama
In the view for user, registration.php there is a bit of code loading an address template
Code:
$this->type = 'address'; echo $this->loadTemplate();

What is this actually loading? I'd like to modify the markup for the address information fields, in particular move the required "*" between the label and the input, rather than after the input and add a span tag around the "*".

I can't seem to find where this is being pulled from. None of the views for user, address, or checkout seem to have what I'm looking for.

Thanks,
Shannon
Last edit: 15 years 7 months ago by onisama.

Please Log in or Create an account to join the conversation.

More
15 years 7 months ago #8528 by onisama
I was able to find the markup in custom_fields.php and I found where the "*" in classes/field.php on line 640, but I haven't quite figured out how to add the "*" to the end of the label, rather than the input.

Thanks,
Shannon

Please Log in or Create an account to join the conversation.

More
15 years 7 months ago #8532 by onisama
It required hacking core component files, but I got what I wanted.

I changed line 505 of classes/field.php from this
Code:
return '<label for="'.$this->prefix.$field->field_namekey.$this->suffix.'">'.$this->trans($field->field_realname).'</label>';

to this
Code:
$req = ''; if(!empty($field->field_required)){ $req = '<span class="required">*</span>'; } return '<label for="'.$this->prefix.$field->field_namekey.$this->suffix.'">'.$this->trans($field->field_realname).'</label>'.$req;

and then commented line 640 out
Code:
$html .=' *';

Thanks,
Shannon

Please Log in or Create an account to join the conversation.

More
15 years 7 months ago #8553 by nicolas
Thank you for posting the answer. I'm sure someone else will find that useful !

Please Log in or Create an account to join the conversation.

More
15 years 6 months ago #12385 by soap_box
Thanks to OP, I found this through Google and it was exactly what I was looking for.

To clarify for anyone who might not be as accustomed to modifying core files, the classes folder is found at /administrator/components/com_hikashop/classes

And the lines mentioned above may have changed slightly in newer versions, for me they were lines 518 and 657 respectively (after pasting in the code).

This was quite hard to find, considering the fields for the login and user info were hard coded in the front-end template folders, the the fields for address (directly below in the checkout) were buried in the administrators classes folder. Hopefully something which could be made slightly more accessible in the future?

Please Log in or Create an account to join the conversation.

More
15 years 6 months ago #12398 by nicolas
We'll look at making that modification easier then :)

Please Log in or Create an account to join the conversation.

Time to create page: 0.182 seconds
Powered by Kunena Forum