Skip Navigation

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 6 replies, has 2 voices.

Last updated by John 1 year, 8 months ago.

Assisted by: Nicolas Viallet.

Author Posts
July 7, 2022 at 9:58 pm #11626749

John

Hey, Nicolas, many thanks for your code indeed everything works. Really appreciate it.
Do you have a solution for the 2nd issue with wishlist translation on the user account page?
Thanks.

July 7, 2022 at 10:06 pm #11626779

Nicolas Viallet
Supporter

Languages: English (English ) French (Français )

Timezone: America/Lima (GMT-05:00)

Hello again 😉

So from the chat we had:

John : And also, in this photo, is the second issue. It's about the wishlist, which is translated but in the "my account" it's showing the text translated in original language(german).

Could you please re-share your credentials as they are deleted as soon as a ticket is marked as solved. I have activated the private field.

I checked the screenshot and also visited the frontend and I can already see that the "Wishlist" links at the top is translated correctly so the issue is only in "My account".

Thanks,
Nico

July 12, 2022 at 7:35 pm #11653803

Nicolas Viallet
Supporter

Languages: English (English ) French (Français )

Timezone: America/Lima (GMT-05:00)

Hello,

Thanks for access. Unfortunately I couldn't find a solution yet, it seems that the theme's code use a custom function to get the wishlist page title.

I asked my colleague from the second tier support team to see if they have some feedback to provide me.

Thanks for your patience,
Nico

July 12, 2022 at 7:36 pm #11653805

John

Okey, many thanks and much appreciation.

July 12, 2022 at 8:04 pm #11653969

Nicolas Viallet
Supporter

Languages: English (English ) French (Français )

Timezone: America/Lima (GMT-05:00)

Hello again,

I dig a bit further and found where the cade was in your theme.
- Access your server via FTP
- Go to "/wp-content/themes/xts-vega/framework/modules/wc-wishlist/class-ui.php"
- Line 228 replace this:

$items['wishlist'] = get_the_title( xts_get_opt( 'wishlist_page' ));

By this:

if ( defined( 'ICL_SITEPRESS_VERSION' ) && function_exists( 'wpml_object_id_filter' ) ) {
    $page_id = xts_get_opt( 'wishlist_page' );
    $page_id = wpml_object_id_filter( $page_id, 'page', true );
    $items['wishlist'] = get_the_title( $page_id );
} else {
    $items['wishlist'] = get_the_title( xts_get_opt( 'wishlist_page' ));
}

In short: this code looks if WPML is active and then use the wpml_object_id_filter to get the translated page_id to get the correct page title. If WPML is not active it will use the default code from the plugin.

Could you please check if it works for you and also, it would be great to contact the theme author and report that issue. Maybe they can improve that code or even implement it in a next release as I saw they work already hard to make the plugin compatible with WML.

Thanks,
Nico

July 12, 2022 at 8:06 pm #11653973

John

Nico, Nico, the man of the day. What can I say more than thank you!!!!
Much appreciation, just tested and everything works as aspected.
Many thanks

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.