Adress information on registration in checkout

  • Posts: 20
  • Thank you received: 0
13 years 9 months ago #8512

In the view for user, registration.php there is a bit of code loading an address template

 
     $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: 13 years 9 months ago by onisama.

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

  • Posts: 20
  • Thank you received: 0
13 years 9 months ago #8528

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.

  • Posts: 20
  • Thank you received: 0
13 years 9 months ago #8532

It required hacking core component files, but I got what I wanted.

I changed line 505 of classes/field.php from this

return '<label for="'.$this->prefix.$field->field_namekey.$this->suffix.'">'.$this->trans($field->field_realname).'</label>';

to this
$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
$html .=' *';

Thanks,
Shannon

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
13 years 9 months ago #8553

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.

  • Posts: 2
  • Thank you received: 0
13 years 7 months ago #12385

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.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
13 years 7 months ago #12398

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.077 seconds
Powered by Kunena Forum