Knowledgebase
Maestrel > Help Desk > Knowledgebase

Browse our knowledgebase...




 
Knowledgebase » Troubleshooting »

I use WooCommerce and a user with HBook role is redirected to WooCommerce "my-account" page. How to disable this redirection?

Answer

If you are using WooCommerce plugin and have created users with HBook roles, you should prevent WooCommerce redirection after login.

Please add this code to the functions.php of your child theme:

/* Disable WC redirection after login */
add_filter( 'woocommerce_prevent_admin_access', 'hbook_reservation_role_admin_access' );
function hbook_reservation_role_admin_access( $prevent_access ) {
if( current_user_can( 'read_resa' ) ) {
        $prevent_access = false;
  }
  return $prevent_access;
}
 
Related articles How to use caching with HBook?
How to use MailChimp with HBook? May I have a MailChimp newsletter subscription checkbox in the form?
Themes Booking Plugin Pricing Blog Contact