Is it possible to make the add tickets button go straight to checkout?

Home Forums Ticket Products Event Tickets Plus Is it possible to make the add tickets button go straight to checkout?

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1158033
    Matt
    Participant

    On our site people can only buy one ticket for themselves so I’ve renamed the add tickets button to “Buy ticket” but haven’t found a way to change where it goes after adding it to the basket.

    In the template it triggers this
    <button type=”submit” name=”wootickets_process” value=”1″
    class=”button alt”><?php esc_html_e( ‘Buy ticket’, ‘event-tickets-plus’ );?></button>

    Wootickets process and I just need to find a way to change where it goes after adding them.

    Any ideas?

    p.s I tried adding
    add_filter (‘add_to_cart_redirect’, ‘redirect_to_checkout’);

    function redirect_to_checkout() {
    global $woocommerce;
    $checkout_url = $woocommerce->cart->get_checkout_url();
    return $checkout_url;
    }

    To my functions file as per a few posts but wootickets ignores it.

    Thanks

    #1158057
    Matt
    Participant

    Found a possible fix that seems to work

    In the tickets template the form submit URL goes off to the basket/cart
    <form action=”<?php echo esc_url( $woocommerce->cart->get_cart_url() ) ?>” class=”cart” method=”post” enctype=’multipart/form-data’>

    Changed to checkout
    <form action=”<?php echo esc_url( $woocommerce->cart->get_checkout_url() ) ?>” class=”cart” method=”post” enctype=’multipart/form-data’>

    Using this page

    How to Get Various WooCommerce Page URLs

    #1158111
    Geoff
    Member

    Nice work, Matt! That is a solid solution and I appreciate you sharing that here with us and others — definitely a good workaround.

    Cheers,
    Geoff

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Is it possible to make the add tickets button go straight to checkout?’ is closed to new replies.