• Resolved jerrygapinski

    (@jerrygapinski)


    with a straight install of wordpress, you can add a product to the cart like: WC()->cart->add_to_cart( $product_id );

    is there a function to do that in OTCE by event id & product id?

    TIA

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author quadshot

    (@quadshot)

    Hello @jerrygapinkski,

    Thanks for reaching out!

    Great question, but at this time, there is not a function in OTCE that can do this.

    Short answer is because of the way the reservation system is set up, the ticket product itself has no meaning without being tied to an actual event. Ticket products can also be connected to multiple events, so while the tickets are Woo products, they do not behave like standard Woo products.

    We will see if we can consider this in a future update.

    If there is anything else we can assist you with, please let us know! Thank you!

    Thread Starter jerrygapinski

    (@jerrygapinski)

    So, how does OTCE add tickets? I don’t mind writing a little code, just point me in right direction.

    Thx

    Thread Starter jerrygapinski

    (@jerrygapinski)

    What file and/or function handles adding tickets to cart.

    is it something like this:
    $item_id = $this->_add_or_update_order_item( $order, $product, $res, array( ‘event_id’ => $event->ID ) );

    TIA

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘programmatically add eat to cart’ is closed to new replies.