Skip Navigation

Resolved by author

Reported for: WPML Multilingual CMS 4.6.5

Topic Tags: ATE

Overview of the issue

If you’re using the Uncode theme along with WPML and WooCommerce and you set a custom template for a new login page, you may run into an issue when attempting to log in from a page set in your site’s secondary language. Specifically, after logging in, you might not be redirected to the ‘My Account’ page as expected.

Workaround

Please, make sure of having a full backup of your site before proceeding.

  • Open your theme’s functions.php file.
  • Add the following code:
    // WPML Workaround for compsupp-6911
    add_filter( 'option_uncode_woocommerce_my_account_login_page_id', 'wpml_compsupp6911_modify_uncode_woocommerce_login_page_id' );
    
    function wpml_compsupp6911_modify_uncode_woocommerce_login_page_id( $value ) {
    
    	if (is_numeric($value)) {
    		$post_type = get_post_type($value);
    		$value = apply_filters( 'wpml_object_id', $value, $post_type , TRUE );
    	}	
    
        return $value;
    }