Posted: March 22, 2018 at 4:00 pm
|
Hi all, Call me stubborn, call me stupid. I’ve seen all the signs that EE4 won’t work with WPML, but I’m still (quite desperately) looking for workarounds. I’ve seen the post over at WPML (https://wpml.org/forums/topic/i-cant-translate-the-event-espresso-registration-form-in-english/) and incorporated that suggestion, but that doesn’t solve (all of) the problems. With the experience and knowledge of the EE developers around, I’m hoping we can together work through this an come up with a (temporary, at least) solution. Demand is high up, judging from the various posts. Situation: Current bottleneck: Approaching this step by step, I’m interested in any ideas/explanations for this behaviour, as well as possible workarounds. It feels as if this bottleneck is actually the bottleneck, as (for example) the ‘cancel registration’-link later on in the registration flow points to the correct language version of the ‘Cancelled’-page. Thanks in advance, |
Hi Bram, I’m afraid I have no idea why a POST-request to admin-ajax.php would revert the original ICL_LANGUAGE_CODE. Since you’re having issues with using the cart, and it appears there’s only one event, why not deactivate MER and avoid the cart functions altogether? |
|
|
Hi Josh, Thanks for your reply! Deactivating MER actually is an idea I hadn’t thought of before, but something that might work! Back in the EE3-days we used MER to sell multiple products (ticket, tokens, merch), but as we’re currently doing that with the different ticketing options, the MER indeed might be redundant. I’ll give this a try in our development environment and see whether this solves the issue! Thanks again, |
|
Hi Josh, So… I think I’ve got it working =)! Disabling the MER plugin indeed helps, as it removes the cart-modal. Next problem was that the (English-language) checkout page showed up empty. This was solved by adjusting the function I’ve added the following code, between
Documentation of used functions: url_to_postid(), wpml_object_id-filter. To also make sure the redirections to other critical pages (transactions page, thank you page, cancelled page) work, I’ve changed the definitions of the
$this->thank_you_page_url = get_permalink( apply_filters( 'wpml_object_id', $this->thank_you_page_id, 'page', true ) ); $this->thank_you_page_url = get_permalink( apply_filters( 'wpml_object_id', $this->thank_you_page_id, 'page', true ) ); This is basically another application of the registration-page-translation-fix that was posed over at the WPML-forums. We’ll be testing this over the coming few days, but until then I’m hoping this can also help other people struggling with this. Josh, if you see any issues / risk associated to my changes, please let me know! Bram |
Hi Bram, I can recommend moving the custom code into its own plugin, then add a filter hook where needed. For example, for the Reg. page, right after this line: Then you can do a pull request on Github and the filter hook can make it into an upcoming version of Event Espresso. This way you can keep your copy of Event Espresso free of modified code and avoid maintenance headaches later on. Then your custom code will be neatly tucked away into its own plugin, for example:
|
|
The support post ‘EventEspresso 4 + WPML’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.