Product page: list prices and actual prices#3346
Conversation
OpenAPI ChangesNo changes detected Unexpected changes? Ensure your branch is up-to-date with |
There was a problem hiding this comment.
Pull request overview
Adds a new program pricing display intended to show the current program price alongside a “list price” and computed savings, aligning with the requested “Program Savings Price” UI update.
Changes:
- Introduces new styled components to render an enhanced paid-program “Price” section (including savings + list price display).
- Updates
ProgramPriceRowto compute/display savings fromlist_pricevs current product price. - Adds a local
toNumericPricehelper for handlingnumber | stringprice inputs.
| <GrayText>(includes {program.certificate_type})</GrayText> | ||
| </> | ||
| ) : null | ||
| // if (enrollmentType === "none") return null |
| const currentAmount = toNumericPrice(currentPrice) | ||
| const listAmount = toNumericPrice(listPrice) | ||
| const hasSavings = | ||
| currentAmount !== null && listAmount !== null && listAmount > currentAmount | ||
| const savingsAmount = hasSavings ? listAmount - currentAmount : null | ||
|
|
||
| const paidSection = | ||
| enrollmentType === "paid" && currentPrice ? ( | ||
| <ProgramPaySection> | ||
| <ProgramPayLabel>Price</ProgramPayLabel> | ||
| <ProgramPayContent> | ||
| <ProgramPriceLine> | ||
| <ProgramPriceAmount> | ||
| {formatPrice(currentPrice, { avoidCents: true })} | ||
| </ProgramPriceAmount> | ||
| <ProgramPriceSuffix>/ full program</ProgramPriceSuffix> | ||
| </ProgramPriceLine> | ||
| {hasSavings && savingsAmount !== null && listAmount !== null ? ( | ||
| <ProgramDiscountBlock> | ||
| <ProgramSavingsText> | ||
| Save {formatPrice(savingsAmount, { avoidCents: true })} | ||
| </ProgramSavingsText> | ||
| <ProgramListPriceText> | ||
| {formatPrice(listAmount, { avoidCents: true })} total for | ||
| courses purchased separately | ||
| </ProgramListPriceText> | ||
| </ProgramDiscountBlock> | ||
| ) : null} |
| <ProgramListPriceText> | ||
| {formatPrice(listAmount, { avoidCents: true })} total for | ||
| courses purchased separately |
3513bd3 to
68a1860
Compare
180883d to
cfa88c4
Compare
|
This looks great! thank you, design is approved. |
| ...theme.typography.body4, | ||
| fontSize: "12px", | ||
| lineHeight: "16px", | ||
| fontWeight: theme.typography.fontWeightMedium, |
There was a problem hiding this comment.
This should just be theme.typography.subtitle3, I think
We should only need custom typography very rarely. (I don't see the letterspacing thing in figma, but i may have missed it.)
| fontSize: "14px", | ||
| lineHeight: "18px", | ||
| fontWeight: theme.typography.fontWeightRegular, |
There was a problem hiding this comment.
These 3 overrides are unnecessary. 14/18/regular is normal body2.
| fontStyle: "normal", | ||
| fontSize: "14px", | ||
| lineHeight: "18px", |
| ...theme.typography.body4, | ||
| fontSize: "12px", | ||
| lineHeight: "16px", | ||
| fontWeight: theme.typography.fontWeightMedium, |
There was a problem hiding this comment.
This should just be theme.typography.subtitle3, I think
We should only need custom typography very rarely. (I don't see the letterspacing thing in figma, but i may have missed it.)


What are the relevant tickets?
Fix https://github.com/mitodl/hq/issues/11119
Description (What does it do?)
Adds a new Price section with shows List and current price and the amount saved.
Screenshots (if appropriate):
If Audit is available, and FinAid:

Both, no FinAid:

Only Paid:

How can this be tested?