Skip to content

Conversation

@yashwin
Copy link
Contributor

@yashwin yashwin commented Dec 24, 2025

Part of https://linear.app/a8c/issue/A4A-1926/marketplace-show-monthlyearly-pricing-for-hosting-and-products

Resolves https://linear.app/a8c/issue/A4A-1929/products-display-monthlyyearly-pricing-on-cards
Resolves https://linear.app/a8c/issue/A4A-1930/hosting-display-monthlyyearly-pricing-on-cards
Resolves https://linear.app/a8c/issue/A4A-1961/cart-display-monthlyyearly-pricing

Proposed Changes

This PR implements a placeholder for term pricing for Hosting, Products & Cart.

Why are these changes being made?

  • To support term pricing on A4A Marketplace

Testing Instructions

  • Open the A4A live link >
  • Test all the scenarios mentioned below > Verify the prices match production.
  1. Marketplace > Hosting > Standard Agency Hosting > Refer mode on/off
  2. Marketplace > Hosting > Premier Agency Hosting > Refer mode on/off
  3. Marketplace > Products > Refer mode on/off
  • Append the URL with ?flags=a4a-bd-checkout > Test all the scenarios mentioned below > Verify the UI looks as displayed below with a placeholder for yearly and monthly billing.

Billing term: Monthly

  1. Marketplace > Hosting > Standard Agency Hosting > Refer mode off
Screenshot 2025-12-24 at 12 21 39 PM
  1. Marketplace > Hosting > Standard Agency Hosting > Refer mode on
Screenshot 2025-12-24 at 12 21 47 PM
  1. Marketplace > Hosting > Premier Agency Hosting > Refer mode on
Screenshot 2025-12-24 at 12 21 59 PM
  1. Marketplace > Hosting > Premier Agency Hosting > Refer mode off
Screenshot 2025-12-24 at 12 22 06 PM
  1. Marketplace > Products > Refer mode off
Screenshot 2025-12-24 at 12 21 27 PM
  1. Marketplace > Products > Refer mode on
Screenshot 2025-12-24 at 12 30 31 PM
  1. Cart > Refer mode off
Screenshot 2025-12-24 at 12 21 14 PM
  1. Cart > Refer mode on
Screenshot 2025-12-24 at 12 21 09 PM

Billing term: Yearly

  1. Marketplace > Hosting > Standard Agency Hosting > Refer mode off
Screenshot 2025-12-24 at 12 17 26 PM
  1. Marketplace > Hosting > Standard Agency Hosting > Refer mode on
Screenshot 2025-12-24 at 12 17 36 PM
  1. Marketplace > Hosting > Premier Agency Hosting > Refer mode off
Screenshot 2025-12-24 at 12 17 52 PM
  1. Marketplace > Hosting > Premier Agency Hosting > Refer mode on
Screenshot 2025-12-24 at 12 35 02 PM
  1. Marketplace > Products > Refer mode off
Screenshot 2025-12-24 at 12 19 25 PM
  1. Marketplace > Products > Refer mode on
Screenshot 2025-12-24 at 12 19 33 PM
  1. Cart > Refer mode off
Screenshot 2025-12-24 at 12 20 19 PM
  1. Cart > Refer mode on
Screenshot 2025-12-24 at 12 20 27 PM

Pre-merge Checklist

  • Has the general commit checklist been followed? (PCYsg-hS-p2)
  • Have you written new tests for your changes?
  • Have you tested the feature in Simple (P9HQHe-k8-p2), Atomic (P9HQHe-jW-p2), and self-hosted Jetpack sites (PCYsg-g6b-p2)?
  • Have you checked for TypeScript, React or other console errors?
  • Have you tested accessibility for your changes? Ensure the feature remains usable with various user agents (e.g., browsers), interfaces (e.g., keyboard navigation), and assistive technologies (e.g., screen readers) (PCYsg-S3g-p2).
  • Have you used memoizing on expensive computations? More info in Memoizing with create-selector and Using memoizing selectors and Our Approach to Data
  • Have we added the "[Status] String Freeze" label as soon as any new strings were ready for translation (p4TIVU-5Jq-p2)?
    • For UI changes, have we tested the change in various languages (for example, ES, PT, FR, or DE)? The length of text and words vary significantly between languages.
  • For changes affecting Jetpack: Have we added the "[Status] Needs Privacy Updates" label if this pull request changes what data or activity we track or use (p4TIVU-aUh-p2)?

@yashwin yashwin requested a review from a team December 24, 2025 07:09
@yashwin yashwin self-assigned this Dec 24, 2025
@matticbot matticbot added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Dec 24, 2025
@matticbot
Copy link
Contributor

matticbot commented Dec 24, 2025

Here is how your PR affects size of JS and CSS bundles shipped to the user's browser:

Sections (~727 bytes added 📈 [gzipped])

Details
name                          parsed_size           gzip_size
a8c-for-agencies-marketplace      +2060 B  (+0.1%)     +520 B  (+0.1%)
a8c-for-agencies-client           +1072 B  (+0.0%)     +207 B  (+0.0%)

Sections contain code specific for a given set of routes. Is downloaded and parsed only when a particular route is navigated to.

Legend

What is parsed and gzip size?

Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory.
Gzip Size: Compressed size of the JS and CSS files. This much data needs to be downloaded over network.

Generated by performance advisor bot at iscalypsofastyet.com.

@jkguidaven
Copy link
Contributor

@yashwin, I tested it, and it works just fine.

My main concern is that we are doing a lot of conditional rendering. Do you think we can just calculate the value (discount and actual cost) within getProductPricingInfo so we have fewer changes on the rendering logic?

const isFree = actualCost === 0;

const renderPrice = () => {
if ( isTermPricingEnabled ) {
Copy link
Contributor

@jkguidaven jkguidaven Jan 7, 2026

Choose a reason for hiding this comment

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

I can see that we are doing conditional rendering with the prices based on the term selected. I wonder if we could just handle the calculation from getProductPricingInfo so we don't have to do conditional rendering here and other places. wdyt?

@yashwin yashwin force-pushed the update/a4a/marketplace/implement-term-pricing-for-products-and-hosting branch from 288500f to 21a9dbb Compare January 8, 2026 08:16
@yashwin
Copy link
Contributor Author

yashwin commented Jan 8, 2026

Thanks for the review, @jkguidaven!

I have made the changes as per your suggestions. Could you please take another look?

@matticbot
Copy link
Contributor

This PR modifies the release build for the following Calypso Apps:

For info about this notification, see here: PCYsg-OT6-p2

  • help-center
  • notifications
  • wpcom-block-editor

To test WordPress.com changes, run install-plugin.sh $pluginSlug update/a4a/marketplace/implement-term-pricing-for-products-and-hosting on your sandbox.

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

Labels

[Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants