Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1379204
    Kevin C
    Participant

    Managed to find this code and it works well to grey out sold out variant.

    add_filter( 'woocommerce_variation_is_active', 'grey_out_variations_when_out_of_stock', 10, 2 );
    function grey_out_variations_when_out_of_stock( $grey_out, $variation ) {
    
    if ( ! $variation->is_in_stock() )
        return false;
    
    return true;
    };

    What can I add to add the “Sold Out” text behind these variants?

    #1379361
    Rupok
    Member

    Hi there,

    Thanks for writing in! Regretfully, at this time I am not entirely certain what it is you would like to accomplish based on the information given in your post. If you wouldn’t mind providing us with a little more clarification on what it is you’re wanting to do (a link to a similar example site would be very helpful, or perhaps some screenshots), we’ll be happy to provide you with a response once we have a better understanding of the situation.

    #1379509
    Kevin C
    Participant

    Hi Rupok,

    Thanks for checking. I have added a screenshot, taken from another non-woocommerce site, for your reference.

    #1379669
    Lely
    Moderator

    Hello Kevin,

    Please check this article for guidance:https://www.skyverge.com/blog/add-sold-out-to-woocommerce-variable-product-dropdow/

    Hope this helps.

  • <script> jQuery(function($){ $("#no-reply-1379204 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>