Home Forums WoodMart support forum WooCommerce Hide Prices When Inventory is set to '0' or 'out of stock'

WooCommerce Hide Prices When Inventory is set to '0' or 'out of stock'

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #246448

    previna
    Participant

    Hello, how to hide prices with stock quantity 0?

    I used this function.

    add_filter( “woocommerce_variable_sale_price_html”, “theanand_remove_prices”, 10, 2 );
    add_filter( “woocommerce_variable_price_html”, “theanand_remove_prices”, 10, 2 );
    add_filter( “woocommerce_get_price_html”, “theanand_remove_prices”, 10, 2 );

    function theanand_remove_prices( $price, $product ) {
    if ( ! $product->is_in_stock()) {
    $price = “”;
    }
    return $price;
    }

    #246637

    Hello,

    Please refer to the Woocommerce community on this issue as our support does not cover the Woocommerce customization.

    Best Regards

Viewing 2 posts - 1 through 2 (of 2 total)