Alert Customers of Low Stock

New Member
2 0 1

I am looking for an app that will let customers know when a certain product, specifically product variant(s), is low in stock. I sell apparel, so the ability to work with size and color variants is crucial.

Any feedback is appreciated!

1 Like
Shopify Partner
1179 1 62

Hi Andrew,

You don't need an App if you want to show customers that a variant is low in stock. This is supported by Shopify already.

The trick is you need a theme that displays how much stock is left when a variant is selected.

If your existing theme doesn't have this you will need to add it yourself, although it isn't a basic customization (consider hiring an expert - it shouldn't take more than a hour to get it working).

You'll need to find the selectCallback code and modify it so that it displays the available quantity when a variant is chosen. For example:

	var selectCallback = function(variant, selector) {
		if (variant && variant.available) {
			jQuery('#purchase').removeClass('disabled').removeAttr('disabled'); // remove unavailable class from add-to-cart button, and re-enable button
			var price = Shopify.formatMoney(variant.price, "{{ shop.money_format }}");
			var compare = variant.compare_at_price == null ? "" : " <del>" + Shopify.formatMoney(variant.compare_at_price, "{{ shop.money_format }}") + "</del>";
			jQuery('#product-price').html(price + compare);  // update price field
            
            // update available quantity field
    		jQuery('#available-qty').text(variant.inventory_quantity);
            
			if (variant.inventory_management === "shopify" && {{ settings.available-qty }}) {
				jQuery('#available-qty-wrap').show();
			} else {
				jQuery('#available-qty-wrap').hide();
			}
            
            jQuery('#product-qty').empty();
            var max = 20;
            if (variant.inventory_management == "shopify") {
                 max = variant.inventory_quantity > 20 ? 20 : variant.inventory_quantity
            }
            for (i = 1; i <= max; i++){
                jQuery('<option/>').val(i).html(i).appendTo('#product-qty');
            }

        	jQuery('#product-qty-wrap').show();
            
		} else {
			jQuery('#purchase').addClass('disabled').attr('disabled', 'disabled'); // set add-to-cart button to unavailable class and disable button
			var message = variant ? "Sold Out" : "Unavailable";    
			jQuery('#product-price').text(message); // update price-field
			jQuery('#available-qty').text("0");  // update available quantity field
        	jQuery('#product-qty-wrap').hide();
    		jQuery('#available-qty-wrap').hide();
		}
	};

HTH, Gavin.

Take a look at our Apps: www.bookthatapp.com ♥ www.searchifyapp.com ♥ www.productsassistant.com
0 Likes
Shopify Expert
5 0 1

Hi,

To let the customer know about when the out of stock product will be in stock is important for conversion and also for building s trust with the customer

You can use the Shopify Stock Notifier app where Admin can manage the stock with proper notifications once the product reaches to the minimum quantity after which the product needs to be restocked. An email notification is sent to the customers also, when the product is restock. Thus helps increase sales, as now the customer will be aware about the product restock. This will help in analysing which products are hot in market and the products needs to be rebuild because of their poor sale.

For any questions, please raise a ticket at http://webkul.uvdesk.com

Regards,

Neha

Regards, Neha Webkul
0 Likes
Shopify Expert
5 0 1

Hi,

You can check the Sock Notifier, as it would perfectly suits your needs.

With the help of this app, now merchant (admin) can manage the stock with proper notifications once the product reaches to the minimum quantity after which the product needs to be restocked. An email notification is sent to the customers also, when the product is restock. Thus helps increase sales, as now the customer will be aware about the product restock. This will help in analysing which products are hot in market and the products needs to be rebuild because of their poor sale.

Features:

  • Set the minimum quantity of product
  • Restock products with a click
  • Enable/disable option of "Notify me" when products are Out of Stock
  • Notifications and Communications on registered email of Merchant
  • Responsive Web Design
  • Notification and Communication via customer's email
Regards, Neha Webkul
0 Likes
Highlighted
New Member
1 0 0

I'm interested in adding this function our website too. Which section should I add this code in?

0 Likes