• interact

    (@interactwithdesign)


    Hi, I love the plugin and I just wanted to ask how I can add in a “Coming Soon” badge on the product photo (rather than just in the product title). I’m currently using the following code for adding in a “Sold Out!” badge – but the same format doesn’t really work with your plugin since upcoming is not quite a product stock status. Is this something you could help me with? Or add to the plugin?

    //* Add sold out badge on archive pages
    add_action( ‘woocommerce_before_shop_loop_item_title’, function() {
    global $product;
    if ( !$product->is_in_stock() ) {
    echo ‘<span class=”soldout”>Sold out!</span>’;
    }
    });

    //* Add sold out badge on single product pages
    add_action( ‘woocommerce_before_single_product_summary’, function() {
    global $product;
    if ( !$product->is_in_stock() ) {
    echo ‘<span class=”soldout”>Sold out!</span>’;
    }
    });

  • The topic ‘Adding a “Coming Soon” Image badge’ is closed to new replies.