Codeinwp / Codeinwp/woocommerce-product-addon
Add filter to programmatically disable PPOM price calculation and display logic per product
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: 25
Description
Problem
When PPOM applies its price calculation logic to complex products like WooCommerce Subscriptions (specifically those with sign-up fees and third-party discount rules), its hooks can override the cart's price display incorrectly. For example, it replaces the recurring monthly total with the initial sign-up fee. Developers currently lack a programmatic way to selectively bypass PPOM's price tampering on a per-product basis.
Desired Behavior
Provide a new filter (e.g., ppom_disable_dynamic_price) that accepts the $product_id and/or $cart_item array. If a developer returns true for a given item, PPOM should completely skip its cart price calculation and display modification logic for that specific item, leaving standard WooCommerce pricing intact.
Acceptance Criteria
- A filter is introduced early in PPOM's cart item price calculation and display hooks.
- The filter passes the relevant product ID or cart item data to identify the context.
- When the filter returns true, PPOM skips altering the cart display and calculation for that item.
Customer Context
The customer is using a WooCommerce Subscription product with a sign-up fee, recurring fee, and a discount rule applied to the sign-up cost. In the cart, PPOM's logic overwrites the recurring price display with the sign-up fee. The customer is technically savvy and is explicitly asking for a hook to tell PPOM to bypass its 'Dynamic Price' calculations for specific product IDs.
Root Cause Analysis
PPOM globally applies its dynamic cart price logic to active products, but it struggles to parse and respect the multi-part pricing structure of complex WooCommerce integration scenarios (e.g., Subscriptions with sign-up fees + discount rules). The fundamental gap is the lack of a developer-accessible filter to selectively opt specific products or cart items out of PPOM's calculation routines, preventing technical users from bridging compatibility gaps on their own.
Reasoning
The customer has identified a compatibility issue where PPOM's cart price calculation overrides the display of WooCommerce Subscriptions that feature both sign-up and recurring fees. Since there is currently no hook to conditionally disable PPOM's dynamic price logic on a per-product or per-cart-item basis, a new feature request is warranted to give developers a way to bypass this behavior.
Source: HelpScout #3314074439
Generated by feature-request-triage workflow (ID: feature-request-triage_69fbabe83c1723.32588741)
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
Start by locating PPOM's cart item price calculation and display hooks, then inspect how product IDs or cart item data are available there. Define the filter's context and verify that returning true bypasses both calculation and display changes for the selected item while standard WooCommerce pricing remains unchanged.
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
- 48/100