wp-calypso icon indicating copy to clipboard operation
wp-calypso copied to clipboard

A4A: Replace Marketpalce 'Add to cart' to 'Add to referral' button when in referral mode.

Open jkguidaven opened this issue 1 year ago • 4 comments

During referral mode, the CTA button on the product card should display 'Add to referral' instead of 'Add to cart'. This PR fixes this.

Regular Referral mode
Screenshot 2024-05-24 at 6 30 06 PM Screenshot 2024-05-24 at 6 29 55 PM

Depends on https://github.com/Automattic/wp-calypso/pull/91090 Closes https://github.com/Automattic/automattic-for-agencies-dev/issues/527

Proposed Changes

  • Add new 'asReferral' property to both the Multi-product and product card, and use the property to determine the CTA label the card will render.

Testing Instructions

  • Use the A4A live link below and go to /marketplace/products
  • Toggle 'Referral mode' at the top right corner.
  • Confirm that the product cards display the 'Add to referral' text on the CTA button.

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

jkguidaven avatar May 24 '24 10:05 jkguidaven

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

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

  • wpcom-block-editor

To test WordPress.com changes, run install-plugin.sh $pluginSlug updata/a4a/add-to-cart-button-when-in-referral-mode on your sandbox.

matticbot avatar May 24 '24 10:05 matticbot

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

Sections (~63 bytes added 📈 [gzipped])

name                          parsed_size           gzip_size
a8c-for-agencies-marketplace       +226 B  (+0.0%)      +63 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.

matticbot avatar May 24 '24 10:05 matticbot

Depends on https://github.com/Automattic/wp-calypso/pull/91090

✅ Approved

cleacos avatar May 24 '24 12:05 cleacos