Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
You are trying to offer event registration in both English and French with Event Tickets Plus and WPML, using a workaround to display ticket blocks on translated event pages. However, the add tickets function does not work for events that have been translated, and toggling the language affects the header and footer language as well.
Solution:
Firstly, it's important to note that Event Tickets Plus is not officially compatible with WPML. To display tickets on translated events, you need to manually add the ticket to each translated event. This issue has been reported by other users and is known to the Event Tickets team. For more details, you can check this forum thread: Event Tickets Plus Integration with WPML.

For the issue of language toggling affecting the entire page, you attempted a workaround by modifying a specific query to only show English tickets on the French page. Here is the code snippet you used:

add_action('pre_get_posts', 'maybe_force_english_tickets');<br />function maybe_force_english_tickets($query) {<br />  if (!is_admin() && isset($query->query['meta_query']['_tribe_wooticket_for_event_in'])) {<br />    do_action('wpml_switch_language', "en");<br />  }<br />}

However, this requires custom coding, which is beyond our support scope. If you need further customization, consider hiring a professional from WPML Contractors.

Please note that this solution might be outdated or not applicable to your specific case. We highly recommend checking related known issues at WPML Known Issues, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If the issue persists, please open a new support ticket.

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.

Tagged: 

This topic contains 3 replies, has 2 voices.

Last updated by Prosenjit Barman 1 year, 9 months ago.

Assisted by: Prosenjit Barman.

Author Posts
February 22, 2023 at 4:10 am #13084617

David

We are trying to offer event registration in both English and French with Event Tickets Plus and WPML using the workaround described here.

https://wpml.org/errata/event-tickets-plus-translated-events-does-not-display-the-tickets/

This appeared to work initially to have the ticket block appear on French events, however, now the add tickets function does not work for events that have been translated. Any ideas?

Unfortunately this is a gated function on our website so I cannot demonstrate,

February 23, 2023 at 11:19 am #13097795

Prosenjit Barman
Supporter

Languages: English (English )

Timezone: Asia/Dhaka (GMT+06:00)

Hello There,
Thanks for reaching out to us. I will try my best to help you with this matter.

I understood that a specific functionality from the Event Tickets Plus plugin is not functioning correctly for translated events. I attempted to replicate the problem in my development environment, but apart from being able to trace this issue(https://wpml.org/errata/event-tickets-plus-translated-events-does-not-display-the-tickets/), I couldn't be able to identify any additional problems with the events.

Will it be possible for you to capture a video about the issue and help us in reproducing the issue? I will check accordingly and let you know an update as soon as possible.

You can share the video through any file-sharing platform or using Google Drive/Dropbox.

Looking forward to your response.

Best regards.
Prosenjit

February 24, 2023 at 3:04 pm #13109553

David

Hi Prosenjit!

The issue we found with the workaround was that it required separate tickets to be set up for each language, meaning they do not share capacity or attendees.

We have started exploring another workaround where we would simply show the English tickets on the French page, and using WPMLs suggested method for selectively modifying a specific query it does work!

However, the language toggle results in the header and footer language also being toggled, is there a way to successfully isolate the toggle to only affect one particular query?

video:
hidden link

code snippet:
add_action('pre_get_posts', 'maybe_force_english_tickets');
function maybe_force_english_tickets($query) {
if ( !is_admin() && isset($query->query['meta_query']['_tribe_wooticket_for_event_in']) ) {
do_action( 'wpml_switch_language', "en" );
}
}

suggested method of language switching specific query:
https://wpml.org/forums/topic/wp_query/

February 28, 2023 at 7:22 am #13131597

Prosenjit Barman
Supporter

Languages: English (English )

Timezone: Asia/Dhaka (GMT+06:00)

Hello There,
I hope you're doing fine and I'm very sorry for the delay in getting back to you.

I did a thorough inspection of the Event Tickets Plus plugin with WPML and clearly understood the issue you're having. To display tickets on translated events, we need to manually add the ticket to the translated event, which will then appear on the front end. For your information, the Event Tickets Plus plugin is not officially compatible with WPML. Kindly check this article: hidden link

However, many of their users have reported the issue with Translating tickets in Event Ticket plus forum. As a workaround, the Event Tickets team has suggested creating tickets manually for each translated event.

Here is the link to a thread from their forum: hidden link

Until the necessary support for WPML is added to the plugin's code, it will be difficult to translate the Tickets properly. However, I would like to inform you that this issue has been brought to the attention of WPML's Compatibility team. They will contact the author in order to invite them to work with our devs and make the plugin officially WPML compatible. We are always glad to help in any way we can.

In the meantime, you can also reach out to the Plugin author and ask them to join the Go Global Program of WPML. It helps the plugin/theme author to work closely with the WPML Compatibility team and make their product multilingual. More information about the Go Global Program is available here: https://wpml.org/documentation/support/go-global-program/

I also understood the workaround you mentioned in your last response. Please note that if you wish to run the code on a specific section, it will require custom coding. I would like to inform you that providing assistance with custom codes is beyond the scope of our support. For that reason, I am unable to assist you in this matter. I apologize for any inconvenience this may cause and appreciate your understanding in this regard.

If you want, you can also hire a professional who can help you to accomplish your custom requirement as per your needs. You can find one here: https://wpml.org/contractors/

Let me know if there is anything else you need help with.

Best Regards,
Prosenjit