Solidus can manage your store's inventory. This allows you to keep track of your current stock, backorder stock, as well as sold and shipped inventory. Because inventory touches orders, shipments, and the contents of your physical warehouse, there are many essential moving parts:
Spree::InventoryUnit: Represents a stock item that has been sold. For more information, see Inventory units .
Spree::StockItem: Counts the inventory for a specific
Spree::Variantat a specific
Spree::StockLocation. For more information, see Stock items .
Spree::StockLocation: Represents a location where stock items are shipped from. Each stock location has
Spree::StockItems for each variant in the store.
Spree::StockMovement: Represents stock being moved from one
Spree::StockLocationto another, or being added or removed from your store's inventory. For more information, see Stock movements .
Spree::ReturnItem: Represents an inventory unit that is returned by a customer. For more information, see Return items .
If your store does not require inventory tracking, you can turn off the inventory system using Spree's application-wide configuration.
In your application's
/config/initializers/spree.rb file, you can add your
track_inventory_levels configuration to the main
Spree.config do |config| config.track_inventory_levels = false end
Spree::InventoryUnit object is created every time that an item is sold. It
tracks the state of the sold item. The state could be
Inventory units associate each sold item with many other Solidus models. This includes the specific variant that was sold, an order, a line item, and a shipment.
Spree::InventoryUnit is created, your store's stock is tracked using
a number of stock management models. The following sections summarize the
models and their functions in the stock management system.
On-hand inventory is tracked using the
Spree::StockItem model. Each
Spree::Variant in a store has a corresponding
Spree::StockItem object with a
count_on_hand value that represents the number of items you have in stock.
Note that if you have two
, there are two
Spree::StockItems for each variant in your store: one for each
Spree::StockLocation. Each stock item counts the number of items in stock at a
specific stock location.
Whenever stock items are sold to customers, added to inventory, or removed from
inventory, a new
Spree::StockMovement object is created. The stock movement
object documents how many items were added or removed.
Spree::StockMovement corresponds with a
Spree::StockItem and how much
count_on_hand increases or decreases.
Spree::StockLocation represents a location where your inventory is shipped
from. Each stock location has many
Once a new stock location has been created, a new set of
are created for it. The new set represents
Spree::Variant in your store.
If you manage multiple stock locations and inventory frequently moves between
them, you may benefit from the
extension. This extension
adds a user interface for managing transfers in the
Spree::ReturnItem is created for each inventory unit that a store
administrator has included in a
Once a return item is received back from the customer, it can be re-added to
your on hand inventory.
Note that not all return items are resellable, as customer returns can be made for many reasons.
For more information, see the Returns documentation.
Solidus is an open source platform supported by the community. We encourage everyone using Solidus to contribute back to the documentation and the code.