• Resolved karlhunter92

    (@karlhunter92)


    Im doing a website for a client who has 3 different variations to products, he wants ‘please contact customer service’ when clicking on some of the variations is this possible? So kind of instead of out of stock for that variation just that specific message. Thanks

Viewing 1 replies (of 1 total)
  • add_filter( 'woocommerce_get_availability', 'ahirwp_custom_availability', 5, 2 );
    
    function ahirwp_custom_availability( $availability, $_product ) {
    
        // If the product is out of stock
        if ( ! $_product->is_in_stock()) {
    
            $availability['availability'] = __( 'please contact customer service', 'woocommerce' );
        } 
    
      return $availability;
    }

    Add above function in active theme’s functions.php

    Thanks
    Ahir Hemant

    • This reply was modified 1 year, 7 months ago by Ahir Hemant.
Viewing 1 replies (of 1 total)
  • The topic ‘Change out of stock to….’ is closed to new replies.