Registration fields order

  • Posts: 80
  • Thank you received: 0
5 years 8 months ago #295991

-- HikaShop version -- : 3.5.1
-- Joomla version -- : 3.8.7
-- PHP version -- : 7.0.3

Hi

How to move the Terms and Privacy boxes at the bottom of the registration form?
Please note that Terms and Privacy boxes have been created as USER custom fields (see printscreen).

How to align the check box line "Tick the box to receive our ads (optional)" ?

Thanks in advance
Imma

Attachments:

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

  • Posts: 81539
  • Thank you received: 13069
  • MODERATOR
5 years 8 months ago #296034

Hi,

You'll have to edit the file "sub_block_login_registration.php" via the menu Display->Views and move the piece:

// Custom fields
$type = 'user';
if(!empty($this->extraFields[$type])) {
	foreach($this->extraFields[$type] as $fieldName => $field) {
?>
	<div class="hkform-group control-group hikashop_registration_<?php echo $fieldName;?>_line" id="hikashop_<?php echo $type . '_' . $this->step . '_' . $this->module_position . '_' . $field->field_namekey; ?>">
		<?php
			$classname = $labelcolumnclass.' hkcontrol-label';
			echo $this->fieldsClass->getFieldName($field, true, $classname);
		?>
		<div class="<?php echo $inputcolumnclass;?>">
<?php
		$onWhat = ($field->field_type == 'radio') ? 'onclick' : 'onchange';
		echo $this->fieldsClass->display(
				$field,
				@$this->$type->$fieldName,
				'data['.$type.']['.$fieldName.']',
				false,
				' class="hkform-control" '.$onWhat.'="hikashopToggleFields(this.value,\''.$fieldName.'\',\''.$type . '_' . $this->step . '_' . $this->module_position.'\',0,\'hikashop_\');"',
				false,
				$this->extraFields[$type],
				@$this->$type,
				false
		);
?>
		</div>
	</div>
<?php
	}
}
after the piece:
if(!empty($this->options['address_on_registration']) && !empty($this->extraFields['address'])) {
	$type = 'address';
?>
	<div class="">
		<legend><?php echo JText::_( 'ADDRESS_INFORMATION' ); ?></legend>
	</div>
<?php
	foreach($this->extraFields[$type] as $fieldName => $oneExtraField) {
//		$oneExtraField->registration_page = @$this->registration_page;
?>
	<div class="hkform-group control-group hikashop_registration_<?php echo $fieldName;?>_line" id="hikashop_<?php echo $type . '_' . $this->step . '_' . $this->module_position . '_' . $oneExtraField->field_namekey; ?>">
<?php
		$classname = $labelcolumnclass.' hkcontrol-label';
//		if($oneExtraField->field_required)
//			$classname .= ' required';
		echo $this->fieldsClass->getFieldName($oneExtraField, true, $classname);
?>
		<div class="<?php echo $inputcolumnclass;?>">
<?php
		$onWhat = ($oneExtraField->field_type == 'radio') ? 'onclick' : 'onchange';
		echo $this->fieldsClass->display(
				$oneExtraField,
				@$this->$type->$fieldName,
				'data['.$type.']['.$fieldName.']',
				false,
				'class="hkform-control" '.$onWhat.'="window.hikashop.toggleField(this.value,\''.$fieldName.'\',\''.$type . '_' . $this->step . '_' . $this->module_position.'\',0,\'hikashop_\');"',
				false,
				$this->extraFields[$type],
				@$this->$type,
				false
		);
?>
		</div>
	</div>
<?php
	}
	if(!empty($this->options['same_address'])) {
?>
	<div class="hkform-group control-group hikashop_registration_same_address_line" id="hikashop_address_<?php echo $this->step . '_' . $this->module_position . '_same_address'; ?>">
		<div class="<?php echo $labelcolumnclass;?> hkcontrol-label"></div>
		<div class="<?php echo $inputcolumnclass;?>">
			<input class="hikashop_checkout_same_address_checkbox" id="hikashop_address_<?php echo $this->step . '_' . $this->module_position . '_same_address_input'; ?>" type="checkbox" name="data[same_address]" value="1"/>
			<label for="hikashop_address_<?php echo $this->step . '_' . $this->module_position . '_same_address_input'; ?>"><?php echo JText::_('SAME_FOR_SHIPPING'); ?></label>
		</div>
	</div>
<?php
	}
}

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

  • Posts: 80
  • Thank you received: 0
5 years 8 months ago #296096

Thanks a lot. It works fine for the registration form which is desplayed during the checkout.
However, regarding the registration form desplayed once I click on the button “register” ( user/form php), I still see 2 different user/custom_fields.php sections: one dedicated to checkboxes for Privacy and Terms which is desplayed before the one dedicated to telephone field and checkbox for newsletter (from AcyMailing).

I would like to move checkboxes for Privacy and Terms at the bottom of the registration form. How to do that?
Thanks in advance.

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

  • Posts: 81539
  • Thank you received: 13069
  • MODERATOR
5 years 8 months ago #296103

Hi,

For the registration form page, it's indeed in another view file.
You need to edit the file "registration" of the view "user" and swap:

$this->type = 'user';
and:
$this->type = 'address';

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

  • Posts: 80
  • Thank you received: 0
5 years 8 months ago #296136

Thanks a lot!

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

Time to create page: 0.072 seconds
Powered by Kunena Forum