- Posts: 166
- Thank you received: 6
refresh page after login
4 years 3 weeks ago #344413
by jean-loup
refresh page after login was created by jean-loup
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
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.
4 years 3 weeks ago #344417
by nicolas
Replied by nicolas on topic refresh page after login
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:
in the file show_block_address that you can edit via the menu Display>Views.
So you can change that code to:
It will force the page to reload after the login.
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:
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; ?>);
});
So you can change that code to:
Code:
window.Oby.registerAjax(['checkout.user.updated','checkout.address.updated'], function(params){
window.location.reload(true);
});
The following user(s) said Thank You: jean-loup
Please Log in or Create an account to join the conversation.
4 years 2 weeks ago #344430
by jean-loup
Replied by jean-loup on topic refresh page after login
Works like a charm thank you very much
Please Log in or Create an account to join the conversation.
Time to create page: 0.200 seconds