Posted: November 9, 2016 at 11:30 am
|
Hi, I’m continuing this topic: https://eventespresso.com/topic/is-it-possible-to-have-a-unique-checkout-page-based-on-the-event/ I successfully added the event category into the page body class and now each event is displaying a unique set of colors, images, and links n both the header and footer. Thank you for pointing out that solution and making it so easy to implement! Now I’m looking for a way to add the event category to the thank you page’s body class so the unique graphics carry through to the end of the process. In other words, the checkout pages look great then the look goes back to the default once the user reaches the thank you page. Thank you in advance |
I’m not sure it’d be possible to hook into the body tag on the Thank you page and add a matching body class, but it’s totally possible to add a new div that has a class that matches the event’s category. Here’s an example of the code that can be used to add a div that wraps the content of the thank you page, that adds a category class: https://gist.github.com/joshfeck/7543350476b18b2b4a5f98f8202b89a3 |
|
|
so it’s possible (via functions.php) to add a category to the body class on the registration page but not on the thank you page? that’s doesn’t sound right… |
It’s totally possible to add a category slug to the body class on the thank you page, the tricky part is getting the event object early enough to know which category slug to add. |
|
|
Hi and thank you for your reply. I successfully added a new div with the event category but it’s not quite what I’m looing for. Is it possible to add that same event category to the body tag instead of creating a new div? Sorry if I keep asking the same question – I’m trying to understand. My ultimate goal is to have different event menus and logos load based on the event category (I have three event categories). I have the registration page’s menus and logos laoding perfectly. Thank you, |
The problem is that on the registration-checkout page you have a ‘checkout session’ active that links you (the visitor) to the events that are within the cart. Josh is using the checkout session to pull in those events and then add the event categories to the body class. When you are directed to the thank you page your session has expired as your registration is complete. EE uses the ‘e_reg_url_link’ value passed to the page to pull in the relevant details to display on the page. So as Josh mentioned above the tricky part is pulling in the events early enough to be able to add the categories to the body class. One way is to use the same value EE is using to pull the details you need, something like this: https://gist.github.com/Pebblo/ff10c717dbef698ff7fbe357dedfd1a1 One thing to note is that if you change the ‘registration-checkout’ and ‘thank-you’ page slugs you will need to update the snippet to check for the correct pages. |
|
|
That worked perfectly – you’ve made me very, very happy. This product is great and your support is stellar. Thank you! |
You’re most welcome, I’m glad that worked for you 🙂 |
|
The support post ‘Looking for unique thank you page based on event’ 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.