Change style of ver registration form

  • Posts: 11
  • Thank you received: 0
9 years 5 months ago #180659

-- HikaShop version -- : 2.3.4
-- HikaMarket version -- : 1.5.1
-- Joomla version -- : 3.3.6
-- PHP version -- : 5.3.29
-- Browser(s) name and version -- : Chrome 38.0.2125.111 m, Firefox 33.1.1

A have some question on how to change the vendor registration form. What I want to achieve is the following:

  • move the asterixes right behind the textboxes
  • create tip messages behind some of the fields
  • change the order of the checkbox (checkbox first, then label)
  • make a link of the (checkbox) label to an article or popup box with terms and conditions

Any ideas? Screenshot attached.

Thanks in advance.

Attachments:
Last edit: 9 years 5 months ago by snarf-eu.

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

  • Posts: 26007
  • Thank you received: 4004
  • MODERATOR
9 years 5 months ago #180669

Hi,

These fields are displaying thanks to HikaShop custom fields.
So if you want to change how the custom fields are display, you will have to create a view override for the "vendormarket | registration" view and change how the custom fields are displayed.

To move the asterisk, you have to use such code

if($oneExtraField->field_required) echo '* ':
$oneExtraField->field_required = false;
echo $this->fieldsClass->display(
	$oneExtraField,
	$value,
	'data['.$this->form_type.']['.$fieldName.']',
	false,
	' ' . $onWhat . '="hikashopToggleFields(this.value,\''.$fieldName.'\',\''.$this->form_type.'\',0,\'hikamarket_\');"',
	false,
	$this->extraFields['vendor'],
	@$this->element
);
To display some special text, you have to use the variable "$fieldName" and display a message depending the value (which is the namekey of the custom field).
Same thing for the link you want to add, the best is to display your custom content depending the variable "$fieldName".

About the checkbox, it is displayed directly by the HikaShop field class.
it is not something I will recommend but the best way to change it is to modify the HikaShop core file.
Are you sure you can't do something using CSS ?

Regards,


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

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 11
  • Thank you received: 0
9 years 5 months ago #181028

Hello Jerome,

Thank you for your reply, but i'm still struggling.

  • For the asterix; could you please be more specific on where to add the code? I've tried to add it to vendormarket / registration, but it ended up as a broken form.
  • For the extra tips; can you give a full example for address maybe?
  • For the checkbox; which core files do I need to change and where
  • .
As you can see i'm not 100% familiar with coding.

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

  • Posts: 26007
  • Thank you received: 4004
  • MODERATOR
9 years 5 months ago #181077

Hi,

1/ In the view "vendormarket | registration" there are 3 "blocks" which display custom fields.
I gave you a sample for the "block" vendor which is the last block in the view.
But the idea of the modification is to add the two lines before the line

echo $this->fieldsClass->display(
You can perform that modification in every blocks without having to copy/past the rest of the code, just the first two lines (which have to be added).

2/ Here an example
	echo $this->fieldsClass->display(
		$oneExtraField,
		@$this->address->$fieldName,
		'data[address]['.$fieldName.']',
		false,
		' '.$onWhat.'="hikashopToggleFields(this.value,\''.$fieldName.'\',\'address\',0);"',
		false,
		$this->extraFields['address'],
		$this->address
	);
	//-- Begin of sample code
	if($fieldName == 'iban')
		echo ' ' . JText::_('IBAN_TIPS_TEXT');
	if($fieldName == 'iban2')
		echo ' ' . JText::_('IBAN2_TIPS_TEXT');
	//-- End of sample code
?></dd>
The field names "iban" and "iban2" are just example ; You have to replace them with the namekey of your custom fields.

3/ The file is "administrator/components/com_hikashop/classes/field.php"
You have to change that line
$string .= '<input type="'.$type.'" name="'.$map.'" value="'.$oneValue.'" id="'.$id.'" '.$checked.' '.$options.' /><label for="'.$id.'">'.$this->trans($title->value).'</label>';

Regards,


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

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
The following user(s) said Thank You: snarf-eu

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

  • Posts: 11
  • Thank you received: 0
9 years 4 months ago #183300

Ok, i have found a way make it work, but i'm going to ignore the asterix thing and just use:
echo ' ' . JText::_('my_string'); instead for the required fields as you described earlier.

Those little anoying asterixes cost me too much time already.

Last edit: 9 years 4 months ago by snarf-eu.

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

Moderators: Obsidev
Time to create page: 0.050 seconds
Powered by Kunena Forum