Skip to content

A4A: Show Vendor link on the Marketplace. #101646

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

Merged
merged 3 commits into from
Apr 1, 2025

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
Copy link

github-actions bot commented Mar 20, 2025

@matticbot
Copy link
Contributor

matticbot commented Mar 20, 2025

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

Sections (~963 bytes added 📈 [gzipped])

name                               parsed_size           gzip_size
a8c-for-agencies-marketplace           +1974 B  (+0.2%)     +433 B  (+0.2%)
a8c-for-agencies-overview              +1573 B  (+0.1%)     +328 B  (+0.1%)
a8c-for-agencies-client                +1483 B  (+0.1%)     +340 B  (+0.1%)
scan                                    +373 B  (+0.0%)     +142 B  (+0.1%)
jetpack-social                          +373 B  (+0.1%)     +142 B  (+0.1%)
jetpack-search                          +373 B  (+0.1%)     +142 B  (+0.1%)
jetpack-cloud-partner-portal            +373 B  (+0.0%)     +142 B  (+0.0%)
jetpack-cloud-manage-pricing            +373 B  (+0.1%)     +143 B  (+0.1%)
jetpack-cloud-agency-dashboard          +373 B  (+0.0%)     +142 B  (+0.0%)
backup                                  +373 B  (+0.0%)     +142 B  (+0.0%)
a8c-for-agencies-sites                  +373 B  (+0.0%)     +142 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 Author

@jkguidaven jkguidaven Mar 31, 2025

Choose a reason for hiding this comment

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

At first, I had the same thought, but since the title is not something we can share both the Lightbox and Checkout summary due to Typography, we are left with just a translation string. I decided not to create a component for now.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry, I was talking only about the vendor.

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;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@yashwin I decided to keep this as is for now and not transfer it to the useProductDescription hook. Eventually, we'll shift this logic to the backend when we begin supporting over 1000 third-party products. Moreover, I want to reserve the useProductDescription hook solely for the description to align with its name.

Copy link
Contributor

Choose a reason for hiding this comment

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

I saw the useProductDescription is already being used for the feature list. Maybe it should have been named differently. Do you think we can rename this? I'm concerned about the extra things we are adding to solve this which can be easily solved by renaming this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm still unsure about placing this here on the hook. One concern is that we're utilizing the getVendorInfo helper function from a different use case, which could complicate its usage. 🤔

https://github.com/Automattic/wp-calypso/pull/102182/files#diff-2eeceaeabccccc5d6d3ed8318ff986956ba47b806e5bf54b6c2ab42f43f37029R408

@jkguidaven jkguidaven force-pushed the add/a4a/vendor-information-on-marketplace branch from c4e8b17 to 8ffdc1b Compare March 31, 2025 05:58
@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

To test WordPress.com changes, run install-plugin.sh $pluginSlug add/a4a/vendor-information-on-marketplace on your sandbox.

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.

Thanks for addressing my comments.

Since my other comment is a non-blocker, I'm approving the PR.

@jkguidaven jkguidaven force-pushed the add/a4a/vendor-information-on-marketplace branch from 8ffdc1b to 895cfae Compare April 1, 2025 08:28
@jkguidaven jkguidaven merged commit 863e5ea into trunk Apr 1, 2025
13 checks passed
@jkguidaven jkguidaven deleted the add/a4a/vendor-information-on-marketplace branch April 1, 2025 09:15
@github-actions github-actions bot removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Apr 1, 2025
@a8ci18n
Copy link

a8ci18n commented Apr 1, 2025

This Pull Request is now available for translation here: https://translate.wordpress.com/deliverables/17332778

Some locales (Hebrew) have been temporarily machine-translated due to translator availability. All other translations are usually ready within a few days. Untranslated and machine-translated strings will be sent for translation next Monday and are expected to be completed by the following Friday.

Thank you @jkguidaven for including a screenshot in the description! This is really helpful for our translators.

@a8ci18n
Copy link

a8ci18n commented Apr 6, 2025

Translation for this Pull Request has now been finished.

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

Successfully merging this pull request may close these issues.

5 participants