WooCommerce Tickets and the WooCommerce Waitlist plugin

Home Forums Ticket Products Event Tickets Plus WooCommerce Tickets and the WooCommerce Waitlist plugin

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #739049
    martybeckers
    Participant

    I’m currently using the plugins Events Calendar Pro 3.7, WooCommerce 2.2.2, WooCommerce Tickets 3.7, and WooCommerce Waitlist 1.3.1. If one of our physical products is out of stock, the “WooCommerce Waitlist” plugin correctly displays a “Join Waitlist” button, but if the product is an event ticket displayed with WooTickets, it just say “Out of stock!” I thought that WooCommerce Tickets would be compatible with the WooCommerce Waitlist plugin (https://theeventscalendar.com/support/forums/topic/are-the-following-woocommerce-plugins-compatible-with-wootickets/), but if that’s not the case, can you point me in the right direction for making it work? It’s a firm feature requirement that the site needs (we need the information about additional customers when the tickets are at capacity in case there are cancellations). I’m a PHP developer so I don’t mind making modifications, I just don’t know what they would need to be. The “Out of stock!” message appears to come from line 59 of plugins/wootickets/views/wootickets/tickets.php, so is that what I would modify to allow the WooCommerce Waitlist plugin to do it’s thing?

    #740421
    Barry
    Member

    Hi – great question!

    I have to be upfront though – we can’t provide in-depth support when it comes to customizations/integration work – but I’d be happy to throw a couple of ideas into the ring πŸ™‚

    The β€œOut of stock!” message appears to come from line 59 of plugins/wootickets/views/wootickets/tickets.php, so is that what I would modify to allow the WooCommerce Waitlist plugin to do it’s thing?

    If you want to modify the ticket form to integrate with WooCommerce Waitlist then I’d strongly recommend reading through our Themer’s Guide first of all – as the most important thing here is that you make any changes safely, within a template override.

    What you would actually replace this with I’m not sure, you’d need to look at the Waitlist plugin code to figure that out.

    Alternatively, if you know that this other plugin works well when products are viewed within a regular WooCommerce product page, you could modify things such that instead of our regular ticket form it links you directly to the actual product page. If that sounds like a viable approach please check out this thread.

    I hope that helps πŸ™‚

    #770864
    Barry
    Member

    Hi!

    It’s been a while so I’ll go ahead and close the thread, but if we can help with anything else please don’t hesitate to create new threads as needed – one of the team will be only too happy to assist πŸ™‚

    Thanks again!

    #858107
    martybeckers
    Participant

    I found a workaround and here are the steps to get the “Events Calendar Pro” and “WooCommerce Tickets” plugins to work properly with the “WooCommerce Waitlist” plugin (note that the line numbers will likely change with future versions):

    1. Copy wp-content/plugins/wootickets/views/wootickets/tickets.php to wp-content/themes/[your theme]/tribe-events/wootickets/tickets.php so that it can be customized without breaking the plugin updates

    2. Edit wp-content/themes/[your theme]/tribe-events/wootickets/tickets.php and change line 59 from just an “Out of stock” message to a “Join the waitlist” button:
    echo ‘<span class=”tickets_nostock” style=”padding?top: 10px;”><b>SOLD OUT: </b>get_permalink() .'” class=”banner_button”>Join the waitlist</span>’;

    3. When the product is out of stock, the user will be able to press the button to go to the normal WooCommerce product page for the event, which has the waitlist feature. Unfortunately, that might be confusing because the user goes from one event page to another, so the solution is to customize the layout of the WooCommerce product page when the product is a ticket. To do that, copy wp-content/plugins/woocommerce/templates/single-product.php to wp-content/themes/[your theme]/woocommerce/single-product.php, then replace this:
    <?php wc_get_template_part( ‘content’, ‘single-product’ ); ?>
    with this:
    if( has_term( ‘ticket’, ‘product_cat’ )) {
    wc_get_template_part( ‘content’, ‘single-product-ticket’ );
    } else{
    wc_get_template_part( ‘content’, ‘single-product’ );
    }

    4. Then to create the new customized layout for the event ticket page, copy wp-content/plugins/woocommerce/templates/content-single-product.php to wp-content/themes/[your theme]/woocommerce/content-single-product-ticket.php, and customize the layout however you like so that it is clear the page is just for joining the mailing list. As a suggestion, comment-out this line:
    // do_action( ‘woocommerce_before_single_product_summary’ );
    Then add code like this below that line to redirect to the product when it isn’t out of stock, or display a message above the field for joining the mailing list when it is out of stock:
    $id = get_the_ID();
    $wootickets = TribeWooTickets::get_instance();
    $event_id = get_post_meta(get_the_ID(), $wootickets->event_key, true );
    $event = get_post($event_id);
    global $product;
    $availability = $product->get_availability();
    if ($availability[‘class’] == ‘in-stock’) : ?>
    <div class=”waitlist-message”>
    <script type=”text/javascript”>window.location.replace(“<?php echo site_url().’/event/’.$event->post_name; ?>”);</script>
    </div>
    <?php else : ?>
    <div class=”waitlist-message”>
    <h1>Join the Waitlist for:</h1>
    <h2>post_name; ?>”> <?php echo $event->post_title; ?> </h2>
    <p>Thank you so much for your interest! Enter your email address below, and we’ll let you know if a spot opens up for this event.</p>
    </div>
    <?php endif; ?>

    The end result is the expected waitlist functionality – when an event is sold out, a “Join the waiting list” button will go to a new page where the user can enter their email address, then they will be sent an email with a link to the event automatically when a ticket becomes available.

    Ideally this change will just be made to the WooCommerce Tickets plugin in a future version so that it works with the WooCommerce Waitlist plugin out of the box, but this workaround will solve the problem in the meantime.

    #864929
    Leah
    Member

    Thanks for posting your solution Marty!

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘WooCommerce Tickets and the WooCommerce Waitlist plugin’ is closed to new replies.