Developer forum

Forum » Integration » Importing product variants with different price and stock

Importing product variants with different price and stock

Espen Strømsnes
Reply

I have seen the video regarding simple or extended product variants that you have, but I still have a few questions:

The use-case is as follows:
-Products with SIZE and COLOR variants with individual price and stock information on each variant combination
-3 languages
-Prices in 6 currencies

What's the best way of organizing these data in DW?

I have 2 possible ways of arranging these data in DW. Both options is based on the following:

Creating variant groups (in EcomVariantGroups) for SIZE and COLOR (per language).
Creating variant options (in EcomVariantOptions) for the various SIZE- and COLOR-options (per language)
Prices for each variant, language and currency in EcomPrices.

Method 1:
Having 1 record in EcomProducts for each product (per language) (with EcomProducts.ProductVariantId = null) and having all the variant options for the
product as records in EcomVariantOptionsProductRelation.

Method 2:
Having records for each variant combination (PRODUCT/SIZE/COLOR) as records in EcomProducs (per language).
EcomProducts.ProductVariantId will then be set as a combination of size and color (i.e. "COLOR235.SIZE39").


Which of these 2 methods do you recommend or is there a better way?


One other issue is that the stock is on each variant combination. I.e. "PROD1 COLOR235.SIZE39" has it's own stock.
This can easily be solved when using Method 2, but I cannot figure out how to support variant stock if method 1 is used.

 


Replies

 
Espen Strømsnes
Reply

Regarding method 1: I tried inserting stock data for each variant into the table eComStockUnit but I'm not sure if this is correct.

Sample data variant1:

StockUnitProductId: PROD1
StockUnitVariantId: COLOR235.SIZE39
StockUnitId: PROD1-COLOR235.SIZE39
StockUnitQuantity: 10

Sample data variant2:

StockUnitProductId: PROD1
StockUnitVariantId: COLOR235.SIZE40
StockUnitId: PROD1-COLOR235.SIZE40
StockUnitQuantity: 50

 

If this is the correct way for inserting variant stock when using method 1, the question boils down to which of the 2 methods do you recommend for product databases with such variant combinations; i.e. 50 sizes, 1200 colors and 3 languages? The number of sizes and colors are the maximum number of variants; in practice there will never be that many combinations. 

 

 
Nicolai Høeg Pedersen
Reply

Hi Espen

I Recommend option 2 - then you are better off for varying properties, images etc. if it arises.

I'm not sire your data for stock unit is correct, it looks ok. You can import a product and give it a stock level using the userinterface and see the data from there.

NP

 

You must be logged in to post in the forum