You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
IsProductSalable (checks whether product salable or not for the particular stock)
GetProductSalableQty (returns the salable quantity of product assigned to the particular stock)
in the scope of the current ticket, we need to add new service
IsProductSalableForRequestedQty::execute(string $sku, int $stockId, float $requestedQty): boolean
Idea behind this service is to apply all the Inventory configuration/restrictions etc to determine whether we can sell the amount Customer wants to buy.
it’s not just GetProductSalableQtyInterface() > $requestedQty (which we do now).
Because there could be - Can manage Stock = 0 (in this case we no need to care about Stock Qty at all, for example, for Downloadable product)
or, Min Salable Qty = 40. And even having 30 items in stock we still can’t sell it to Customer, because we sell starting from 40 items (just wholesales allowed).
Or, if we have Backorder enabled and could sell even more than we have in stock
that’s why - all that should be the responsibility of IsProductSalableForRequestedQty(string $sku, int $stockId, float $requestedQty) service.
We will use it as a check when customer puts the product into the shopping cart
These three services
IsProductSalable
getProductSalableQty
IsProductSalableForRequestedQty
should be placed into InventorySalesApi module.
And all these service are related to salability of the product , but not availability , because we could have some products in our warehouse which occupy space and available at the same time, but because of configuration (we sell just for wholesales) we can’t sell it to retail customers
The text was updated successfully, but these errors were encountered:
Currently, we have two services
IsProductSalable
(checks whether product salable or not for the particular stock)GetProductSalableQty
(returns the salable quantity of product assigned to the particular stock)in the scope of the current ticket, we need to add new service
IsProductSalableForRequestedQty::execute(string $sku, int $stockId, float $requestedQty): boolean
Idea behind this service is to apply all the Inventory configuration/restrictions etc to determine whether we can sell the amount Customer wants to buy.
it’s not just
GetProductSalableQtyInterface() > $requestedQty
(which we do now).Because there could be -
Can manage Stock = 0
(in this case we no need to care about Stock Qty at all, for example, for Downloadable product)or,
Min Salable Qty
= 40. And even having 30 items in stock we still can’t sell it to Customer, because we sell starting from 40 items (just wholesales allowed).Or, if we have Backorder enabled and could sell even more than we have in stock
that’s why - all that should be the responsibility of
IsProductSalableForRequestedQty(string $sku, int $stockId, float $requestedQty)
service.We will use it as a check when customer puts the product into the shopping cart
These three services
should be placed into InventorySalesApi module.
And all these service are related to
salability
of the product , but notavailability
, because we could have some products in our warehouse which occupy space and available at the same time, but because of configuration (we sell just for wholesales) we can’t sell it to retail customersThe text was updated successfully, but these errors were encountered: