Skip Navigation

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

Problem:
When the WPML plugin is active, creating a new ticket on an existing event using the Event Tickets Plus plugin results in a blank screen instead of displaying editable attendee information fields. Disabling WPML resolves the issue, indicating a conflict between WPML and Event Tickets Plus.
Solution:
We have identified that the Event Tickets Plus plugin is not fully compatible with WPML. Although we attempted to establish a partnership with the plugin's author, they were not responsive. As a workaround, you can add the following code to your functions.php file to handle the language details for ticket products using WPML:

function set_wpml_language_for_ticket_product( $sourcepost, $ticket ) {<br />    if ( ! $ticket->ID || get_post_type( $ticket->ID ) !== 'product' ) {<br />        return;<br />    }<br />    $set_language_args = array(<br />        'element_id'    => $ticket->ID,<br />        'element_type'  => 'post_product',<br />        'trid'          => false,<br />        'language_code' => apply_filters( 'wpml_current_language', NULL ),<br />        'source_language_code' => NULL<br />    );<br />    do_action( 'wpml_set_element_language_details', $set_language_args );<br />}<br />add_action( 'event_tickets_after_create_ticket', 'set_wpml_language_for_ticket_product', 10, 2 );

This code snippet ensures that the language details are set correctly for ticket products when they are created. If this solution does not resolve your issue or becomes outdated, we recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If further assistance is needed, please open a new support ticket at WPML support forum.

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

Last updated by barjD 8 months, 4 weeks ago.

Assisted by: Bruno Kos.

Author Posts
October 2, 2024 at 1:53 am #16243186

barjD

Background of the issue:
While the WPML plugin is active, I am trying to use the Event Tickets Plus plugin to create a new ticket on an existing event and assign attendee information fields to a ticket. Event Tickets Plus plugin information page: hidden link

Symptoms:
I expected to see attendee information fields which are editable like so hidden link. Instead, I got a blank screen like so: hidden link. With the following errors in Console: hidden link, hidden link. Disabling WPML core is what eventually resolved the issue after other troubleshooting steps.

Questions:
Why does the builder not load when WPML is active?
How can I resolve the conflict between WPML and Event Tickets Plus plugin?

October 2, 2024 at 5:43 am #16243339

Bruno Kos
WPML Supporter since 12/2018

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

Timezone: Europe/Zagreb (GMT+02:00)

Hi,

Thank you for contacting WPML support!

Could you please install the plugin on the following site: hidden link and check if the issue occurs there?

If the issue persists, I will escalate the case to our compatibility team for further review.

However, please note this information from hidden link. It may require the plugin author’s assistance.

Regards,
Bruno Kos

October 2, 2024 at 9:04 pm #16247500

barjD

Hello,
I installed the plugins and tried to mimic settings on our site.

I set up an event.

I created a ticket.

But now I am encountering a new problem with your demo site because it is saying we need to adjust the sale duration in order for "Test ticket 1" to be active.

The second ticket, "Test ticket 2," I can not add because it keeps saying "invalid date" for the sale duration, even though the date is valid and I'm using the date selector.

Please see attached screenshots.

This issue with the dates on sale duration does not happen on our site, even with WPML enabled.

I can not proceed to reproduce the error I initially wrote about without help to solve this date issue first.

Console does show errors already. I don't know if they are related, or the same as in the screenshots I showed you.

I understand the information at this link: hidden link

It says Event Tickets does not support WPML. It is fine if WPML can not translate the Event Tickets Plus content.

But this issue is the other way around. WPML is creating errors just by being active. Is it not possible to fix the error on WPML's side?

What assistance should I ask of the plugin author?

Thank you.

Screenshot 2024-10-02 at 2.05.23 PM.png
Screenshot 2024-10-02 at 1.55.24 PM.png
Screenshot 2024-10-02 at 1.55.46 PM.png
October 3, 2024 at 5:22 am #16247864

Bruno Kos
WPML Supporter since 12/2018

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

Timezone: Europe/Zagreb (GMT+02:00)

Let me focus on this first:

But now I am encountering a new problem with your demo site because it is saying we need to adjust the sale duration in order for "Test ticket 1" to be active.

The second ticket, "Test ticket 2," I can not add because it keeps saying "invalid date" for the sale duration, even though the date is valid and I'm using the date selector.

Can you tell me where can I see this? hidden link gives me 404, while I am not able to find interface where Tickets are to be added.

