Discount settings / rabatt einstellungen

Dear Community,

we are working on a CE 4.2.0_23610 webshop, and have setup a discount from 250 pcs
The discount settings are
ITEMS: 250-499pcs
Price: 0
discount 2%

See attached picture

When we have 2 products, one with 200pcs and other with 50pcs the cart calculates a discount as the 250pcs barrier has been reached.

How can we change the config that the discount is calculated by product (alone and not in combination)

kind regards
Tibor

Hello Tibor,

you can assign products and/or categories to the discounts. Just define a hidden category that is only used for this purpose :wink:

Regards

Hi Marco,

thanks, we already assigned the products into categories and the categories are assigned to the discounts.

The issue is that the discount is applied to a total nr of items of all products together and not per each product separately

200x prod. A
50x prod. B
should not be eligible for discount when customer orders 250items (as each product has < 250)

Is there any way to solve this?

Hi,

unfortunately, it looks like a bug:
https://bugs.oxid-esales.com/view.php?id=1981

Regards

Hi Marco,

our customer can not release the shop to into public usage until this issue is fixed, is there any workaround or bugfix available? or when?

Im wondering how others are coping with this issue as it appears also in all shops between 4.2 to 4.4 CE?

regards
Tibor

Hello Tibor,

the case seems to be very special. Probably that’s why it didn’t come up before. Unfortunately, I don’t have an idea for a workaround. Even if you wrote a module to fix it - the basket calculation is very complex… Will leave a comment in the bug entry and request the code for the solution.

Thanks for your patience!

Hello Tibor,

we tried really hard but couldn’t reproduce this as a bug.
product A = 198 pcs to cart (discount on product A’s category)
product B = 50 pcs to cart (no discount on product B’s category)
Summ: No discount is valid nor calculated.

As soon as you rise product A’s quantity to 200, the discount is calculated for product A only.

There is probably a pretty simple explanation for the behaviour. Can you please check, if your product in the basket is assigned to more than one category? Maybe the other category is assigned to a discount as well?

Regards

Hi Marco,

thanks for the feedback,

Project website is: http://www.werbemittellieferant.ch

Discounts:
>50pcs no discount
>100pcs ca 0.8% disc (all categories)
>250pcs ca. 2%
>500pcs ca. 3%

We have categories and subcategories
L1: USB Drive

  • L2: Pro

Each product is only inside one category (which might have a parent category)
The discount is applied to ALL categories (and subcategories). We tried to remove the parent category from discount but it doesnt change the issue.

Issue 1. Discount is now only applied when user is logged in (but it shall work even without login)
Issue 2. When ordering 2 products (each 50pcs) it applies discount of 100pcs (but should not as each has only 50)
Issue 3. When ordering 2 products (a. 50pcs, b. 100) it applies discount of 100pcs to both, but it should apply discount of 1x50 (0%) and 1x100 (0.8%)

regards
Tibor

Hi Tibor,

Issue 1: depends on the user group assignment. Did you try de-assign all user groups?

Issue 2 + 3: Gotcha now.
What you want is different from what the shop does by default :slight_smile:

  • assign to discount products A and B, discount 10% when > 100
  • you expect that if user puts 110 of A and 50 of B to cart where discount is applied only for A
  • if A=90 and B=90, no discounts
  • if A = 110 and B = 110, both get discount
  • currently, the shop calculates: if (A + B) > 100, discount is applied

I tried to generate a new feature request about this.

Hope to support you with a workaround (which class/method to override) for a workaround.

Regards

Alright, here we go. The appropriate method to override is oxDiscountList::applyBasketDiscounts(). Please have a look at the other methods in this class as well.

Regards

Hi Marco,

thanks for your input. We did overwrite the getBasketItemDiscounts() function to send the exact amount separately for each product to its subfunction. Then it was working.

There is however one part which is not clear how to handle.

When shopping as non-login user, the discount doesnt show on the shopping cart page 1, but later when i register the new user in the shopping cart process, the page 4 shows the correct discount.

is there any way/setting to show always the discount no matter if user is registered or not?
Or do we have to hack the code here also?

The function getBasketItemDiscounts( $oArticle, $oBasket, $oUser = null ) suggest that user is optional, if we set the user to NULL it still doesnt work due to dependencies further down inside sub functions.

regards
Tibor

Hello Tibor,

if you assigned your discounts to special user groups, discounts will only be displayed when the user identifies with logging in and his user group is “present”. If the discount shall work for all users - logged in and not logged in - simple de-assign all users/user groups from the discount.

Regards