<code> $params = array(
//REQUIRED, the id of the event that needs to be added to the cart
'event_id' => $event->id,
//REQUIRED, Anchor of the link, can use text or image
'anchor' => __("Add to Cart", 'event_espresso'), //'anchor' => '<img src="' . EVENT_ESPRESSO_PLUGINFULLURL . 'images/cart_add.png" />',
//REQUIRED, if not available at this point, use the next line before this array declaration
// $event_name = get_event_field('event_name', EVENTS_DETAIL_TABLE, ' WHERE id = ' . $event_id);
'event_name' => $event->event_name,
//OPTIONAL, will place this term before the link
'separator' => __(" ", 'event_espresso')
);
$cart_link = event_espresso_cart_link($params);
echo $cart_link;</code>
<code><?php
$params = array(
//REQUIRED, the id of the event that needs to be added to the cart
'event_id' => $event->id,
//REQUIRED, Anchor of the link, can use text or image
'anchor' => __("Add to Cart", 'event_espresso'), //'anchor' => '<img src="' . EVENT_ESPRESSO_PLUGINFULLURL . 'images/cart_add.png" />',
//REQUIRED, if not available at this point, use the next line before this array declaration
// $event_name = get_event_field('event_name', EVENTS_DETAIL_TABLE, ' WHERE id = ' . $event_id);
'event_name' => $event->event_name,
//OPTIONAL, will place this term before the link
'separator' => __(" ", 'event_espresso')
);
$cart_link = event_espresso_cart_link($params);
echo $cart_link;
?> </code>
oh .. well place delete the double posted answer. I tried to made a better post view of the code.. It failed.
Viewing 3 reply threads
The support post ‘Add "add to card" functionality to widget.pgp’ 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.