This thread is resolved. Here is a description of the problem and solution.
Problem:
When switching to client account from My Account page (feature provided by Sales Agent for WooCommerce plugins) and using Domain Per language WPML settings, the action does not works and redirects backs to my account page.
Solution:
- Backup the site completely first to prevent any issues or better test this on a staging site first.
- Open the wp-content\plugins\sales-agent-for-woocommerce\includes\admin\classes\user\wc-user-switching.php file
- Around line 143, replace the following code:
} else { wp_safe_redirect( add_query_arg( $args, admin_url() ), 302, self::$application ); }
- With the following code:
} else { $redirect_to = admin_url(); // WPML Workaround for compsupp-6847 if ( class_exists('Sitepress') ) { $my_account_page = wc_get_page_id( 'myaccount' ); if ($my_account_page) { $redirect_to = get_permalink($my_account_page); } } wp_safe_redirect( add_query_arg( $args, $redirect_to ), 302, self::$application ); }
Relevant Documentation:
N/A
This is the technical support forum for WPML - the multilingual WordPress plugin.
Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.
This topic contains 16 replies, has 2 voices.
Last updated by 1 year, 11 months ago.
Assisted by: Subash Chandra Poudel.