Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A4A: Show Vendor link on the Marketplace. #101646

Open
wants to merge 3 commits into
base: trunk
Choose a base branch
from

Conversation

jkguidaven
Copy link
Contributor

As we now support third-party products in the A4A marketplace, it's essential to clearly identify the vendor of each product for users. This PR updates the marketplace to display the Vendor link in the UI.

Screenshot 2025-03-20 at 3 40 10 PM Screenshot 2025-03-20 at 3 48 58 PM

Closes https://github.com/Automattic/automattic-for-agencies-dev/issues/1936

Proposed Changes

  • Enhance the Lightbox component by adding support for the new Vendor property. This addition allows us to display a link next to the Product title.
  • In the A4A context, we now provide the vendor information. A new helper function has been created to calculate the vendor details.

Why are these changes being made?

  • This is part of the Woo 3rd-party extension phase 2 project.

Testing Instructions

  • Use the A4A live link to navigate to /marketplace/products.
  • Confirm that the Vendor link is visible while viewing product information. Refer to the screenshot above for an example.
  • Proceed to checkout items.
  • Verify that the Vendor link is also visible in the checkout summary. Refer to the screenshot above.

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

@jkguidaven jkguidaven requested review from jeffgolenski, madebynoam and a team March 20, 2025 07:57
@jkguidaven jkguidaven self-assigned this Mar 20, 2025
@matticbot matticbot added [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Mar 20, 2025
@jkguidaven jkguidaven marked this pull request as ready for review March 20, 2025 07:57
@matticbot
Copy link
Contributor

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

Sections (~1004 bytes added 📈 [gzipped])

name                               parsed_size           gzip_size
a8c-for-agencies-marketplace           +1974 B  (+0.2%)     +430 B  (+0.1%)
a8c-for-agencies-overview              +1573 B  (+0.1%)     +323 B  (+0.1%)
a8c-for-agencies-client                +1496 B  (+0.1%)     +341 B  (+0.1%)
scan                                    +373 B  (+0.0%)     +143 B  (+0.1%)
jetpack-social                          +373 B  (+0.1%)     +143 B  (+0.1%)
jetpack-search                          +373 B  (+0.1%)     +143 B  (+0.1%)
jetpack-cloud-partner-portal            +373 B  (+0.0%)     +187 B  (+0.1%)
jetpack-cloud-manage-pricing            +373 B  (+0.1%)     +142 B  (+0.1%)
jetpack-cloud-agency-dashboard          +373 B  (+0.0%)     +187 B  (+0.1%)
backup                                  +373 B  (+0.0%)     +143 B  (+0.0%)
a8c-for-agencies-sites                  +373 B  (+0.0%)     +143 B  (+0.0%)
plans                                   +355 B  (+0.0%)     +132 B  (+0.0%)
jetpack-connect                         +355 B  (+0.0%)     +132 B  (+0.0%)
jetpack-cloud-pricing                   +355 B  (+0.0%)     +132 B  (+0.1%)
jetpack-cloud-features-comparison       +355 B  (+0.1%)     +132 B  (+0.1%)

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.

Copy link
Contributor

@yashwin yashwin left a comment

Choose a reason for hiding this comment

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

I haven't tested this yet.

But, I have left a few comments. Let me know what you think.

Comment on lines +125 to +145
{ vendor &&
translate( 'By {{a/}}', {
components: {
a: (
<a
href={ vendor.vendorUrl }
target="_blank"
rel="noopener noreferrer"
onClick={ () => {
dispatch(
recordTracksEvent( 'calypso_marketplace_products_overview_vendor_click', {
vendor: vendor.vendorName,
} )
);
} }
>
{ vendor.vendorName }
</a>
),
},
} ) }
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can create a common component and reuse it wherever required, as it is being used in 2 places

<ProductVendorInfo /> or something similar

Copy link
Contributor

Choose a reason for hiding this comment

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

How about we keep this info in useProductDescription as we are already using it show the description?

Something like:

const VENDOR_INFO_MAP: Record< string, VendorInfo > = {
	kestrel: {
		vendorName: 'Kestrel',
		vendorUrl: 'https://woocommerce.com/vendor/kestrel/',
	},
	'element-stark': {
		vendorName: 'Element Stark',
		vendorUrl: 'https://woocommerce.com/vendor/element-stark/',
	},
	storeapps: {
		vendorName: 'StoreApps',
		vendorUrl: 'https://woocommerce.com/vendor/storeapps/',
	},
	woocommerce: {
		vendorName: 'Woo',
		vendorUrl: 'https://woocommerce.com/',
	},
	jetpack: {
		vendorName: 'Jetpack',
		vendorUrl: 'https://jetpack.com/',
	},
	pressable: {
		vendorName: 'Pressable',
		vendorUrl: 'https://pressable.com/',
	},
	wpcom: {
		vendorName: 'WordPress.com',
		vendorUrl: 'https://wordpress.com/',
	},
};
case 'woocommerce-constellation':
  description = translate(
	  'A flexible, WooCommerce memberships platform to support publishers, purchasing clubs, online learning, associations, and more.'
  );
  vendor = VENDOR_INFO_MAP.kestrel;
break;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A8c Agencies [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