Product Variant confusion

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
11 Jahre weitere
Hello,

I need some help understanding product variants and how they work.

Currently I have an import program that processes a xml data feed that has 5000+ products. For each new product I insert a row into the Product table with product name and description and the other values needed. I also insert a row into the ProductVariant table with the product.id and prices, but without descriptions. We did it this way to get the site up as quick as possible.

Now that the site is up we would like to implement product variants, but I am a bit confused regarding the data layout.

Here is an example of my confusion. We have the following products in our store…

  Balance Bar Nimble Nutrition Bar for Women Yogurt Orange Swirl, 12 - 1.16 oz (33g) Bars
  Balance Bar Nimble Nutrition Bar for Women Peanut Butter, 12 - 1.16 oz (33g) Bars

Each bar is in the Product table and is also in the ProductVariant table being the variant for itself so we have pricing.
When I go into admin and make the Peanut Butter bar a variant for the Orange Swirl I end up duplicating the Peanut Butter bar in the ProductVariant table which does not seem correct to me. If this is correct then if I had a product with 8 variants I would end up which lots of duplication which would make updating pricing a nightmare.

The way I thought it would work would be that each product would be in the Product table and somehow the product variants would be mapped so there would only be one ProductVariant row for each product.

Maybe this is how it is working and I am just not seeing it. Could someone please explain to me how this all works? I am interested in the data structure as I need to modify my import application.

Thanks,
Rhek
11 Jahre weitere
Product to ProductVariant is a one to many relationship.  A Product can have many Variants, but a ProductVariant will only belong to one Product.
11 Jahre weitere
Hello,

So does that mean I will have multiple rows in ProductVariant that could be duplicated except for the productId column? If so, how does one maintain pricing? Example would be the Peanut Butter bar is a variant of 8 other bars and the price just went up. So do I now need to update 8 product variant rows?

Thanks,
Rhek
11 Jahre weitere
It sounds a bit confusing.
You have X products, each of which have its own variant(s). Each variant have a unique ID and a unique ProductID.
As you import products, it means that data come from some other source.
An ecommerce platform aim is to offer specific selling tools, not to manage data in custom manner: for this you need database sw, that offer all the flexibility you need.

My sugegstion is to work offline with, say, Access, generate XML according to your needs and import it in Nop.
11 Jahre weitere
Hello,

Thanks for the reply. I am working offline using Microsoft SQL, the xml data feed and a WPF import application I wrote. Just trying to wrap my head around the how Product Variants work. My main concern is duplicated variant data with only the product id being different as in my example above.

Thanks,
Rhek
11 Jahre weitere
In fact, that's why I suggested to work with an external tool.
If you have a many- to - many relationship, then you need a cross reference table for mass updating. You can add it to Nop schema if you wish.
11 Jahre weitere
Another consideration is using Product Attributes (which are actually Product Variant Attributes).  For example,
Product: Balance Bar Nimble Nutrition Bar for Women
Variant: Unnamed
Attribute: Flavor (Orange, Peanut, ...)

This would allow update of price on just that one variant, but would not work so well if your pricing is flavor specific  - attributes can have price adjustment, but it would be hard to manage via import.

Also, you could then have variants of "Balance Bar ..." based on Size - eg. "Single Bar", "Case of 12", etc.
11 Jahre weitere
Hello,

I will need to look into attributes a bit more.

Thanks everyone for your input.
Rhek
11 Jahre weitere
Yes, the Price is on the ProductVariant, not the Product.  If you are tracking inventory, you can do ProductAttributeCombinations that will allow you to have one price but also track the items in stock.
11 Jahre weitere
Hello, I have a similar product variant problem and are having trouble understanding them.

I used the feed template from nopadmin, added all my data. On the Product Variants column I have some products that have more than one variant i.e.

a wheel chair available in blue, red, silver, purple.

so naturally i then put their id's with ; in the spreadsheet.

Once i imported the feed instead of creating a different line for each of the variants belonging to this product it just creates one entry and titles it like this wheelchair blue;wheelchair red etc?

I would have thought it works in the same way as the categories where you list where you want the product to be categorised and if there is more than one category you put a ; between it.

can you help with my confusion? also is this the best way to do this or should these be done under Cross sells instead?

many thanks

MK
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.