How to replace the 'out of stock' text on my woocommerce site?

Home Forums Ticket Products Event Tickets Plus How to replace the 'out of stock' text on my woocommerce site?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #943813
    Christian Thomson
    Participant

    Hi guys,
    I have searched and found solutions to my question, however I’m not getting it to work. So I’m assuming my issue relates to the fact I’m using Woo Tickets.

    This is the page where I’d like to replace the “Out of Stock” text with “Class is full”:

    OFA Level 1 (Langley)

    And I found this function for what I want:

    add_filter( ‘woocommerce_get_availability’, ‘custom_get_availability’, 1, 2);

    // Our hooked in function $availablity is passed via the filter!
    function custom_get_availability( $availability, $_product ) {
    if ( !$_product->is_in_stock() ) $availability[‘availability’] = __(‘Class is full’, ‘woocommerce’);
    return $availability;
    }
    From here:https://wordpress.org/support/topic/woocommerce-remove-related-products-and-change-out-of-stock-text

    But it’s not working – what’s wrong with the code above?

    Thank you!
    Cintia

    #943817
    Brian
    Keymaster

    Hi,

    I can help you out here.

    We create our own form to show the tickets in the Events so that coding will not work.

    However, if you follow our themer’s guide:

    https://theeventscalendar.com/knowledgebase/themers-guide/

    You can move and edit this file in your theme:

    wootickets\views\wootickets\tickets.php

    There you can see the text Out of Stock! and can rename it to what you would like.

    Let me know if that works for you.

    Thanks

    #945209
    Christian Thomson
    Participant

    Yes, that worked! Thanks!

    #945464
    Brian
    Keymaster

    Great, glad it helps, I am going to go ahead and close this ticket, but if you need help on this or something else please post a new ticket.

    Thanks!

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘How to replace the 'out of stock' text on my woocommerce site?’ is closed to new replies.