Support » Plugin: WooCommerce Sold Out Products » How To Detect When A Product Is Sold Out And Do Something?

Viewing 1 replies (of 1 total)
  • Plugin Author Gerhard Potgieter

    (@kloon)

    Hi visualxl

    This is not really related to the plugin but here goes, the following code will detect if a product is sold out

    global $product;
    if ( ! $product->is_in_stock() ) {
        // your code here to execute when out of stock
    }
Viewing 1 replies (of 1 total)
  • The topic ‘How To Detect When A Product Is Sold Out And Do Something?’ is closed to new replies.