Automattic / newspack-blocks

Gutenberg blocks for the Newspack project.
207 stars 43 forks source link

fix(modal-checkout): correctly generate tiered donation price summaries #1950

Closed chickenn00dle closed 1 week ago

chickenn00dle commented 1 week ago

All Submissions:

Changes proposed in this Pull Request:

Closes https://app.asana.com/0/1207817176293825/1208733956648866/1208751945335388/f

This PR fixes an issue where the logic for tiered donation price summary generation was never being run since it relied on no frequency input in the donation form for this layout.

We fix this by explicitly checking for a donation tier index value in the form data and if present running that logic first.

How to test the changes in this Pull Request:

  1. As a logged out reader, with forced registration enabled select any donation value to trigger the auth modal with a price summary at the top.
  2. Confirm the price summary is correct
  3. Repeat the above steps for all three donation layout types (tiered, untiered, frequency) and for multiple frequencies and values

Other information: