Dan

Forum Replies Created

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • in reply to: Relationships #1176577
    Dan
    Participant

    Thanks for the response – any idea where/when on the roadmap this issue is set to be addressed?

    Really, the time being, what I need to to get the number of tickets purchased for by a user for a particular product(preferably by product ID).

    Woocommerce doesn’t appear to have this kind of function built in, but since your plugin displays the total number of tickets a user has historically purchased for an “event”, I’m hoping you’ve got a quicker way to get the purchase count for a particular ticket/item/product for a given user in an event, than what I would be doing straight through woocommerce.

    I’ve searched

    Hopefully this makes sense.

    in reply to: Relationships #1172399
    Dan
    Participant

    Alright – I’ve actually misrepresented the situation. I didn’t uninstall all the plugins. I’m actually using “Event Organiser” as the plugin to manage my “events” and create the post type – the tickets links work for event pages associated with the events calendar plugin.

    so I guess my new question is whether the “show tickets” pages are supposed to work with other custom post types. I know we can add the ticketing to different post types, but viewing those tickets associated with another custom post type seems to still be an issue.

    Any thoughts?

    in reply to: get ticket ids #1167901
    Dan
    Participant

    Hey, thanks Nico – that worked great. I’ve seen a few other posts on here looking for a way to try to AJAX-ify things, so I figured I might as well post my solution below, though it might not be appropriate for everyone.

    I grabbed the product IDs with the above function, and manually generated quantity input and button that will add to the cart like below:

    <?php $myProducts = tribe_get_woo_tickets_ids($post_id); ?>
    <?php foreach($myProducts as $p): ?>
        <?php $_product = wc_get_product($p); ?>
        <input type="number" step="1" min="0" max="" name="quantity_<?= $p ?>" value="0" title="Qty" class="input-text qty custom-qty text" size="4" pattern="[0-9]*" inputmode="numeric">
        <span class="product-price"><?= $_product->get_price(); ?></span>
        <span class="product-name"><?= $_product->post->post_title; ?></span>
        <a rel="nofollow" href="/?add-to-cart=<?= $p ?>" data-quantity="0" data-product_id="<?= $p ?>" data-product_sku="" class="button product_type_simple add_to_cart_button ajax_add_to_cart added btn btn-primary hidden">Add to cart</a>
    <?php endforeach; ?>

    From there, I hid all the buttons I just created, and wrote a little JS to simulate a click with data-quantity updated on each of them that has a quantity in it’s sibling’s number input.

    It’s not the most ideal solution, but hopefully this helps someone out if they’re in desperate need to get an ajax solution with the events tickets plus plugin.

    Thanks for the support.

    in reply to: get ticket ids #1166573
    Dan
    Participant

    Hey Nico, thanks for the response. It doesn’t appear what you sent is quite working though(I’ve made sure that $post_id contains the post ID). $tickets_ids is still an empty array. I know that there are tickets associated with the events as well, because if I just use the_content(), the tickets and buttons show up(just doesn’t work with ajax).

    I’m using woocommerce, and what I’m really looking to do is spit out a list of events, and inside those events(if it has tickets associated with it), generate a woocommerce add_to_cart shortcode with the IDs of the associated “products”.

    I don’t necessarily have to use the shortcode, but I need the ability to display the products on the right events, and add them to the cart via ajax, which the shortcode does(only it doesn’t present the quantity box).

    Hopefully this makes sense,

    Any help would be greatly appreciated.

Viewing 4 posts - 1 through 4 (of 4 total)