Point user to Easysocial registration before purchase

  • Posts: 32
  • Thank you received: 0
8 years 1 month ago #251907

-- HikaShop version -- : 2.6.3
-- Joomla version -- : latest
-- PHP version -- : 5.5.22

Hi,

Please can you help me with the following:-
My site uses Hikashop and Hikamarket along with Easysocial. I use the registration process in Easysocial for all user registrations to use my site. However, I noticed that if a non-registered user attempts to purchase a product from my site, my Hikashop is giving them a separate registration form.
1. In such a case, I would like Hikashop to send the user to my EasySocial registration page and once they've registered, display the checkout page they were on in order to proceed. So essentially, as an example from this page - quantumoffice.co.uk/checkout/checkout/task-step/step-1
to this page - quantumoffice.co.uk/members-login and then take them back to their shopping cart page.

2. When my user has registered in Easysocial, I would like their details to be updated in Hikashop.

3. Lastly, how do I update my Hikashop and Hikamarket versions? Within joomla admin updates, it does not give me a option to do so,

I would be grateful for your help.

Thanks
Ian

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

  • Posts: 32
  • Thank you received: 0
8 years 1 month ago #251909

On point 3. I have now updated my Hikashop and Hikamarket to the latest versions so please disregard that point.

Looking forward to your help with the other points.

Thanks
Ian

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
8 years 1 month ago #251964

Hi,

1. To direct the customer to another page if he is not logged in, you can edit the file "step" of the view "checkout" via the menu Display>Views and add such code at the top:

<?php $user = Jfactory::getUser(); 
if($user->guest){
$app = JFactory::getApplication();
$app->redirect('http://quantumoffice.co.uk/members-login');
}
?>
I don't know how to redirect the user to the checkout after the registration. That's something you'll have to see with the EasySocial support and it will require modfying a view of EasySocial or integrating a custom plugin with it in some way or another.

2. By "details" I suppose that you're talking about the address details. That would require a custom plugin to integrate with the EasySocial registration system to store the data in the HikaShop user address after the registration. Again, that's something you'll have to see with the EasySocial support or a third party developer.

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

  • Posts: 32
  • Thank you received: 0
8 years 1 month ago #252058

Hi
Thanks for your reply.

However, how do i find the exact file and how do I edit it? There are so many files being listed in checkout under >Display / views.
Please see attached screenshot

Thanks
Ian

Attachments:

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
8 years 1 month ago #252077

Hi,

As I said, you need to edit the file "step" of the view "checkout". So search for "step" in the search box and you'll find what you're looking for. Make sure that you're editing it for your frontend template and not another template or you won't see any change.

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

  • Posts: 32
  • Thank you received: 0
8 years 1 month ago #252223

Hi,

I have tried searching for "step" in the main search box as well as the 'Display' search box and nothing comes up. I get the message 'Your search did not match any documents'
I'm not sure where I need to insert that code you provided so I've contacted the Easy Social support team, who have helped me do this but they are requesting I contact the Hikashop support team to give them code so that they can use some of the code to detect if the current user already "Add cart" at least 1 item, so I can redirect to checkout page, else just redirect back to community page.

This is the reply I have got from my EasySocial support team:-
_________________________________________________________________

Hey lan,
Yes, I also didn't get what his said the file location, I feel curious why he do want directly list out this file path location -> /public_html/components/com_hikashop/views/checkout/tmpl/step.php , I already added above code into this file, so if that is guest user access the checkout page, it will redirect to Easysocial login page.

Then I've tried to check and see is it possible to do it, but unfortunately that was not possible to achieve this, because system do not know this user is it want to click from checkout or this user only want to login from your site community site.

But the possible way is no matter what, when the user login from your site, all redirect to checkout page, I am not really is it you accept this ideas or not.

And another way is consult with Hikashop developer and see whether I can use some of the code to detect if the current user already "Add cart" at least 1 item, so I can redirect to checkout page, else just redirect back to community page.

________________________________________________________________________________________

So I do not want all users to be redirected to the checkout page on logging in. However, If a non-registered user attempts to buy a product, adds to cart and clicks 'Proceed to checkout', only in that case, I would like the user to be presented with the EasySocial login page and on successful login, they should be redirected to the 'Checkout page'.

Please can you assist me with this?

Thanks
Ian

Last edit: 8 years 1 month ago by Ian7.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
8 years 1 month ago #252250

Hi,

1. If you add the code directly in the file components/com_hikashop/views/checkout/tmpl/step.php, you'll loose your changes next time you update HikaShop. That's why I recommended instead to edit it via the menu Display>Views.
Here is a tutorial on how to edit view files:
www.hikashop.com/support/documentation/1...-display.html#layout

2. To load the cart of the current user, such code can be used:

include_once(rtrim(JPATH_ADMINISTRATOR,DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR.'components'.DIRECTORY_SEPARATOR.'com_hikashop'.DIRECTORY_SEPARATOR.'helpers'.DIRECTORY_SEPARATOR.'helper.php');
$cartClass = hikashop_get('class.cart');
$cart = $cartClass->loadFullCart();
Then, you can check the number of products in the cart like that:
if(!empty($cart->products) && count($cart->products)){
// redirect to the checkout
}

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

  • Posts: 32
  • Thank you received: 0
8 years 1 month ago #252450

Hi Nicolas,

Thank you for your help. Issue resolved now.
Much appreciated.

Best regards,
Ian

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

Time to create page: 0.070 seconds
Powered by Kunena Forum