Developer forum

Forum » Ecommerce - Standard features » Apply discount only once - with Percentage

Apply discount only once - with Percentage

Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply

Hi,

 

I was surprised to see that "Apply discount only once" checkbox on discounts only works with amounts. Is there a reason for this?

 

Most of our customers use percentages and they reported it as a bug. In my mind there is no reason for this to be a restraint to amount, as it could easily be with offered Products as well.

 

This became an issue because this customer using 9.4.17 (we are planning to upgrade to at least 9.5 very soon), used to have the Sales Discount with a custom discount called "Buy X Get Y", and we're trying to move him away from that, and this is currently the once constraint. Is this an easy change that can be done?

 

Best Regards,

Nuno Aguiar


Replies

 
Nicolai Pedersen
Reply

Hi Nuno

The "Apply discount only once" checkbox is related to quantity related discounts only. If you have an orderline of qty 12 x $100 you get 1x10%.

You want the quantifyer to be 3 and if I add 3, I get maybe 33% percent discount. But if I buy 4, I only get 25% (one product?) (That is, by the way, illegal in Denmark :-))

Please explain how it should work for percentages and we might be able to look into it...

BR Nicolai

 
Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply

Hi Nicolai,

 

I see the confusion, but that's now how we are interpreting it. The scenario is this:

 

  • Buy 3 Get 1 Free
  • Set quantifyer to 3 and offer
    • Cheapest at 100%
      OR
    • 33%

 

This works so far, but the goal is for a customer to purchase 12 and essentially get 4. The expectation is that by having "Apply discount only once" disabled, we'd essentially get the same discount x 4, as if the user had placed 4 individual orders.

 

In terms of funcionality we can show you the code we developed for BXGY (Sales Discount Provider). Ultimately:

  • We create a list of all of the products elligeble for that discount (1 item per quantity)
  • If condition match, we calculated the discount and removed it from the list
  • We check if the updated list still meets the conditions and if so, continued to do the same until no more conditions are met
    With the example of Buy 3 Get 1, the list may end up with 2 items, with which we don't do nothing

 

Does that make sense? We can provide you with the source code if you care to take a look with a brief description since there's a lot more stuff our does that doesn't necessarilly pertain to this topic.

 

Best Regards,

Nuno Aguiar

 
Nicolai Pedersen
Reply

Hi Nuno

Thank you for the explanation. Can you please describe the problem - then we will figure out the solution - there might be other scenarios that we need to take into consideration.

So if I buy 12, then what? What could be my discounts? Like this??

Product 1: 12 x $100 = $1200
Buy 3 get 1: 4 x $100 = $300

And/or like this?

Product 1: 12 x $100 = $1200
Buy 3 get 1 - but only once: 1 x $100 = $100

Thanks, Nicolai

 
Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply

Hi Nicolai,

 

>> Can you please describe the problem - then we will figure out the solution

Fair enough.

 

What you describe is the accurate solution (for us). Both scenarios are accurate based on the checkbox "Apply discount only once"

Product 1: 12 x $100 = $1200
Buy 3 get 1: 4 x $100 = $300

________________

Product 1: 12 x $100 = $1200
Buy 3 get 1 - but only once: 1 x $100 = $100

 

Assuming that's all accurate the checkbox could even be a number field so it could be a "limit of repetitions", so we could say "Apply Discount up to X times"

 

Does that make sense?

 

Best Regards,

Nuno Aguiar

 
Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply

Hi Nicolai,

 

An additional scenario just to be clear, using the same examples as above as well

Product 1: 12 x $100 = $1200
Buy 3 get 1: 4 x $100 = $300

________________

Product 1: 15 x $100 = $1500
Buy 3 get 1: 4 x $100 = $300

________________

Product 1: 12 x $100 = $1200
Buy 3 get 1 - but only once: 1 x $100 = $100

 

Hope that makes sense.

Nuno

 
Nicolai Pedersen
Reply

Hi Nuno

First, lets fix my initial error:

Product 1: 12 x $100 = $1200
Buy 3 get 1: 4 x $100 = $400

________________

Product 1: 15 x $100 = $1500
Buy 3 get 1: 4 x $100 = $400
(Could you explain why I do not get the 5th discount? - because I limited it to only get it 4 times?)

________________

Product 1: 12 x $100 = $1200
Buy 3 get 1 - but only once: 1 x $100 = $100

 
Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply

Hi Nicolai,

 

Sorry, a typo from me resulted in a bad example (because then I calculated without having considered it).

I wanted to say 14, so a MOD division would be different than 0.

 

But if you could limit it to 4 times, then yes, you would not get the 5th discount.

 

Best Regards,

Nuno Aguiar

 
Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply

Hi Nicolai,

 

Is this a doable feature? And if so, for when could we expect it?

 

We are working with a customer to move away from the old Sales Discounts and this is the last item since we had a custom discount provider that the customer uses intensively. Order Discounts can mimic everything we did, except this "Apply X times" with a percentage calculation.

 

Best Regards,

Nuno Aguiar

 
Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply

Hi Nicolai,

 

Any news on this? I just need something to set expectations and/or a TFS number so we can more easilly track it.

 

Best Regards,

Nuno Aguiar

 
Nicolai Pedersen
 
Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply

Hi Nicolai,

 

Ok, we'll see to it. Thanks

 

Nuno Aguiar

 

You must be logged in to post in the forum