WordPress.org

Ready to get started?Download WordPress

Forums

WooCommerce - excelling eCommerce
[resolved] Hide Stock Quantity Without Hiding in/out of Stock Status (2 posts)

  1. Palexandra
    Member
    Posted 8 months ago #

    I have found this snippet to hide the stock quantity without hiding in/out of stock status:

    // Hook in
    add_filter( 'woocommerce_get_availability', 'custom_override_get_availability', 1, 2);

    // Our hooked in function $availablity is passed via the filter!
    function custom_override_get_availability( $availability, $_product ) {
    if ( $_product->is_in_stock() ) $availability['availability'] = __('In Stock', 'woocommerce');
    return $availability;
    }

    However, when using this snippet the box to enter the quantity needed also disappears. I need my customers to still be able to select how many they want to order, but maybe receive a message saying "only "x" amount left in stock, please adjust your quantity" or something like that.... is that possible? Event with no message only let them order up to the amount in stock..... Please help!

    http://wordpress.org/plugins/woocommerce/

  2. Palexandra
    Member
    Posted 8 months ago #

    RESOLVED, MY BAD.

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.