Can you send me a screenshot so I could try myself and check what the issue might be?

October 3, 2024 at 5:36 am #16247871

barjD

In the back end, under Events there is one test event. Click to edit it. Then click on the tickets block. It should be there.

October 3, 2024 at 6:21 am #16247943

Bruno Kos
WPML Supporter since 12/2018

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

Timezone: Europe/Zagreb (GMT+02:00)

I get this in the console, even with WPML inactive. Do you see such error in the console of your site? I also see "This block has encountered an error and cannot be previewed." 2 times, maybe this block is doing it? Although this block is Event Date Time so should not do this.

events error.jpg
October 3, 2024 at 7:45 pm #16251934

barjD

The errors in my console are the ones I showed you in my screenshots in my original post.

We do not have the message that this block has encountered an error.

You can delete those blocks because they are not part of the issue here, which is just with the tickets block.

October 4, 2024 at 9:34 am #16253103

Bruno Kos
WPML Supporter since 12/2018

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

Timezone: Europe/Zagreb (GMT+02:00)

To troubleshoot this problem, I'll install the Duplicator plugin and generate packages for further debugging purposes. I'll ensure to exclude all media files to maintain a minimal package size. You can find more information about the process here: [link](https://wpml.org/faq/provide-supporters-copy-site/).

Please confirm if this approach is acceptable to you.

And tell me on which URL on your site can I see this, where to click, just to make sure we are on the same page with this.

I will escalate this to our 2nd tier then so we could debug, given that we have issues reproducing this in sandbox.

October 7, 2024 at 10:28 am #16260438

Bruno Kos
WPML Supporter since 12/2018

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

Timezone: Europe/Zagreb (GMT+02:00)

This has been escalated to our 2nd tier team team and may take some debugging time, I'll get back to you as soon as I have any news or questions for you.

October 7, 2024 at 1:24 pm #16261567

Bruno Kos
WPML Supporter since 12/2018

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

Timezone: Europe/Zagreb (GMT+02:00)

Please display everything in "Translatable - only show translated items" mode, including posts, pages, products, categories, taxonomies, etc. From what we have observed, if pages and posts are set to this mode, everything functions correctly.

You can compare the settings by visiting the following links:

1. hidden link
2. hidden link

Make sure to set the option to **Translatable** and enable **only show translated items**.

Does it help?

October 7, 2024 at 11:00 pm #16263640

barjD

Hello the first link hidden link --> leads to a login page, which I don't have the login for.

On our staging site, I have set everything as:
"Translatable
only show translated items"

hidden link

I still encounter the same issue.

You can also test it again to see.

October 8, 2024 at 7:04 am #16264014

Bruno Kos
WPML Supporter since 12/2018

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

Timezone: Europe/Zagreb (GMT+02:00)

To troubleshoot this problem, I'll install the Duplicator plugin and generate packages for further debugging purposes. I'll ensure to exclude all media files to maintain a minimal package size. You can find more information about the process here: [link](https://wpml.org/faq/provide-supporters-copy-site/). Please confirm if this approach is acceptable to you.

October 8, 2024 at 7:17 pm #16267252

barjD

I confirm this approach is acceptable

October 9, 2024 at 5:11 am #16267893

Bruno Kos
WPML Supporter since 12/2018

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

Timezone: Europe/Zagreb (GMT+02:00)

This has been escalated to our 2nd tier team team and may take some debugging time, I'll get back to you as soon as I have any news or questions for you.

October 9, 2024 at 10:16 am #16269206

Bruno Kos
WPML Supporter since 12/2018

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

Timezone: Europe/Zagreb (GMT+02:00)

Can you please try the following:

In the file `wp-content/plugins/event-tickets-plus/src/Tribe/Commerce/WooCommerce/Main.php`, update the code to include the workaround as shown below, so between the lines where $ticket->ID = wp_insert_post( $args ); and $product = wc_get_product( $ticket->ID );

$ticket->ID = wp_insert_post( $args );

// Workaround to set the language details for the post product using WPML
$set_language_args = array(
    'element_id'    => $ticket->ID,
    'element_type'  => "post_product",
    'trid'   => false,
    'language_code'   => apply_filters( 'wpml_current_language', NULL ),
    'source_language_code' => NULL
);
do_action( 'wpml_set_element_language_details', $set_language_args );

$product = wc_get_product( $ticket->ID );

Does it help?