Posted: February 5, 2014 at 1:28 am
Viewing 3 reply threads
Hello, I am trying to add the basic “add to card” functionality to the widget.php. I already modified that file before, and i made my attempt. But something is missing. I tried putting this line of code in, but it just changes the page as expected. How can i add the Add to cart functionality to the widget.php file? | |
I solved it myself :) Here is the code. <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.