In EE4 s there a way to change the Register link in the eea-events-table-view-template from a link which takes you to the event page, to an Add to Cart button which adds the event directly to the cart with no intermediary steps?
I’m working with the eea-multi-event-registration<s/strong> and eea-events-table-view-template plugins for my site’s registration process. Specifically, I’m making use of the espresso-events-table-template-toggle.template.php file for displaying a list of events on my site and using the MER mini-cart widget in the sidebar. I would like to create an Add to Cart button/action to replace the Register link in the table so the event which the person is viewing would be added directly to the Event cart or in this case show up in the sidebar EE4 MER mini-cart widget.
My initial attempts were to install this code (from a post in the support forums) 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;
}
in the espresso-events-table-template-toggle.template.php file and use the $cart_link
to call the item in the table, but it doesn’t seem to be working correctly.
Any suggestions or help is greatly appreciated. Thank you.
The code that you tried was for Event Espresso 3.
For Event Espresso 4 you’ll need to embed the ticket selector into the the table cell to replace the link. The following code will embed a ticket selector:
The support post ‘EE4 "Add to Cart" Button for Espresso Toggle Tables’ 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.
Support forum for Event Espresso 3 and Event Espresso 4.