Url For Guests To Register

  • Posts: 440
  • Thank you received: 20
  • Hikashop Essential
4 years 3 months ago #322713

-- HikaShop version -- : 4.3.0

Hi

I wish to change the URL for clients who then want to register after a guest checkout. The current URL is

$register_url = 'index.php?option=com_hikashop&ctrl=user&task=guest_form&order_id='.$data->order_id.$url_itemid.'&order_token='.urlencode($data->order_token);

I would like to change it to /registration-form/user/form. So would I use index.php?option=com_hikashop&view=user&layout=form before the &ctrl or /registration-form?

Thanks

David B)

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

  • Posts: 82868
  • Thank you received: 13376
  • MODERATOR
4 years 3 months ago #322715

Hi,

I'm not sure what you mean.
Do you want the new URL to be only "/registration-form/user/form" ?
In that case you want to have:

$register_url = 'index.php?option=com_hikashop&ctrl=user&task=form&Itemid=XX';
where XX is the id of the menu item with the alias "registration-form

Or maybe you want to replace guest_form by form ?
Or maybe you want to change the alias of menu item to use another menu item ? In that case, you want to change $url_itemid

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

  • Posts: 440
  • Thank you received: 20
  • Hikashop Essential
4 years 3 months ago #322742

Hi

The link relates to the Order Status Notification Subject preload in the email. When a guest clicks a link from the order email they have the opportunity to register. I want to redirect them to the page /registration-form/user/form.

So can I change $register_url = 'index.php?option=com_hikashop&ctrl=user&task=guest_form&order_id='.$data->order_id.$url_itemid.'&order_token='.urlencode($data->order_token);

to

$register_url = 'registration-form/user/form&ctrl=user&task=guest_form&order_id='.$data->order_id.$url_itemid.'&order_token='.urlencode($data->order_token);

Thanks

David B)

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

  • Posts: 82868
  • Thank you received: 13376
  • MODERATOR
4 years 3 months ago #322758

Hi,

No, you can't. That's not a valid URL.
But I still don't understand what you're trying to do.
The page registration-form/user/form is the standard registration form of HikaShop.
The page registration-form/user/guest_form is a simplified registration form which uses the parameters in the URL to get the information of the guest account so that the customer doesn't have to enter them.
So if you redirect to registration-form/user/form you don't need the extra parameters and the customer will see the normal registration form. In that case, there is no need to modify the PHP code generating the URL. You can just change the line:

$vars['ORDER_SUMMARY'] .= '<p><a href="'. $register_url .'">'.JText::_('CLICK_HERE_TO_EASILY_CREATE_YOUR_USER_ACCOUNT') . '</a></p>';
to:
$vars['ORDER_SUMMARY'] .= '<p><a href="https://www.mywebsite.com/registration-form/user/form">'.JText::_('CLICK_HERE_TO_EASILY_CREATE_YOUR_USER_ACCOUNT') . '</a></p>';
in the preload of the email.

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

  • Posts: 440
  • Thank you received: 20
  • Hikashop Essential
4 years 3 months ago #322772

Hi Nicolas

the customer tells me that there has been an issue with the Captcha when directed to the guest form. He has been directing them to the standard form.

So I would like to automate this so they go to the main registration form but with the parameters included to fill out the information if that is possible? The other option will be to remove the Captcha from the guest form if that is possible?

Thanks

David B)

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

  • Posts: 82868
  • Thank you received: 13376
  • MODERATOR
4 years 3 months ago #322783

Hi,

So if I understand correctly, the issue is that the captcha from our ReCaptcha plugin generates an error when you try to register via that guest registration form, is that correct ?
In that case, I think the best is to add the line:

if (@$_REQUEST['option']=='com_hikashop' && @$_REQUEST['ctrl']=='user' && @$_REQUEST['task']=='guest_register') return true;
after the code:
if (@$_REQUEST['option']=='com_updateme' && @$_REQUEST['ctrl']=='subscription' && @$_REQUEST['task']=='api') return true;
(two places) in the file plugins/system/recaptcha2/recaptcha2.php
That will skip the captcha check on the guest registration form as it is not necessary since the customer already validated the captcha on the guest form of the checkout.

Auto-filling the fields of the registration form with the data from the guest user is not impossible, but would require quite a bit of coding compared to the modification I propose above.

The following user(s) said Thank You: davec

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

  • Posts: 440
  • Thank you received: 20
  • Hikashop Essential
4 years 3 months ago #322790

Morning Nicolas

thanks for the reply. I have made the change as suggested.

Thanks

David B)

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

Time to create page: 0.066 seconds
Powered by Kunena Forum