I'm working on a template-level optimization for a category page that displays a price table (piece/dozen/gross) across many length variants of the same product line. Each variant shares the same Volume Pricing price group configuration; the same quantity breakpoints, same percentage discounts (e.g., 12+ = 30% off, 144+ = 60% off), just applied to each variant's own different base price.
To avoid calling the volume item for every single product on the page (very costly at scale.. dozens of products per category), I'd like to call it once per product line, derive the discount percentage, and apply that same percentage to the other variants' own base prices via simple math.
The problem: neither the volume item nor Runtime_VolumePricing_Load_Product_Variant (JSON API) appear to expose the raw configured percentage.. both only return the final, already-rounded computed price at each tier (low, high, price, formatted_price). Reverse-engineering the percentage by dividing that rounded price back by the base price introduces just enough floating-point/rounding noise that it occasionally recovers the wrong whole-percent value, which is obviously a problem for something customer-facing.
Is there any documented way, MVT item, JSON API function, or otherwise, to retrieve the actual configured discount type/percentage for a Volume Pricing price group at the template or runtime level, rather than only the final computed price? Even read-only access to the Price Group's own pricing table (quantity/type/amount, matching what's shown in the admin UI) would solve this.
Any pointers appreciated.. happy to share more detail on the specific use case if helpful.
To avoid calling the volume item for every single product on the page (very costly at scale.. dozens of products per category), I'd like to call it once per product line, derive the discount percentage, and apply that same percentage to the other variants' own base prices via simple math.
The problem: neither the volume item nor Runtime_VolumePricing_Load_Product_Variant (JSON API) appear to expose the raw configured percentage.. both only return the final, already-rounded computed price at each tier (low, high, price, formatted_price). Reverse-engineering the percentage by dividing that rounded price back by the base price introduces just enough floating-point/rounding noise that it occasionally recovers the wrong whole-percent value, which is obviously a problem for something customer-facing.
Is there any documented way, MVT item, JSON API function, or otherwise, to retrieve the actual configured discount type/percentage for a Volume Pricing price group at the template or runtime level, rather than only the final computed price? Even read-only access to the Price Group's own pricing table (quantity/type/amount, matching what's shown in the admin UI) would solve this.
Any pointers appreciated.. happy to share more detail on the specific use case if helpful.
Comment