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

Add styling to marketplace to identify sponsored products #45684

Merged
merged 18 commits into from Mar 19, 2024

Conversation

Dan-Q
Copy link
Contributor

@Dan-Q Dan-Q commented Mar 18, 2024

Changes proposed in this Pull Request:

Closes WCCOM#19612. Where a product on the Marketplace "Discover" page has the label: 'promoted' from the WooCom API, adds the word "Sponsored" to the product card and shows a colored spot alongside/overlapping it. If it also has a primary_color: ... set, adds a "stripe" of that primary color to the top of the product card.

How to test the changes in this Pull Request:

  1. Check out this branch to your local environment and build the assets, e.g. cd plugins/woocommerce-admin; pnpm watch:build; visit the site in your local server e.g. cd plugins/woocommerce; pnpm -- wp-env start
  2. If you haven't done it in a while, consider clearing your wc_addons_featured transient e.g. cd plugins/woocommerce; pnpm -- wp-env run cli wp transient delete wc_addons_featured; this transient stores featured product data
  3. Visit WooCommerce > Extensions > Discover
  4. If any shown products are marked "promoted" in WooCom, they should appear here in accordance with the Figma design.
  5. If you'd like to test around or if the data you're seeing shows no sponsored products, you can use your React debugger to modify the product associated with each <ProductCard>
  6. Please test around

Screenshot

Markup on 2024-03-18 at 17:34:06

Changelog entry

  • Automatically create a changelog entry from the details below.

Significance

  • Patch
  • Minor
  • Major

Type

  • Fix - Fixes an existing bug
  • Add - Adds functionality
  • Update - Update existing functionality
  • Dev - Development related task
  • Tweak - A minor adjustment to the codebase
  • Performance - Address performance issues
  • Enhancement - Improvement to existing functionality

Message

Made sponsored product listings in the Extensions marketplace easier to identify.

Comment

@Dan-Q Dan-Q requested review from a team, andfinally and corsonr and removed request for a team March 18, 2024 17:37
@Dan-Q Dan-Q self-assigned this Mar 18, 2024
@Dan-Q Dan-Q marked this pull request as ready for review March 18, 2024 17:37
Copy link
Contributor

Hi @andfinally, @corsonr,

Apart from reviewing the code changes, please make sure to review the testing instructions as well.

You can follow this guide to find out what good testing instructions should look like:
https://github.com/woocommerce/woocommerce/wiki/Writing-high-quality-testing-instructions

Copy link
Contributor

github-actions bot commented Mar 18, 2024

Test Results Summary

Commit SHA: 197fafd

Test 🧪Passed ✅Failed 🚨Broken 🚧Skipped ⏭️Unknown ❔Total 📊Duration ⏱️
API Tests25900202610m 38s
E2E Tests336002103577m 40s

To view the full API test report, click here.
To view the full E2E test report, click here.
To view all test reports, visit the WooCommerce Test Reports Dashboard.

@poligilad-auto
Copy link

Hey @Dan-Q, thanks for the ping.

I didn't get a chance to test the branch, but from the screenshot I can see a few things:

  • The spacing between the product title and vendor name is too big vs. how it is now.
  • Can you check that the top stripe is 5px? It currently looks a bit higher.
  • This is probably not related and maybe a DEV environment bug, but I see the "Didn't find the theme you like? ..." sentence repeated twice and it should only be shown at the end of all the Themes in Extensions > Themes and not shown at all in Discover.

corsonr

This comment was marked as resolved.

@corsonr
Copy link
Member

corsonr commented Mar 19, 2024

One last thing, I'm not getting the sponsored card to show even when manipulating the props via the label prop set to promoted and by setting a background color.

Dan-Q and others added 2 commits March 19, 2024 09:46
…t-card/product-card.tsx

Co-authored-by: Remi Corson <remicorson@gmail.com>
…t-card/product-card.tsx

Co-authored-by: Remi Corson <remicorson@gmail.com>
@github-actions github-actions bot added the plugin: woocommerce Issues related to the WooCommerce Core plugin. label Mar 19, 2024
@Dan-Q
Copy link
Contributor Author

Dan-Q commented Mar 19, 2024

I didn't get a chance to test the branch, but from the screenshot I can see a few things:

It's funny: you stare at something long enough, you stop seeing the problems!

Fixed in 3b61fcc.

  • Can you check that the top stripe is 5px? It currently looks a bit higher.

Fixed in 3121d30.

  • This is probably not related and maybe a DEV environment bug, but I see the "Didn't find the theme you like? ..." sentence repeated twice and it should only be shown at the end of all the Themes in Extensions > Themes and not shown at all in Discover.

Huh; I see that too, but I don't think it's new to this PR... investigating.

@Dan-Q Dan-Q requested a review from corsonr March 19, 2024 11:30
@Dan-Q
Copy link
Contributor Author

Dan-Q commented Mar 19, 2024

Huh; I see that too, but I don't think it's new to this PR... investigating.

This is a regression introduced a week ago; @nefeline is handling.

@Dan-Q
Copy link
Contributor Author

Dan-Q commented Mar 19, 2024

Revised version screenshot:

Markup on 2024-03-19 at 11:35:55

@Dan-Q
Copy link
Contributor Author

Dan-Q commented Mar 19, 2024

One last thing, I'm not getting the sponsored card to show even when manipulating the props via the label prop set to promoted and by setting a background color.

Here's me doing so - see if doing this works for you:

Screen.Recording.2024-03-19.at.11.36.52.mov

Copy link
Member

@corsonr corsonr 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 all the changes, that works beautifully!

image

@Dan-Q
Copy link
Contributor Author

Dan-Q commented Mar 19, 2024

Turns out the green blobs aren't part of the design, whoops! Fixed in 0b11add.

Copy link
Contributor

@andfinally andfinally left a comment

Choose a reason for hiding this comment

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

Looks great, thanks Dan.

Comment on lines +195 to +197
&__sponsored-label {
color: $gray-700;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This could maybe have been woocommerce-marketplace__product-card__label, as we may show labels with a different text at some point. Not a big deal I guess.

@Dan-Q Dan-Q merged commit b0ea773 into trunk Mar 19, 2024
30 of 31 checks passed
@Dan-Q Dan-Q deleted the add/woocom19612-identify-sponsored-products branch March 19, 2024 18:10
@github-actions github-actions bot added this to the 8.8.0 milestone Mar 19, 2024
@github-actions github-actions bot added the needs: analysis Indicates if the PR requires a PR testing scrub session. label Mar 19, 2024
@alvarothomas alvarothomas added needs: internal testing Indicates if the PR requires further testing conducted by Solaris status: analysis complete Indicates if a PR has been analysed by Solaris and removed needs: analysis Indicates if the PR requires a PR testing scrub session. labels Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs: internal testing Indicates if the PR requires further testing conducted by Solaris plugin: woocommerce Issues related to the WooCommerce Core plugin. status: analysis complete Indicates if a PR has been analysed by Solaris
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants