Code Monkey home page Code Monkey logo

Comments (4)

stevebauman avatar stevebauman commented on August 17, 2024

Hi @ltkrbk, you could use variants for this:

https://github.com/stevebauman/inventory/blob/v1.7/docs/VARIANTS.md#variants

For a specific shoe, you could create variants per shoe size? This allows you to have individual stocks per variant (shoe size).

from inventory.

ltkrbk avatar ltkrbk commented on August 17, 2024

Hi @stevebauman thanks for your quick reply,
I've check the variants and it's useful.But what if one shoes have 3 different colors and each color contains
5 sizes. Such as datas below:
{"inventory":{"color":{"red":{"size":[1,2,3,4,5]},"green":{"size":[1,2,3,4,5]},"blue":{"size":[1,2,3,4,5]}}}}

I think it's little bit difficult for variants to handle.What I think is use Baum\Node for Inventory Model instead of use variants. But I think it's not a good solution,it's tricky to get relationship between each Inventory.Any suggestions?

from inventory.

ltkrbk avatar ltkrbk commented on August 17, 2024

It really clear my mind after I review the code and readme of variants today.Somehow I miss the point of the variants.I am using variants for the inventory now.
Thank you

from inventory.

cdarken avatar cdarken commented on August 17, 2024

Hi @ltkrbk. Can you share a bit of sample code how you managed to use variants with multiple attributes like shoe size and color in your comment?

from inventory.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.