Skip to main content

How would i go with making an inventory for products?

General • Asked by Wesly Mezarina

I'm not sure if i'm saying it right but how can i manage inventory for my products? What are some steps that i have to take to get started?


This probably depends on a lot of things. Are you getting in shipments of new items? Are the products being consumed? (sometimes this might not be the case if you're talking like inventory of trucks for example)

More details on what you're shooting for would be helpful but I'm sure we can come up with a fairly straightforward solution to it.


I'm getting more into products in a ecommerce store. Say i have shirts for sale and i want to keep track of how many i have and of how many i sell and ship. How would i keep a count of that?


I assume you'll be using Rails, so you might want to check out SpreeCommerce. I haven't used it myself yet, but it looks very promising.

If you YouTube SpreeCommerce, some pretty detailed videos should come up.


Spree is one approach if you want to use something premade.

As far as keeping inventory of things like shirts, you can probably do two separate things:

  1. You keep track of new additions to our inventory, maybe call them new stock or something. Record the amount of tshirts added each time you get more inventory added in stock.
  2. Keep track of the orders and the quantity of shirts leaving each time.

The total "in stock" inventory will simply be summing up all the times you added new stock and subtracting the sum of all the quantity ordered. You can cache a copy of the current value in stock and update each time you add inventory or have new orders.

You can then get a history of the inventory over time in your store and what's leaving. This will be helpful for seeing and predicting how much inventory it makes sense to keep on hand and can be useful for other things as well.


Login or Create An Account to join the conversation.

Subscribe to the newsletter

Join 27,623+ developers who get early access to new screencasts, articles, guides, updates, and more.

    By clicking this button, you agree to the GoRails Terms of Service and Privacy Policy.

    More of a social being? We're also on Twitter and YouTube.