refresh page after login

  • Posts: 163
  • Thank you received: 6
  • Hikashop Business
1 year 6 months ago #344413

Good morning,

Is there any possibility to refresh automatically a page after a customer login (during checkout process)?

Since I have 2 modules on the same page where one is displayed only for guest users (so before login) and another only for registered users (so should be after login).

Of course if I manually refresh the page it's working perfectly.

Thank you for your help

Jean-Loup

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

  • Posts: 81361
  • Thank you received: 13035
  • MODERATOR
1 year 6 months ago #344417

Hi,

There are two solutions:
- if you change your checkout workflow to have the "login" block on its own step, once the user registers/logs in the checkout will automatically move to the next step and that will require a full page change.
- Supposing you have the address and login blocks on the same step, when you register/login, the login block refreshs itself to be empty, and the empty address block refreshes itself to display the address block interface. This last part is done by the code:

window.Oby.registerAjax(['checkout.user.updated','checkout.address.updated'], function(params){
	window.checkout.refreshAddress(<?php echo (int)$this->step; ?>, <?php echo (int)$this->module_position; ?>);
});
in the file show_block_address that you can edit via the menu Display>Views.
So you can change that code to:
window.Oby.registerAjax(['checkout.user.updated','checkout.address.updated'], function(params){
	window.location.reload(true);
});
It will force the page to reload after the login.

The following user(s) said Thank You: jean-loup

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

  • Posts: 163
  • Thank you received: 6
  • Hikashop Business
1 year 6 months ago #344430

Works like a charm thank you very much

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

Time to create page: 0.061 seconds
Powered by Kunena Forum