Okay
  Public Ticket #4510011
Tiered discount should calculate on combined quantity of a product group (not per individual product)
Open

Comments

  •  2
    Vladislav started the conversation

    Hello B2BKing team,

    I’m trying to configure tiered pricing so that the discount is applied based on the combined quantity of all items in a product group/category, not per individual product.

    Goal (expected behavior):
    If a customer buys multiple different products from the same group (e.g., Group A), the total quantity across that group should count toward the tier.
    Example tiers:

    • 3+ units (any mix from Group A) → 5% off all Group A items in the cart

    • 6+ units (any mix from Group A) → 10% off all Group A items in the cart

    Current behavior (issue):
    Tiered discount is calculated per product. So if Group A has 30 products, the rule only triggers when the quantity of a single product reaches the tier, instead of using the sum of quantities of all products in Group A within the cart.

    How I configured it:

    • Rule Type: Tiered Price (Price by Quantity)

    • Applies to: Product Group / Category (not a single product)

    • Applies to who: Specific B2B group (hairdressers) and/or All users

    • Tiers: e.g., 3→5%, 6→10%, 12→15%

    • I need the rule to sum quantities across the selected group/category in the cart.

    What I need:

    1. Either a built-in option (e.g., “Calculate tiers based on combined quantity of selected group/category in cart”), or

    2. A code snippet / filter / hook I can add to make tier thresholds evaluate against the aggregated quantity of all items in the chosen group/category.

    Illustrative example:
    Cart has:

    • Product A (Group A): qty 1

    • Product B (Group A): qty 2
      Total for Group A = 3 → Should trigger the 3+ tier and apply 5% to both A and B.
      Currently, discount does not trigger unless a single product reaches qty 3.

    If you can provide a code snippet or point me to the correct setting to make tiered rules aggregate quantities by group/category across the cart, that would be perfect. Thank you!

  •  2
    Vladislav replied

    We need Tiered Price (Price by Quantity) rules to calculate tiers based on the combined cart quantity of items inside the selected product group/category, and then apply the discount to all items from that selected group—not per individual product.

    Target group (what we want the rule to apply to)
    • Product group/category: e.g., “I.C.O.N. Ecotech” (category ID 151)
      (This is just an example. We want this to work for any category or product group we select in the rule.)

    • Applies to who: our B2B customer group “Hairdressers” (and optionally All users for testing).

    Expected behavior

    If a customer buys different products from the selected group/category, the sum of quantities across that group should determine the tier, and the discount should apply to all items from that group in the cart.

    Example tiers:

    • 3+ (any mix from the selected group) → 5% off all those items

    • 6+ (any mix) → 10% off

    • 12+ (any mix) → 15% off

    Illustration:
    Cart = Product A (Group) qty 1 + Product B (Group) qty 2 → total 3 in the selected group → should trigger 3+ tier and apply 5% to both A and B.

    Current behavior (issue)

    Tiers evaluate per product, so the rule only triggers when a single product reaches the threshold, instead of using the aggregate quantity of all items in the selected group/category.

    Our configuration
    • Dynamic Rules → Rule Type: Tiered Price (Price by Quantity)

    • Applies to: Product Category / Product Group (not single product)

    • Applies to who: Hairdressers (B2B group) and/or All users

    • Tiers: e.g., 3→5%, 6→10%, 12→15%

    What we need
    • A built-in option (e.g., “Calculate tiers based on combined quantity of the selected group/category in cart”), or

    • An official code snippet / filter / hook to aggregate quantities by the rule’s selected scope (category or product group, including child categories) and apply the resulting tier to all matching items in the cart.

    What we tried (for your reference)

    We enabled cart-wide tier calculation and tested a custom filter to sum quantities in one category (ID 151) including its children. It worked earlier for a single category, but after further adjustments it stopped applying in cart. We would prefer an official, supported approach that works whenever we choose any category/product group in the rule.

    Questions
    1. Is there a built-in way for Tiered Price rules to aggregate by the selected group/category across the cart (not per product)?

    2. If not, could you share an official snippet that sums quantities by the rule’s scope (selected category/group), including children, and applies the tier to all items in that scope?

    3. Do all items need to share the exact same rule for aggregation to work, or can multiple Tiered rules target the same scope and still aggregate?

    4. Any known limitations, hook order, or caching considerations we should follow?

    Access for faster troubleshooting

    We can provide temporary WP admin/staging access if helpful. Please let us know the safest way to share credentials.

    Thanks a lot for your guidance!

  •   Vladislav replied privately