Magento add product size and attribute inventory

17,100

Creating a Configurable Product

There are a few steps involved:

  • Create the attributes that will be configurable by the user - for our example they will be Size and Color
  • Create the attribute set that will be assigned to the variant products - for our example, we’ll call it “T-shirt”
  • Create the individual variant products
  • Create the configurable product, and add the “T-shirt” attribute set
  • Add the individual variants to this configurable product

http://www.magentocommerce.com/knowledge-base/entry/tutorial-creating-a-configurable-product/

Adding a new attribute to the table isn't to difficult, but you need to find a good way of making sure it's not dirty. You do not want to add empty attributes to make sure you have room for enough products and you don't want to have too few. I was recommended using implode on an array to put it into a variable in which each element of the original ray is stored and separated by a character. You could then put this into one column. You can find some good information for updating a magento table here: http://www.magentocommerce.com/knowledge-base/entry/magento-for-dev-part-6-magento-setup-resources/

Share:
17,100
denislexic
Author by

denislexic

Started learning programming on youtube and forums. Now I am addicted to it.

Updated on June 07, 2022

Comments

  • denislexic
    denislexic almost 2 years

    I think this is a common situation, I'm selling clothes and shoes and I need to have an option for sizes and attribute an inventory level for each. How could I do that?

    Here is an example, I m selling shoes in sizes 41 to 45. I have 5 pairs of each except the size 45 which I only have 2. (Keep in mind that clothes and shoes don t have the same measurement options).

    Would be awesome if I could do it for all products in a category at the same time, even if that means having to go through the DB.

    Thanks.

  • denislexic
    denislexic almost 12 years
    Thanks @Nathan Mann - But I can t see where I can set the stock for each size.
  • denislexic
    denislexic almost 12 years
    Is there a way by hacking it through the dabatase?
  • Sturm
    Sturm almost 12 years
    There are definitely ways of hacking it... You could add another column to each row, create an array and implode it to match the attributes you have for the item, add new fields for quantity in the adminhtml. You could find a way to associate each individual attribute with a simple product of its own. That would be the most flexible method as you could easily specify prices and quantities for each individual attribute. There are plenty of ways to make it happen, it's up to you how much work you're willing to put into it or how much money you're willing to spend to get it done.
  • Thiago Macedo
    Thiago Macedo almost 11 years
    A more elegant solution can be more than desired. Look at the shoes store example: maintain 30 DB items (size and color) for a single product doesn't look reasonably.