Out of stock or low stock product

Hello everyone,

I have the following situation:
In my store, I offer a quotation option for my customers. They put together a kit of products and save that quote — they can save it directly through our custom app or from the cart. The quote displays the quantity of each item, the subtotal, promotional discounts, the total amount, as well as the available payment methods with their respective calculations for discounts (PIX and boleto) or installment surcharges (credit card).

The problem:
The problem occurs when I have an item that is out of stock or has less stock than the requested quantity.

  • Scenario 1 - Item out of stock | stock = 0
    When the product has no stock, the requested quantity is kept, but the product price is not included in the quote. Fixing this behavior by adding the value of out-of-stock products to the total item value introduces another problem: the shipping cost for that item is not calculated. In my case, this is very important, because depending on the quantity, I can lose over R$ 500.00 on shipping alone. Currently, to work around this problem, I stopped displaying out-of-stock items. However, that is not what I want.

  • Scenario 2 - Item with less stock than requested.
    Requested quantity: 22
    Available stock: 20
    In this scenario, the situation is worse, because the orderForm automatically changes the requested quantity to the available quantity, which can often lead the customer to purchase a kit with missing items, making it impossible to assemble their system.

What I need:

  1. Calculate the shipping cost for out-of-stock items.
  2. Save the exact quantity of items selected by the customer. (I would prefer not to store this information in customApps)

This way, I could deliver a more accurate quote to the customer and inform them if the available quantity differs from what they need.

Note: We already work with pre-sales, which partially solves Scenario 1, but not Scenario 2.

Thanks in advance!

Hey @jacksonadh, how’s it going?

If your store operates as B2B, VTEX already offers a dedicated app for quotes/quotations through its B2B Suite solution, called B2B Quotes.
I’d recommend checking out that documentation and considering adopting the B2B Suite.

Now, if you’d rather stick with the custom solution, one alternative would be to create a phantom warehouse with unlimited quantities for all SKUs and attach it to one (or as many as needed) shipping policies that replicate your original one. Then, when simulating fulfillment to generate quotes, always use those policies with infinite stock. That way, you won’t run into issues with low or zero inventory anymore. However, with this setup, customers shopping at your store will also see all your products as always being in stock.

Gabriel Cardoso Bertolucci
Field Software Engineer | VTEX

Thanks @gabouls, we solved the problem by displaying the value only for the quantities in stock, and with a customData, we can save the quantity the customer wanted, so we can inform them that they quoted 2x but only x is available. This solved the problem.

B2B Quotes doesn’t work for us.

Awesome @jacksonadh, thanks for sharing!