Developer forum

Forum » Integration » Blueprints - Mapping discounts

Blueprints - Mapping discounts

Michael Knudsen
Reply

Question regards discounts in the blueprint: https://doc.dynamicweb.dev/manual/dynamicweb10/integration/guides/blueprints/bc-odata-v4-blueprint.html#import-prices--discounts-new-pricing-experience

I have been trying to replicate the configuration from the blueprint, but I'm not able to run the job, because it fails on the mappings marked with red (cannot prepend to a empty source field)
Table 15 - Discount type with valid EndingDate

Product_No DiscountProductsAndGroups  
  DiscountProductsAndGroups Prepend: [some][p:
DiscountProductsAndGroups Prepend: ,
  DiscountProductsAndGroups Constant: ]

Furthermore do I need to include the VariantId in the construction of the DiscountProductsAndGroup, but I need the DW id like color_0000.size_xl and not the variant code 0001 from BC.

Does anyone have a working example of such a mapping?

Br. Michael Knudsen


Replies

 
Rasmus Sanggaard Dynamicweb Employee
Rasmus Sanggaard
Reply

Hi Michael,

 

Are you using DW10? In DW mappings append if mapped to the same Destination. This is not possible in DW9. 

If you are using DW10, then you do not need to replicate the mappings, you can download all the job files from App Store and work from there trying to mimic the variant id you have in BC.

 

BR Rasmus Sanggaard

 
Michael Knudsen
Reply

Hello Rasmus,

- I'm using DW10 and even if I choose to install the Blueprints, these won't work correct with variants, since my variants have multiple dimensions (color_0000.size_xl). 

The Blueprint documentation are many places different from the Blueprint (0.0.8) from the App store.

Br. Michael Knudsen

 
Matthias Sebastian Sort Dynamicweb Employee
Matthias Sebastian Sort
Reply

Hi Michael,

When working with scripttypes "Prepend" and "Append" it does that to the source column in the mapping.. so when you have a setup like this "Code" --> "DiscountProductsAndGroups" (with Prepend "[some][p:") and right after you have "Variant_Code" --> "DiscountProductsAndGroups" (with Append "]").. then if your "Code" is "Product123" and "Variant_Code" is "_abc" then the first mapping will be "[some][p:Product123" and the 2nd mapping will be "_abc]". so total outcome of the "DiscountProductsAndGroups" would be "[some][p:Product123_abc]" 

I do see that in the database the syntax is with a comma to separate productId and variantId so you could set it up like this 

If you are able to fetch the different variantIds in the endpoint, you can add them to the sequence but have the "Constant" mapping at the end. The provider will merge the values together in the order your mappings are going with top to bottom principle.

We are currently working on making our documentation better for the Blueprints

BR

Matthias Sort

 
Michael Knudsen
Reply

Thanks for the clearification Matthias, I'm looking forward to see the Blueprints documentation, once your work updating the Blueprints are done :-)

Br. Michael Knudsen

 

You must be logged in to post in the forum