Add radio button to switcher checkout

  • Posts: 1057
  • Thank you received: 11
  • Hikashop Business
8 years 4 months ago #244936

-- HikaShop version -- : 2.6.0
-- Joomla version -- : 2.5.28
-- PHP version -- : 5.4

Hello,

in checkout / login.php file i have added a div called "guest" with a link to a custom page. There are the 2 radio buttons above that (login-register), can i make the "guest" button also a radio button?

Thank you in advance

Attachments:

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

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
8 years 4 months ago #244942

Hi,

Yes. Make sure that the input radio of your choice has the name

data[register][registration_method]
so that it is in the same group as the other ones. And add an onchange attribute to it with your javascript code to hide/display your div.

The following user(s) said Thank You: verzevoul

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

  • Posts: 1057
  • Thank you received: 11
  • Hikashop Business
8 years 4 months ago #244991

nicolas hi,

I m a bit low on javascript so if you could tell me how to do that i would really aprecciate it!
I will send you admin via email if you may please take a look.

Thank you!

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

  • Posts: 4753
  • Thank you received: 644
  • MODERATOR
8 years 4 months ago #245015

Hello,

You have to use "onclick" with some parameters in order to redirect when your customer click on the Guest checkbox.

Try to use this code IN <fieldset class="input"> like this :

...
  $doc->addScriptDeclaration("\n<!--\n".$js."\n//-->\n");
  echo JHTML::_('hikaselect.radiolist',  $values, 'data[register][registration_method]', ' onchange="displayRegistration(this)"', 'value', 'text', $defaultSelection, false, false, true );
?>
			<div class="crisregister">
				<input class="crisregister" type="radio" name="data[register][registration_method]" id="data[register][registration_method]0" value="0" onclick="window.location.href='index.php?option=com_fabrik&view=form&formid=1&Itemid=305'"/>Guest
			</div>
      </fieldset>
...

And of course, remove this line :
<div class="crisregister"><a href="index.php?option=com_fabrik&view=form&formid=1&Itemid=305">Guest</a></div>

Hope this will fit your needs.

Regards

Last edit: 8 years 4 months ago by Philip.
The following user(s) said Thank You: verzevoul

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

  • Posts: 1057
  • Thank you received: 11
  • Hikashop Business
8 years 4 months ago #245071

Hello Philip,

thanks that's great! One more thing if possible, could the guest button display the form in the checkout page like login and regigister, instead of redirecting to another page?

Thank you

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

  • Posts: 4753
  • Thank you received: 644
  • MODERATOR
8 years 4 months ago #245073

Hello,

This is possible thanks to Javascript but that require some developer skills, ton use some radio button to leads to display or not.
See this example, here .

And you have the Javascript documentation reference, here .
If this is a little too much for you you can contact some developer, here on our Partner page .

Regards

Last edit: 8 years 4 months ago by Philip.
The following user(s) said Thank You: verzevoul

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

Time to create page: 0.072 seconds
Powered by Kunena Forum