Discountrules foreach 2. product in cart

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
6 years ago
Hi Nopcommerce Forum.

I am trying to develop a discount rule, so when a customer wants to buy 2 different for 20 total. But each product cost 12 euro. This has I solved if the user only buys 2 products. But the discount can't I get work on every 2 products added to the cart, where the customer can get the discount on, only the first 2 products.

Can I somehow do so it triggers for each product and see what index and product it is?

OR

If I have the discount rule set to total price it can return how many time the discount should be added or how much the discount should be on?

OR

Do someone have another solution to accomplish this?

Best regard.
Andreas D. Pedersen
6 years ago
Hello Andreas,

We can do whatever we want with discount rules and certainly I can help you with that but to help you, first we need to understand what you want to accomplish.

If you want to apply discount on only some products in cart based on some logic - That is possible
If you want to apply discount based on price of few products in cart - That is possible

Or whatever logic you have. You can also contact me on my skype id which you will find on following URL.. https://www.nopcommerce.com/Profile.aspx?UserId=68411

Thank you,
Atul
6 years ago
Thanks for your response.

Senior: I have Product X and Product Y in my basket.
Normal price for both products is 15 USD, but if I have both products or just one of them 2 times. Then there should be added a discount on 5 USD so the full price is 25 USD.

But is I have maybe 3 of Y and 1 of X, how can I then add the discount 2 times?

Can you maybe come with a little example or guide how you would solve this situation with a DiscountRule? :)

Thanks.
6 years ago
Aircode wrote:
Thanks for your response.

Senior: I have Product X and Product Y in my basket.
Normal price for both products is 15 USD, but if I have both products or just one of them 2 times. Then there should be added a discount on 5 USD so the full price is 25 USD.

But is I have maybe 3 of Y and 1 of X, how can I then add the discount 2 times?

Can you maybe come with a little example or guide how you would solve this situation with a DiscountRule? :)

Thanks.


Hello,

You can start looking at these two discount rule plugins for your reference..

https://www.nopcommerce.com/p/2980/has-one-product-discount-requirement-rule-nopcommerce-team.aspx

https://www.nopcommerce.com/p/2704/has-all-products-discount-requirement-rule-nopcommerce-team.aspx

If you need some ideas on logic, I can explain that further but I believe that above mentioned discount rules will help you for sure.

Thank you,
Atul
6 years ago
Hi again.

Thanks a lot for your help so far.

I have looked into the plugins you have linked and some other from NopCommerce.

But I can get it to work with 2 products but, then I add the third product I get some problems. But if I fix this problem. I don't get my discount on the fourth product... Otherwise, I get discount on all products after the second one.

- Should I add the discount rule, on product level or total order?
- Is it possible to return the discount in the order? So if the user has 4 products, they will get the discount x2. But if they only have 3 or 2 product, they will only get discount for the 2 first products?

Am I looking at the flow wrong? Or can you explain me have you would handle this senior?
So the discount will be added each time the criteria is fulfilled.

If you want we can also chat/talk over skype tomorrow if you have some time. :)
6 years ago
-- (posted my message multiple times..)
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.