Best practises for Woocommerce tickets

Home Forums Ticket Products Event Tickets Plus Best practises for Woocommerce tickets

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #959930
    David
    Participant

    Hi,
    I would like advice on how best to use the woocommerce tickets plug-in.

    With Woocommerce, you get 4 new pages by default: Cart, Checkout, My Account and Shop.

    It seems to me that with The Event Calendar tickets, there is no need for the “Shop” page. By default, the ticket products do not show up there, they are hidden. You can make them visible, but only the name “Adult” or “Consession” and an image is displayed by default.

    The real Product listing is the Event listing.

    So, I can make the Shop page private and not include it in the menus.

    However, if I go to the Cart page and the cart is empty, a button is displayed “Return to Shop”. It would seem to make more sense to say “Return to All Events” with a link to the /events/ page.

    Is this how people usually implement the woocommerce tickets solution or am I missing something?

    Thanks!

    #960028
    Josh
    Participant

    Hey David,

    Thanks for reaching out to us! This is actually a great question and honestly the first time I’ve been asked this question.

    For the base, it sounds like you’ve got a good structure started. Another option would be to completely delete the shop page that is created in the WooCommerce setup if you’re not going to be using your site to sell products other than event tickets.

    For the “Return to shop” button. This is a great question and looks like something that can be modified using the WooCommerce customization options. Here is a great article/video on how to override the default template content for WooCommerce pages. You can use the advice here to update that link and wording to direct to the Events listing rather than the “Shop” page.

    Let me know if this helps.

    Thanks!

    #961511
    David
    Participant

    Hi Josh,

    OK, so I understand how I can override the Cart template. To be more specific, I need to override the empty cart template which is called cart-empty.php. Unfortunately, it’s more complicated than I thought.
    Can anyone point me in the right direction?

    The code looks like this:

    if ( ! defined( ‘ABSPATH’ ) ) {
    exit; // Exit if accessed directly
    }

    wc_print_notices();

    ?>

    <p class=”cart-empty”><?php _e( ‘Your cart is currently empty.’, ‘woocommerce’ ) ?></p>

    <?php do_action( ‘woocommerce_cart_is_empty’ ); ?>

    <p class=”return-to-shop”>“><?php _e( ‘Return To Shop’, ‘woocommerce’ ) ?></p>

    #961513
    David
    Participant

    Let’s try that again:

    if ( ! defined( 'ABSPATH' ) ) {
    	exit; // Exit if accessed directly
    }
    
    wc_print_notices();
    
    ?>
    
    <p class="cart-empty"><?php _e( 'Your cart is currently empty.', 'woocommerce' ) ?></p>
    
    <?php do_action( 'woocommerce_cart_is_empty' ); ?>
    
    <p class="return-to-shop"><a class="button wc-backward" href="<?php echo apply_filters( 'woocommerce_return_to_shop_redirect', wc_get_page_permalink( 'shop' ) ); ?>"><?php _e( 'Return To Shop', 'woocommerce' ) ?></a></p>
    #961534
    David
    Participant

    Fixed!
    It was a two-step process.
    1) Use the template override method to change the text in the button. So in cart-empty.php, relace the ‘Return to Shop’ string (right near the end) with your chosen text e.g. ‘Return to Events’

    2) To change the destination URL of the button, use this solution How to change the URL . This involves adding a function to your theme’s functions.php.

    #961709
    Josh
    Participant

    Hey David,

    Awesome! I’m glad you were able to find the solution for what you were looking for!

    I’ll go ahead and close this thread. If you have any further questions, please don’t hesitate to open a new thread.

    Thanks!

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Best practises for Woocommerce tickets’ is closed to new replies.