Required checkbox during registration

  • Posts: 137
  • Thank you received: 2
13 years 8 months ago #12221

Hi!

We would like to have a required checkbox during registration to accept the terms and conditions. But if we set a checkbox to required it is marked as required, but you can register without checking the checkbox.

Best regards

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

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
13 years 8 months ago #12235

We were able to reproduce the problem on our end. We'll look at how we can correct it tomorrow.

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

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
13 years 7 months ago #12302

You need to replace the file media/com_hikashop/hikashop.js by the one in this archive and change the line:
if(!$field->field_required || strlen($value) || strlen($oldvalue)){
by:
if(!$field->field_required || is_array($value) || strlen($value) || strlen($oldvalue)){

in the file administrator/components/com_hikashop/classes/field.php

That should make it work.

File Attachment:

File Name: hikashop-20110327.zip
File Size:1 KB

Attachments:

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

  • Posts: 156
  • Thank you received: 0
13 years 4 months ago #20397

i see that this thread is 3 months old but i am also getting the same problem, i know i download the program after this thread was solved. my question is was this put back into the package or do i have to solve the issue with the code and file here?

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

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
13 years 4 months ago #20415

That modification was included in HikaShop.
I just tested it on our demo website and I can't register unless I check the required checkbox of the form so it works.

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

  • Posts: 156
  • Thank you received: 0
13 years 4 months ago #21049

i have registration off on my site ,and it's not working. should it be working if no registration is selected?

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

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
13 years 4 months ago #21068

What do you mean by you have registration off ? If the registration is disabled on your website, you should not see the registration form at all and you should see instead a message telling the user that the registration is disabled...

Could you give a link ?

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

  • Posts: 156
  • Thank you received: 0
13 years 4 months ago #21071

sent info view contact us

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

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
13 years 4 months ago #21077

I can't login on your htaccess authentication. Could you double check the username and password please ?

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

  • Posts: 156
  • Thank you received: 0
13 years 4 months ago #21107

resent info

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

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
13 years 4 months ago #21127

You don't have any checkbox custom field on your registration form. What you have is the terms view. The terms view is only checked at the end of the checkout and it works fine on your checkout. When I arrive at the end of the checkout, if I didn't tick the terms checkbox, I get the message:
Please accept the terms and conditions before proceeding
and I'm redirected to the step where I can do that.

The terms and conditions view of the checkout is there to ensure that the user accepts them before finishing his order, not for the registration.
If you want a terms checkbox for the registration, you should create a new custom field of the table "user" of the type "checkbox" and required instead of using that view and the users won't be able to register unless they tick that checkbox.

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

  • Posts: 156
  • Thank you received: 0
13 years 4 months ago #21682

Can i make so it only Shows up on the first view and they can't go on without selecting it there. as of right now it lets me go all the way to the fields view and the terms radio box doesn't show up there. when i click next though it take me back to the Shipping and billing address view. I don't want any confusion with it taking them back so i would like it to be enforced on the first or last view.

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

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
13 years 4 months ago #21687

Sure. You need to change your checkout workflow for that. You can move the view fields_ from the last step to the first step and voilà.

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

  • Posts: 156
  • Thank you received: 0
13 years 3 months ago #22151

what i am trying to get done is. To have that same checkbox for the terms and conditions on the first view and only there... if they don't agree by clicking on it the msg comes up there.. i must have it work like that.

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

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
13 years 3 months ago #22157

I understand but that's not how the system is done... If you want you can directly edit the file components/com_hikashop/controllers/checkout.php and change the code:
function after_terms(){
$app =& JFactory::getApplication();
$app->setUserState( HIKASHOP_COMPONENT.'.checkout_terms', JRequest::getInt('hikashop_checkout_terms',0) );
return true;
}

to:
function after_terms(){
$app =& JFactory::getApplication();
$app->setUserState( HIKASHOP_COMPONENT.'.checkout_terms', JRequest::getInt('hikashop_checkout_terms',0) );
return $this->check_terms();
}

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

  • Posts: 156
  • Thank you received: 0
13 years 3 months ago #22459

The Above code made it so it doesn't pass step 2, where do i make the modification so it doesn't go pass step 1 if it's unchecked. Also where can I find the code that echos that field out? i would like it at the top of the registration form.

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

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
13 years 3 months ago #22465

Did you put the terms view on the first step of the checkout workflow ?

The terms checkbox is displayed by the terms file of the view checkout.

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

  • Posts: 156
  • Thank you received: 0
13 years 3 months ago #22471

That put it at the top. All i need it to do now is make sure that it doesn't go to step 2 without it being checked. Any ideas?

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

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
13 years 3 months ago #22511

What you could do is to edit the file step of the view checkout and add a javascript check on the next button in order to forbid the user to go to the next step if he doesn't check the terms and conditions.

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

  • Posts: 137
  • Thank you received: 2
13 years 3 months ago #23138

Well, after the update to 1.5.3 the problem is back. You can register without checking the checkbox!

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

Time to create page: 0.094 seconds
Powered by Kunena Forum