ACL after payment not working until user logs out

  • Posts: 10
  • Thank you received: 1
11 years 2 months ago #120981

My checkout flow is set up as cart, payment then login (registration). This works great. After payment through Authorize.net's payment form the user is redirected back to the site and they are already logged in.

I have Hikashop set up to add the user to the Paid Member group, which it does so now this user is in the groups Registered and Paid Member. The homepage after login has an access level of Registered but another area on the site is for Paid Members. When this user clicks on the area for Paid Members, they are given a 403 error page. I have verified the ACL for the page is set to Paid Member and made sure the user is in fact part of the Paid Member user group.

I have read the thread here:
www.hikashop.com/forum/4-how-to/85750-50...ror-on-register.html

But on my site the user is logged in when they are redirected back to the site from Authorize.net. So the user has to log out and then log back in to gain access to the area for Paid Members. According to the above thread, the user should have to log in after registration, which would be fine with me but it is not working this way.

I would like for either the user to have to log in after payment or when they are redirected back to the site after payment and they are logged in, then not have to log out then log back in to be able to access the Paid Members area.

Any help will be appreciated!

-- HikaShop version -- just upgraded to Business version yesterday
-- Joomla version -- : 3.1.5

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

  • Posts: 10
  • Thank you received: 1
11 years 2 months ago #121074

I thought this was due to our Joomdle component but it is not.

When a user is registered through the checkout process I am seeing the behavior that I described above - when the user is redirected back to the site after payment they are logged in and they have to log out and then log back in to access the restricted content.

When a user registers with the Hikashop registration that is not part of the checkout process, then the user is prompted to log in after the registration.

How can I disable the auto login for the user during the checkout process?

Last edit: 11 years 2 months ago by nijale.
The following user(s) said Thank You: Jerome

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

  • Posts: 82865
  • Thank you received: 13372
  • MODERATOR
11 years 2 months ago #121269

Auto login is necessary for the checkout.

What you can do though is to logout the user after the checkout. You can do that by adding the code below at the beginning of the file "end" of the view "checkout" via the menu Display->Views:

<?php
$this->after_end();
$app = JFactory::getApplication();
$app->logout( $this->order->customer->user_cms_id );
?>

The following user(s) said Thank You: nijale

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

  • Posts: 10
  • Thank you received: 1
11 years 2 months ago #121294

Thank you! Works perfect now :)

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

  • Posts: 10
  • Thank you received: 1
11 years 2 months ago #124770

Ok this is weird. This was working fine. But now it is not. I have the checkout set up as cart, payment, login (registration). When a user purchases the product, they are directed to the cart, payment and registration page fine but when they click on register, they are then taken to a blank page and not redirected to the Authorize.net.

I have not changed a thing except I added Akeeba subscriptions. I have since uninstalled Akeeba to see if that helped and it does not. When I take out the code to log out the user, the user is redirected to authorize.net to pay and then redirected back to the site, but the ACL does not work properly until the user logs out and then logs back in.

How can I get this to work properly with logging the user out after checkout so that after payment they need to log in?

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
11 years 2 months ago #124880

Hi,

If you have a blank page, please check your PHP error log, it will show you the PHP error message and give us more information about the problem.
You can also change your Joomla configuration in order to force the display of PHP errors, by changing the error report level to maximum or development.

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: nijale

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

  • Posts: 10
  • Thank you received: 1
11 years 1 month ago #125106

Thank you for pointing me in the right direction. Turns out this had to do with my Joomdle component. All working now.

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

Time to create page: 0.066 seconds
Powered by Kunena Forum