Developer forum

Forum » Integration » EcomDiscount best practices

EcomDiscount best practices

Davy Capiau
Reply

Hi,

I'm using the DynamicwebProvider to import different discount rules. I have some questions:

 

  1. What is the best practice to import the translations of the rules in the EcomDiscountTranslations table? I want to avoid needing to export the rule id's out of DW to import it again as a key.
  2. In the EcomDiscount table the DiscountProductsAndGroups header defines which products trigger the rule. When adding variants you'll see the master sku and it's variant id's are used: "[some][p:GCN 08,VO5][p:GCN 08,VO6][p:GCN 08,VO4]". I want to avoid working with the variant-id's generated by DW. Is the rule stable when using the variant's own sku? In this case creating: "[some][p:GCN 08,][p:GCN 09,][p:GCN 10,]"
  3. Are there any more best practices I should know about? This project will import and use a lot of Discount rules

Replies

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply
This post has been marked as an answer

@1: DISCOUNTID column of the table is one you can control your self. So invent your own ID (Not using 'weird' characters). In that way you can import the translations using those IDs

@2: It is the product IDs - so as long as your productid and SKU is the same, you are good to go. Be careful about weird IDs - i.e. containing ;.-!"#¤%&/()=?`and stuff like that - they might be alergic to correct encoding and formatting.

@3: What is a lot? Performance can be an issue if you add 'a lot' - because they all need to be checked if they are applicable. So if you show 1000 products and have 1000 discounts, that would be around 1.000.000 checks..... One best practice could be to esnure you do not repeat too many of the same discount. I.e. if you have 2 products with 10%, you do not create 2 discounts, but only one - and if you have many products in a discount, i.e. more than 10-20, move the products into a product group and apply the discount to that group instead. These kind of tricks can help on performance if you have 'a lot'

Votes for this answer: 1
 
Davy Capiau
Reply

Hi Nicolai,

Thanks that's clear!

An extra question: can we use the header DiscountProductIdByDiscount in EcomDiscount to add more than 1 product?

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

ProductIdByDiscount can only contain one productid - can be combined with ProductVariantIdByDiscount if it is a variant. But only one free product per discount.

 
Davy Capiau
Reply

Hi Nicolai,

I've discussed this with our client. Their B2B business runs on promotions like this so I need to come up with a solution.

Any creative thoughts on how I can tackle this?

Kr

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Can you please describe the rules and give examples. We have covered different scenarios and I would like to fully understand.

Is it promotions like if you buy this Product X you get Product Y?

And how many do they have of these rules?

Thanks, Nicolai

 
Davy Capiau
Reply

Hi Nicolai,

We have these type of cases

  • Buy X get Y for free
    • Get 1 time Y
    • Get multiple times Y
  • Buy X get X for free
    • Get 1 time X
    • Get multiple times X

There are a lot of rules for a lot of products

 

 
Davy Capiau
Reply

Hi Nicolai,

Any feedback?

Kind regards

 
Lars Bo Wassini Dynamicweb Employee
Lars Bo Wassini
Reply

Hi Davy

Have you tried to look into another option: Import the rules into a custom table and create a Discount Extender that works on that table? This way you will have full control over how your data is structured.

Please notice that when creating your own ID for the DISCOUNTID in the standard table, the ID must be in the range 0 to 2^31-1 because of some internal handling.

 

You must be logged in to post in the forum