Quantity Discounts – filter hook I can use in my plugin?

This topic has 6 replies, 3 voices, and was last updated 5 days, 4 hours ago ago by Tony Rodriguez

  • Avatar: st7878
    st7878
    Participant
    March 30, 2026 at 09:12

    Hello,

    I am developing a custom WooCommerce plugin and I need some technical information about how the xStore built-in Quantity Discounts module applies discounts internally.

    Specifically, I need to know:

    1. Which WordPress/WooCommerce filter or action hook does xStore use to apply the quantity discount to the cart item price? For example, does it use woocommerce_before_calculate_totals, woocommerce_product_get_price, or something custom?

    2. At what hook priority does xStore run this discount logic?

    3. Does xStore write the discounted price directly into the cart_contents array (e.g. line_total, line_subtotal, or cart_item[‘data’]->price), or does it use a different mechanism?

    4. Is there an official way to exclude a specific product from xStore quantity discounts — for example, a product meta key, a CSS class, or a filter hook I can use in my plugin?

    Context: I have certain “deposit” products in the cart (hidden simple products, VAT exempt) whose price must never be discounted under any circumstances. I need to exclude them from xStore’s quantity discount calculation at the source, not just override the displayed price afterward.

    Thank you very much!

    Files is visible for topic creator and
    support staff only.
    5 Answers
    Avatar: Ayan Rahman
    Ayan Rahman
    Support staff
    March 30, 2026 at 09:25

    Hi there!

    Thanks for using XStore.

    We’ve reviewed your request and it requires custom development, which is outside Envato’s support policy. To get it done properly and on time, please submit it to our trusted partner WP Kraken:

    You’ll get:

    – fast quote & timeline
    – turnkey implementation by a vetted team
    – warranty on delivered work

    We’re confident this will help-hope you can make use of it shortly.

    Content is visible for topic creator and
    support staff only.
    Avatar: st7878
    st7878
    Participant
    March 30, 2026 at 09:43

    Hello,

    Thank you for your response, but I think there may be a misunderstanding.

    I am not asking you to develop anything. I am a developer myself and I am already building the custom plugin on my side.

    What I need is purely technical documentation about your theme’s internal code — specifically, which hooks and at what priority the xStore Quantity Discounts module uses to apply discounts to cart items.

    This is a simple technical question about your own code, similar to asking: “which WordPress filter does this feature use?”

    Could you please just point me to:
    – the relevant PHP file inside the xStore theme that handles quantity discount calculation, OR
    – the name of the filter/action hook xStore uses to apply the discount price, OR
    – whether there is a hook or meta key to exclude a specific product from the quantity discount logic

    I just need to know how your code works so I don’t conflict with it. No development from your side is needed.

    Thank you!

    Avatar: st7878
    st7878
    Participant
    March 30, 2026 at 11:29

    Thanks, no need to reply anymore. I found all the answers in the file /wp-content/themes/xstore/framework/features/woocommerce/quantity-discounts.php

    Avatar: st7878
    st7878
    Participant
    March 30, 2026 at 11:29

    Thanks for the support! My topic “Quantity Discounts – filter hook I can use in my plugin?” has been successfully resolved.

    Avatar: Tony Rodriguez
    Tony Rodriguez
    Support staff
    March 30, 2026 at 11:29

    Dear st7878,

    It’s great having you in our WordPress & WooCommerce community!

    Every insight you share helps us refine XStore and build tools that empower thousands of online store owners worldwide.

    Together, we grow stronger with every release.

    Topic closed.
    The 8Theme Team

  • Viewing 6 results - 1 through 6 (of 6 total)

The issue related to '‘Quantity Discounts – filter hook I can use in my plugin?’' has been successfully resolved, and the topic is now closed for further responses

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.