Codeinwp / Codeinwp/woocommerce-product-addon
Add option to multiply Fixed Fees by product quantity
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 15
- Forks
- 9
- Avg merge
- 3d 17h
- Merged PRs (30d)
- 16
Description
Impact: 60 · Confidence: 95 · Complexity: 40
Description
Problem
PPOM add-ons that modify the product price automatically inherit the tax class of the base product. To offer a non-taxable add-on on a taxable product, users rely on the "Fixed Fee" option, as it is added as a separate cart fee. However, Fixed Fees are flat rates that apply only once per cart item, ignoring the product quantity. If a customer selects a quantity of 2, the fixed fee is only charged once.
Desired Behavior
Provide a setting that allows a "Fixed Fee" to scale proportionally with the product quantity in the cart.
Acceptance Criteria
- Add a toggle/checkbox to the Fixed Fee settings (e.g., "Multiply fee by product quantity").
- When enabled, the cart fee line item should calculate dynamically as
Fixed Fee Amount * Product Cart Quantity. - The calculated fee should correctly update if the user changes the item quantity on the cart page.
Customer Context
The customer needs to add a non-taxable service fee per item purchased, alongside a taxable main product. They are using the "Fixed Fee" add-on option to prevent the fee from being taxed, but this workaround fails when customers order multiple quantities because the fixed fee doesn't multiply by the product quantity.
Root Cause Analysis
The customer's underlying need is to apply a per-item non-taxable surcharge to a taxable product. Because standard PPOM add-on prices inherent the base product's tax status, the customer attempted a workaround using the "Fixed Fee" feature, which correctly bypasses standard taxes by adding a separate cart fee. The limitation is that Fixed Fees are intrinsically flat and don't multiply by cart item quantity. The product gap here is the lack of either item-level tax overrides for add-ons or an option to map fixed fees proportionally to product quantity.
Reasoning
The customer is using the 'Fixed Fee' functionality as a workaround to add a non-taxable service to a taxable product, because fixed fees are added as separate line items and don't inherit the product's tax class. However, fixed fees apply a flat rate to the cart and do not scale when the product quantity increases. There is no existing setting to multiply fixed fees by the product quantity, and no open issue matches this request. Providing an option to scale fixed fees by product quantity would solve this use case.
Source: HelpScout #3305408476
Generated by feature-request-triage workflow (ID: feature-request-triage_69f103c96233b4.30842870)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Locate the Fixed Fee settings and the cart-fee calculation entry points, then trace how product quantity reaches the fee calculation. Add the requested setting and verify that the fee equals the fixed amount times quantity, including after quantity changes on the cart page.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100