Support

Home Forums Custom Files Add-on (EE3) Add to Cart in espresso_table

Add to Cart in espresso_table

Posted: February 26, 2014 at 3:59 pm


infosolwebadmin

February 26, 2014 at 3:59 pm

I saw that you have the new custom templates add on that has the ‘events table template’ which has a column with an add to cart button if you are using MER (I am). I added an add to cart column to the espresso_table template (from the custom files 3.1 add on) which ended up causing a bug where event names wouldn’t show up in the successful promo code message in the cart. I had a thread about that a while back:

https://eventespresso.com/topic/event-name-not-showing-up-in-promo-code-message/

Anyways, that new table template is almost exactly what I would need and I am assuming the promotional code issue I had doesn’t occur with it. The only things I’d want to do is get rid of the drop down that selects what categories it can display (would rather use the category_identifier=”” shortcode in the backend to choose what events the table shows and not have the drop down at all) and I would only want it to display the add to cart button in that far right column. We utilize tables to display our events, so I wouldn’t want the ‘register’ link in the table because we use alternate registration page URL’s (for each event we run) that have the table(s) for that particular event displayed.

It seems like the options would be to strip away those things I don’t want from the new template or potentially utilize the add to cart button code from it in the old espresso_table template, if that is possible. What do you think is the best way to go about this?

Thanks!


Josh

  • Support Staff

February 26, 2014 at 5:32 pm

Either should work, but it might be easier to remove what you don’t want in the newer template.

If the older template is more suited (except for where it’s not adding the name of the event to the cart) that’s totally fixable.

Instead of using the [ESPRESSO_CART_LINK] shortcode to add a cart link in the old espresso_table template you can add this after the start of its foreach loop:

if (event_espresso_get_status($event->id) == 'ACTIVE') {
 $params = array(
  'event_id' => $event->id,
  'anchor' => __("Add to Cart", 'event_espresso'), 
  'event_name' => $event->event_name,
 );
 $cart_link = event_espresso_cart_link($params);
} else {
 $cart_link = false;
}

Then place $cart_link where you want the add to cart link to display.

The support post ‘Add to Cart in espresso_table’ 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