Support » Plugin: WooCommerce Cart Stock Reducer » In Cart Badge

  • First of all, love the plugin. It helps my company a lot since we have a lot of 1/1 items to sell.

    I had a question regarding the badge, right now when something is in a cart and it’s the last one it will have a “Sold Out” badge. Is it possible to have a “In Cart” badge, and then switch once the product has been purchased?

    Just curious, thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author James Golovich

    (@jamesgol)

    What theme or plugin are you using to display the ‘Sold Out’ badge?

    Thread Starter rainingbrains

    (@rainingbrains)

    I use a php snippet

    add_action( 'woocommerce_before_shop_loop_item_title', 'bbloomer_display_sold_out_loop_woocommerce' );
     
    function bbloomer_display_sold_out_loop_woocommerce() {
        global $product;
     
        if ( !$product->is_in_stock() ) {
            echo '<span class="soldout">' . __( 'SOLD OUT', 'woocommerce' ) . '</span>';
        }
    }
    Plugin Author James Golovich

    (@jamesgol)

    You could have your code check if that product is in the users cart and if it is then change the badge that is displayed.

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.