Support

Home Forums Event Espresso Premium Polylang integration custom built

Polylang integration custom built

Posted: July 20, 2017 at 4:00 am


jansan20

July 20, 2017 at 4:00 am

Hi,

I am perfectly aware that Polylang is NOT supported.

Having said that I did have some major breakthroughs in integrating it none the less and was humbly hoping for some help from your side.

I use some javascript and cookie magic to redirect to the proper language and alter the links. Also, I use the same slugs for my pages in different languages, having the [ESPRESSO_EVENTS] shortcode. Therefore, when switching the language subdomain, while keeping all the php url arguments, I can switch between languages while using EE3.

I altered the po/mo paths in plugins so I could use loco translate easily.

Now here is where I got stuck:

1. I use the calendar plugin for visitors to pick their date and time. They click the [ESPRESSO_CART_LINK] link in the tooltip and get to their cart. – WORKS WITH POLYLANG (and some jQuery)
2. In the cart they can pick how many of the three different ticket types they need, and proceed to type in attendee information. – WORKS WITH POLYLANG (and a clever redirect)
3. After having entered all attendee information they can “Confirm and proceed with payment” – does NOT work with Polylang

I get:

Notice: Undefined variable: primary_attendee_id in /var/www/vikingtenerife/wordpress/wp-content/plugins/event-espresso/includes/process-registration/add_attendees_to_db.php on line 777

Notice: Undefined variable: primary_attendee_id in /var/www/vikingtenerife/wordpress/wp-content/plugins/event-espresso/includes/process-registration/add_attendees_to_db.php on line 785
Dziękuję! Twoja rejestracja została potwierdzona na 1 Viking Line S.L.wydarzenia
E-mail z potwierdzeniem został wysłany z dodatkowymi szczegółami rejestracji.

Notice: Undefined variable: send_to in /var/www/vikingtenerife/wordpress/wp-content/plugins/event-espresso/includes/functions/email.php on line 585

Notice: Undefined variable: email_subject in /var/www/vikingtenerife/wordpress/wp-content/plugins/event-espresso/includes/functions/email.php on line 585

HOWEVER – when I change the subdomain back to the original, the payment process works.

CONCLUSION:

I am quite sure I am missing something in the logic behind passing the params for the attendees.

Also! Would it not solve most of my Polylang related issues if you allowed for more than one page to have the [ESPRESSO_EVENTS] shortcode, or if the stored?

I assume the following combination would work for:
1. No absolute paths – allowing for different subdomains with same slugs and url params to work.
2. Allowing for more than one page to have the necessary shortcode.
3. Any of your suggestions … 🙂

Can you help me?


Josh

  • Support Staff

July 20, 2017 at 10:57 am

Hi there,

With regards to EE3 allowing more than one page to have the [ESPRESSO_EVENTS] shortcode, that cannot be done because the Main registration page is set with an option, and the option expects a single page ID. It cannot handle an array of page IDs.

What I can suggest instead is work with EE4 to add this. The reason is because EE3 development is done, it’s only being supported for those that can’t use EE4, and only getting security fixes and minor updates that relate to keeping the payment gateways up to date. The other reason is if you come across some code within EE4 where you can use a new filter hook or a new action to help integrate your Polylang solution, you can submit a pull request on Github and the developer team will work with you to get your pull request merged into core.


jansan20

July 20, 2017 at 3:26 pm

Hi!

First of all thank you very much for taking the time to respond. I specifically chose EE3 for its recurring events capability, so there is no way (for now) to switch to EE4 for us.

Could you point me to the right file which POSTs the attendee information? I could then try and send the attendee information to the right place.

Would it be possible to use posts instead of pages for the required shortcodes, to keep the id consistent? That way I could at least embed the post instead of using a page, so at least the menu would stay the required language.

I will investigate further. I am sure there is a clever way to keep the language consistent in EE and keep my multilingual wordpress installation running.


Josh

  • Support Staff

July 20, 2017 at 6:03 pm

Could you point me to the right file which POSTs the attendee information? I could then try and send the attendee information to the right place.

/event-espresso/includes/process-registration/add_attendees_to_db.php

Would it be possible to use posts instead of pages for the required shortcodes, to keep the id consistent? That way I could at least embed the post instead of using a page, so at least the menu would stay the required language.

That’s not remotely possible.


jansan20

July 24, 2017 at 4:22 am

Hi,

Just a follow up.

I did eventually manage to implement EE3 in conjunction with PolyLang.

It is a rather “dirty” solution, but it works very well.

1. I am using https://github.com/grappler/polylang-slug plugin to allow for the same slug for two or more pages having the required EE3 shortcodes.
2. I use some javascript to change the form action attribute and all the links, to the correct language subdomain on the fly.

I still think that simply using point 1 (polylang-slug) while keeping EE3 links non absolute (without the domain), would make Polylang work nicely with EE3.

It works flawlessly for me at least 🙂 .

If someone needs more details let me know.

Thanks

The support post ‘Polylang integration custom built’ 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.

Event Espresso