Change out of stock button - by Fantasy - on WordPress WooCommerce support

This topic has 5 replies, 3 voices, and was last updated 2 months, 2 weeks ago ago by Andrew Mitchell

  • Avatar: Fantasy
    Fantasy
    Participant
    December 20, 2024 at 12:59

    i want to change out of stock product button text currently its showing read more instead of this i want change it to Out Of Stock So how can i change it please help me through

    Files is visible for topic creator and
    support staff only.
    4 Answers
    Avatar: Justin
    Luca Rossi
    Support staff
    December 21, 2024 at 15:38

    Hi @Fantasy,

    Please try adding this custom code under functions.php file locates in your child theme:

    
    add_filter( 'woocommerce_product_add_to_cart_text', 'bbloomer_archive_custom_cart_button_text' );
      
    function bbloomer_archive_custom_cart_button_text( $text ) {
       global $product;       
       if ( $product && ! $product->is_in_stock() ) {           
          return 'Out of stock';
       } 
       return $text;
    }
    

    an also want to change out of stock button color

    Add this custom CSS code under XStore > Theme Options > Theme Custom CSS > Global CSS:

    
    .outofstock .etheme-product-grid-content a.button.product_type_simple.etheme-product-grid-button {
        background-color: red;
    }
    

    Hope it helps!

    Avatar: Fantasy
    Fantasy
    Participant
    December 23, 2024 at 06:30

    add_filter Not working can you do it from my side please

    Avatar: Justin
    Luca Rossi
    Support staff
    December 23, 2024 at 17:01

    Dear @Fantasy,

    We hope this message finds you well.

    We wanted to inform you that the custom code has been successfully implemented, and the button text has been updated as per your request.

    Should you have any further questions or require additional assistance, please don’t hesitate to reach out.

    Best regards,
    The 8Theme Team

    Files is visible for topic creator and
    support staff only.
    Avatar: Andrew Mitchell
    Andrew Mitchell
    Support staff
    December 23, 2024 at 22:47

    Dear Fantasy,

    As we continue our mission to exceed expectations, your insights become increasingly valuable. Could we, with all due respect, request your thoughtful feedback by giving our theme a deserved 5-star rating on ThemeForest?

    Click here to share your valuable perspective: https://themeforest.net/downloads

    Your time and trust are highly appreciated!

    Best Regards,
    The 8Theme Team

  • Viewing 5 results - 1 through 5 (of 5 total)

The issue related to '‘change out of stock button’' has been successfully resolved, and the topic is now closed for further responses

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.