Skip to main content

field layout of address fields on checkout page

11 years 10 months ago #188619 by squareweb
-- HikaShop version -- : latest
-- Joomla version -- : latest
-- PHP version -- : 5.3
-- Browser(s) name and version -- : latest

Hi,
I'd like to re-arrange field-layout of address fields on checkout page. Can't find the right view.
I've managed to do the same with the user-fields on the checkout-page but the address fields seem to be rendered different.

See screenshot please

thanks in advance.

Mark

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

11 years 9 months ago #188633 by Jerome
Hi,

Just change their ordering in the custom fields.

Regards,

Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

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

11 years 9 months ago #188671 by squareweb
Sorry Jerome,

I haven't been clear enough, my bad.
The ordering is not a problem, I do want to rearrange the label / input field / asterisk (on one line) like the user-fields above the address fields. See the attachment in previous post.

Thanks

Mark

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

11 years 9 months ago #188744 by Mohamed Thelji
Hello Mark,
The solution will be to :
- Use some CSS code : www.hikashop.com/support/documentation/1...the-display.html#css
OR
- Directly edit the code of the "Registration" file of the "User" View of your front-end template via "Hikahsop->Display->Views".

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

11 years 9 months ago #188894 by squareweb
Thanks Mohammed,

That is what i was thinking also but whatever I change in the registration-file nothing happens.
Also the way the user-fields are displayed is different then the way of displaying the address-fields.

That is why I was able to change the layout of user fields (see first attachment) but I'm tucked with the address-fields.

Seems there is another file loaded which I can't find?

Any ideas?

Thanks again.

Mark

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

11 years 9 months ago #188941 by nicolas
Hi,

You must have the "use bootstrap design" option activated in the HikaShop configuration. In that case, it's the registraion_bootstrap view file that you want to edit instead.

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

11 years 9 months ago #189083 by squareweb
Thanks Nicolas,

In this file there are no address fields. only below code loading the address.
I try to find the file with the address fields so I can change the layout like I did with the user-fields (above address fields on checkout page).
Code:
$this->type = 'address'; echo $this->loadTemplate();

Thanks again.

Mark

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

11 years 9 months ago #189090 by Jerome
Hi,

For the address and user custom fields ; when using bootstrap design, view is "user | custom_fields_bootstrap".
If you're not using the bootstrap design, the view is "user | custom_fields".

The view "registration / registration_bootstrap" are the containers for the main fields and call the other view for display the custom fields.

Regards,

Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

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

11 years 9 months ago #189125 by squareweb
Thanks Jerome,

Indeed I've found the file user | custom_fields_bootstrap.

But how can I re-arrange the layout of the fields in one line, I don't like to change the order but just the position of the label | field | mandatory-asterisk (*)

I'd like to arrange the fields like:

label * field

now its showing like

label field *


the code says:
Code:
echo $this->fieldsClass->display( $oneExtraField, @$this->$type->$fieldName, 'data['.$type.']['.$fieldName.']', false, ' '.$onWhat.'="hikashopToggleFields(this.value,\''.$fieldName.'\',\''.$type.'\',0);"', false, $this->extraFields[$type], $this->$type );

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

11 years 9 months ago #189138 by Jerome
Hi,

Great !
So the explanation of the next step is there (even if it's for HIkaMarket, the trick is the same):
www.hikashop.com/forum/23-market-how-to/...ion-form.html#180669

Regards,

Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

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

11 years 9 months ago - 11 years 9 months ago #190709 by squareweb
Thanks Jerome,

I'll have a look at that.


Mark
Last edit: 11 years 9 months ago by squareweb.

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

11 years 9 months ago #190715 by squareweb
Jerome,

Since the required update I'd like to submit is affecting the HS-core-class "administrator/components/com_hikashop/classes/field.php",
what is the best way to realise this? My view file is: user | custom_fields_bootstrap. The only function which I'd like to redefine is the field "display" function in the field.php (class). So I tried to copy this function from the field class into my view-file and rename it.... but this was not working probably because there are more (helper) classes needed.

I'd like to change the display-function in the field.php class-file without losing changes after hockshop-upgrade (see function-code below).

Hop you can guide me in right direction.

Thanks in advance.

Mark
Code:
function display(&$field, $value, $map, $inside = false, $options = '', $test = false, $allFields = null, $allValues = null, $requiredDisplay = true) { $field_type = $field->field_type; if(substr($field->field_type,0,4) == 'plg.') { $field_type = substr($field->field_type,4); JPluginHelper::importPlugin('hikashop', $field_type); } $classType = 'hikashop'.ucfirst($field_type); if(!class_exists($classType)) return 'Plugin '.$field_type.' missing or deactivated'; $class = new $classType($this); if(is_string($value)) $value = htmlspecialchars($value, ENT_COMPAT,'UTF-8'); $html = $class->display($field,$value,$map,$inside,$options,$test,$allFields,$allValues); if($requiredDisplay && !empty($field->field_required)) $html .=' <span class="hikashop_field_required">*</span>'; return $html; }

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

11 years 9 months ago #190725 by nicolas
Hi,

There is no need to copy that function in your view or change the code of the core field.php file.

There are just two simple change to do if you want the * after the label instead of after the input:
1. Add that CSS on your website in order to hide the * after the input: .hikashop_field_required{ display : none; }
2. In your view file, after the line:
<?php echo $this->fieldsClass->getFieldName($oneExtraField);?>
which displays the label, just add such code:
<?php if($oneExtraField->field_required) echo '*'; ?>

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

11 years 9 months ago - 11 years 9 months ago #190786 by squareweb
Thanks Nicolas,

Thats fine, but I do need a div-structure which is different than the core structure.
See my screen print and watch the e-mail-field. This is what I want for the address-fields to display like.

The label and asterisks are placed just before the input-field (see the e-mail-div-structure which I altered myself in the view).

Thanks so far.

Mark
Last edit: 11 years 9 months ago by squareweb.

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

11 years 9 months ago #190796 by nicolas
Hi,

So what is the problem with that ?
Just change the div structure in the view file to have what you want.
It is not related to what I said in my previous message with the * placement.

You want to move the lines:
<?php echo $this->fieldsClass->getFieldName($oneExtraField);?>
<?php if($oneExtraField->field_required) echo '*'; ?>

after:
<div class="controls">

in the view file as far as I can see in your screenshots.
The following user(s) said Thank You: squareweb

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

11 years 9 months ago #190844 by squareweb
Nicolas,

Your totally right, sometimes I'm thinking to difficult....

I've done it (see screenshot).

Thanks again.

Mark

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

Time to create page: 0.109 seconds
Powered by Kunena Forum