DepositFee: Apply discount only on products (ignore fee amounts in bundled carts)

If your cart includes fee amounts (for example Pfand/deposit fees), normal percentage discounts can accidentally discount the fee part too.
With the new Discount Ignoring Fees feature in DepositFee, your discount is applied only on product value.
What this solves
- Excludes products with
product_type = deposit_feefrom discount base. - Supports Bundle with Product (
bundle_product) where fee is merged into the parent line. - Subtracts embedded fixed bundle fee amount before applying the discount percentage.
Example
Cart:
- Product A:
27.99 - Bundle fee (embedded):
15.00 - Discount:
10%
Old behavior (wrong):
- Discount on
42.99=>4.30
New behavior (correct):
- Discount base:
42.99 - 15.00 = 27.99 - Discount:
10% of 27.99 = 2.80(rounded)
How to use
- Open Shopify Admin > Discounts.
- Create a discount using the DepositFee discount type: Discount Ignoring Fees.
- In settings, choose Applies to:
- All products
- Specific products
- Specific collections
- Set your percentage and save.
How it works:
Depositfee now excludes fee products (deposit_fee) from discount calculations. For bundle-product fee scenarios, it also removes embedded fee amounts from the discount base before applying the percentage. This ensures your discount is applied only to real product value, not fee value.
Notes
New discount type: Discount Ignoring Fees Works with Shopify discount codes and automatic discounts Supports:
- All products
- Specific products
- Specific collections
Works for both discount code and automatic app discount flows using the same function setup.
- Delivery discount target remains unchanged (no shipping discount operation from this feature).
- For percent-based credit card fees, only direct
deposit_feelines are excluded; embedded fixed bundle fees are subtracted from merged lines.