Posted: October 2, 2013 at 9:10 am
|
Hello, I’m using the venue shortcode in my theme and it works perfectly – except in my cart where it shows ALL of my venues. http://kindragoehler.com/mbi/funny/event-registration/?regevent_action=show_shopping_cart Is there a way to hide this? Thank you! |
Hi Sarah, Which venue shortcode are you using? It looks like just [ESPRESSO-VENUE] All venues are shown when no event_id is set, either manually, globally or through the URL. So in order to only show one event you need pass the shortcode a Venue ID or an Event ID which has a venue assigned to it. https://eventespresso.com/wiki/shortcodes-template-variables/#venue So the shortcode [ESPRESSO-VENUE id=4] would load the venue with id 4. |
|
|
Do you mean something like this?
|
Usually it’s:
Note the single and double quotes. The variable for the event ID will depend on what is already set. Is the event_id variable is set/coded into the theme? |
|
|
Thanks Josh the event_id variable isn’t coded into the theme by this part – it’s outside the loop, if you will. I know how to get around that in WordPress – but not in EE ๐ |
|
Hi, On the shopping cart page the event details are held in an array called $result. So if you wanted to show the event venues I would use something like id . ‘”]’); There is already a foreach loop in the shopping-cart.php that you can add the shortcode into if needed. However I havent tested that fully, and it may not work in a sidebar, it depends on how you have things set up. |
|
Hey Guys, I don’t want any venues to show in my shopping cart. Right now I’m using just the |
|
Wrap that do_shortcode in a conditional, if ($_GET[‘regevent_action’]==’show_shopping_cart’). <?php if ($_GET['regevent_action']=='show_shopping_cart') { echo do_shortcode("[ESPRESSO_VENUE]"); } ?> |
Hi Sarah, Here’s one idea: <?php global $this_event_id; if (isset($this_event_id)) echo do_shortcode("[ESPRESSO_VENUE]"); ?> |
|
|
Hi Josh – that solution worked PERFECTLY! Thank you. You guys have provided awesome support ๐ I’ve recommended EE to several of my clients and I’m actually starting another project using it today. |
The support post ‘All venues show up in my cart’ 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.