Viewing 1 replies (of 1 total)
  • Thread Starter Marinko

    (@weberteam)

    This one works for loged/non-loged users:

    add_filter( 'woocommerce_get_availability', 'custom_get_availability', 1, 2);
    function custom_get_availability( $availability, $_product ) {
    global $product;
    $stock = $_product->get_stock_quantity();
    if ( $_product->is_in_stock() && is_user_logged_in() ) $availability['availability'] = __($stock . ' On Stock', 'woocommerce');
    else $availability['availability'] = __('', 'woocommerce');
    return $availability;
    }

    But how to apply it to a users that does/doesn’t belong to a group?

Viewing 1 replies (of 1 total)
  • The topic ‘WooCommerce show stock only to list of users’ is closed to new replies.