Developer forum

Forum » PIM » Variant prices via the EcomProvider

Variant prices via the EcomProvider

Davy Capiau
Reply

Hi

I've been having problems with VariantPrices.

My questions in short:

- Is it possible to import variantprices by their ProductId instead of the combination: masterproduct-ProductId + ProductVariantId? Maybe not via the ecomprovider?
- If so, is there a way to use the Product-id instead of the MasterProductId? 

My case:

  1. First I created all my products without combining them
  2. Then I imported via the EcomProvider (batch,csv) all my product prices with their ProductId
  3. Products were combined
  4. ISSUE: I noticed on the frontend prices didn't change when a variant was selected
    1. I discovered that the price matrix on a combined product doesn't allow to use the productId of the variant, but you select the DW-variantproductid (E.g VO27)
    2. Then I discovered you should use the masters' ID instead of the product's when importing via the EcomProvider. Which is not ideal since it's not always known in advance
  5. Then I imported 1 variant (out of 6) using this new method
  6. Result
    1. The price of this Variant was shown correct
    2. When I selected other variants I noticed their own price showed as well. This is bizarre because they were not imported with the import in step5. It seems the system fetches the price from my second step, from when they were not combined
  7. So I hope there is a way to import prices for combined products, using their own ProductId and or VariantproductId?

 


Replies

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Davy,

If I understand your process correctly, the outcome is expected as you have imported prices based on a less specific rule (ProductId).

If you want variant-specific prices, you should use the combination of ProductId + VariantId or ProductNumber (assuming each variant has a unique ProductNumber).
I am not sure if importing based on ProductNumber is an out-of-the-box functionality, I remember in the older versions we had to use some table scripting in the Import job but things may have changed in newer versions.

I hope this helps.

Adrian

 

 
Davy Capiau
Reply

Hi Adrian,

No not exactly because:

- I want to import on ProductId (=id our customer generated 'abc123') of the variant itself and not of the master

- As described in my case, I got in step 6) the variant prices to show, although they were not imported on the master product (so not visible backend) and the 'functionality' was triggered by only importing one variant on the master product via the EcomProvider following the structure: MasterProductId + VariantId (so not the id of the variant itself, but the variant id generated by DW, like VO27). I want to know if that's a bug, or something I could use in my advantage by importing it like I want in the previous point.

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Davy,

I believe there may be a confusion regarding the terms used.

Every product in the database has 4 properties that would identify it uniquely (apart form ProductAutoId which is generated):

ProductId, VariantId, ProductLanguageId, ProductNumber.

This is how your table would like like:

ProductId VariantId ProductLanguageId ProductNumber ProductName
Product001   LANG1 MasterProductNumber This is master
Product001 RED LANG1 RedVariantProductNumber Red variant
Product001 BLUE LANG1 BlueVariantProductNumber Blue Variant

Usually, what you can control is ProductNumber as ProdiuctID and ProductVariantID are generated by Dynamicweb when creating a product through the interface. When you import products, would can control all these values.

Adrian 

 

 

 

 
Davy Capiau
Reply

Hi Adrian,

Thanks for making the overview. Indeed there might have been some confusion about the terms used.

When I combine products, I don't have a MasterProductNumber (Check screenshot)

Also, when using your example table, I want to import prices on 'RedVariantProductNumber' and  'BlueVariantProductNumber.

The reason: the source of the price import doesn't know the ProductId.

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply
This post has been marked as an answer

Hi Davy,

I understand. That's how it usually happens. If you cannot control the ProductID when you import the Products, you won't be able to use it for further sync.

First, I would identify all the data that you will have to connect using the ProductNumber.

DW may already have some of the Integration Providers prepared for identifying the products based on ProductNumbers. If not, the solution is to build a TableScripting that would do this matching for you.

The reason I have mentioned identifying all scenarios is that TableScripting needs to be developed for each table specifically. You cannot build a Table Scripting that would be generic (hence the Table in the naming). Keep in mind that TableScripting means code development.

I hope this helps.

Adrian

Votes for this answer: 1

 

You must be logged in to post in the forum