Skip to content

Product page: list prices and actual prices#3346

Open
annagav wants to merge 7 commits into
mainfrom
ag/add_list_price_to_prgram_page
Open

Product page: list prices and actual prices#3346
annagav wants to merge 7 commits into
mainfrom
ag/add_list_price_to_prgram_page

Conversation

@annagav
Copy link
Copy Markdown
Contributor

@annagav annagav commented May 15, 2026

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:
Screenshot 2026-05-15 at 12 16 29 PM

Both, no FinAid:
Screenshot 2026-05-15 at 12 19 39 PM

Only Paid:
Screenshot 2026-05-15 at 12 21 19 PM

How can this be tested?

Copilot AI review requested due to automatic review settings May 15, 2026 13:23
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 15, 2026

OpenAPI Changes

No changes detected

View full changelog

Unexpected changes? Ensure your branch is up-to-date with main (consider rebasing).

@annagav annagav changed the title Program Savings Price update Product page: list prices and actual prices May 15, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ProgramPriceRow to compute/display savings from list_price vs current product price.
  • Adds a local toNumericPrice helper for handling number | string price inputs.

<GrayText>(includes {program.certificate_type})</GrayText>
</>
) : null
// if (enrollmentType === "none") return null
Comment on lines +891 to +918
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}
Comment on lines +913 to +915
<ProgramListPriceText>
{formatPrice(listAmount, { avoidCents: true })} total for
courses purchased separately
@annagav annagav force-pushed the ag/add_list_price_to_prgram_page branch from 3513bd3 to 68a1860 Compare May 15, 2026 14:22
@annagav annagav added the Needs Review An open Pull Request that is ready for review label May 15, 2026
@annagav
Copy link
Copy Markdown
Contributor Author

annagav commented May 15, 2026

Update:
Screenshot 2026-05-15 at 1 32 01 PM

@annagav annagav force-pushed the ag/add_list_price_to_prgram_page branch from 180883d to cfa88c4 Compare May 15, 2026 17:35
@steven-hatch
Copy link
Copy Markdown

This looks great! thank you, design is approved.

Copilot stopped work on behalf of annagav due to an error May 15, 2026 18:25
...theme.typography.body4,
fontSize: "12px",
lineHeight: "16px",
fontWeight: theme.typography.fontWeightMedium,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.)

Comment on lines +465 to +467
fontSize: "14px",
lineHeight: "18px",
fontWeight: theme.typography.fontWeightRegular,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These 3 overrides are unnecessary. 14/18/regular is normal body2.

Comment on lines +472 to +474
fontStyle: "normal",
fontSize: "14px",
lineHeight: "18px",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should be able to drop font style/size/weight and lien height and use subtitle2 here

Image

...theme.typography.body4,
fontSize: "12px",
lineHeight: "16px",
fontWeight: theme.typography.fontWeightMedium,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs Review An open Pull Request that is ready for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants