Okay
  Public Ticket #1861675
Image Overlays / sold out badge
Closed

Comments

  • Adrian Bakar started the conversation

    Hello,

    Is it possible to add custom overlays, like SOLD OUT for items that have been sold? I tried a plugin but it didnt work because of the existing mouse over overlay. The theme has overlays for NEW and SALE.. is there a way to add SOLD?

  •  1,205
    Support Agent 1 replied

    Hi Adrian,

    Please note that the theme doesn't have that functionality by default, what you can do is activate child theme and add the following code to the child theme's functions.php file:

    //Add an out of stock overlay to product images when all variations are unavailable
    add_action( 'woocommerce_before_shop_loop_item_title', function() {
    global $product;
    if ( !$product->is_in_stock() ) {
    echo '<span class="sold-out-overlay">Sold Out</span>';
    }
    });
    1975535071.png


    Then, please navigate to Appearance> Customize> General settings and in Custom css field please add the following code:

    .sold-out-overlay {
    background: #654ea3;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    padding: 5px 10px;
    position: absolute;
    right: 18px;
    top: 50px;
    }
    Please adjust background according to your needs.

    Let us know if that helped.



    Regards, BoldThemes team

    If you like our products please consider leaving us a rating. A huge thank you from BoldThemes in advance!