Skip to content

Conversation

@tgglv
Copy link
Contributor

@tgglv tgglv commented Oct 7, 2021

All Submissions:

Changes proposed in this Pull Request:

Related to 11239-gh-Automattic/woocommerce.com.

We want to revamp the Marketplace page according to Figma designs. Together with the new design, the approach of treating data from WooCommerce.com API was changed as well. Instead of the current approach of sections/containers for products and banners, the new approach uses groups of products displayed one after another.

Changes:

  • Refactor current implementation of featured page blocks (the current version works on custom markup functions like "open container", put some product cards, "close container"; the update uses a simplified approach of showing groups of product cards instead)
  • Add markup for showing ratings and review count for products
  • Reuses current addon's product card for both search results, products by categories, and featured products
  • CSS tweaks to make marketplace product card looks like on the design

How to test the changes in this Pull Request:

Preparation

  1. To test these changes properly you need an API for testing.
    There're 2 options:
  • Local WCCOM (use 11456-gh-Automattic/woocommerce.com for this option) or
  • Hardcoded JSON response from this script

For the 2nd option save the script in index.php file and launch PHP-Builtin server with the command like:

php -S host.docker.internal:9000
  1. Disable using transient by changing the first line of the render_featured method in includes/admin/class-wc-admin-addons.php to: $featured = false;

  2. Change the API URL used in $raw_featured = wp_safe_remote_get(... in the same method from https://woocommerce.test/wp-json/wccom-extensions/2.0/featured to http://host.docker.internal:9000 (you may need to change the function used to wp_remote_get as well)

Testing

  1. Open your testing WP site with WooCommerce on this branch

  2. Open WP Admin > WooCommerce > Marketplace page, make sure that you are viewing the "Featured" section

  3. You should see something similar to the image below:
    image

  4. Try extensions search (e.g. via typing "memberships"), the page should look as expected

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes, as applicable?
  • Have you successfully run tests with your changes locally?

Changelog entry

Enhancement - Revamp the WooCommerce Marketplace page.

FOR PR REVIEWER ONLY:

  • I have reviewed that everything is sanitized/escaped appropriately for any SQL or XSS injection possibilities. I made sure Linting is not ignored or disabled.

@tgglv tgglv changed the title Renovate Marketplace's Featured page Revamp Featured page in WooCommerce Marketplace Oct 7, 2021
@tgglv tgglv self-assigned this Oct 7, 2021
@tgglv tgglv requested a review from andfinally October 7, 2021 20:59
@tgglv tgglv marked this pull request as draft October 8, 2021 08:51
@tgglv tgglv changed the title Revamp Featured page in WooCommerce Marketplace [WIP] Revamp Featured page in WooCommerce Marketplace Oct 8, 2021
@andfinally andfinally changed the base branch from update/marketplace-2 to trunk October 13, 2021 16:31
@andfinally andfinally force-pushed the update/marketplace-featured-page branch from f8a1e25 to 618eca7 Compare October 13, 2021 16:35
Returning country in request to featured 2.0 endpoint.
@andfinally
Copy link
Contributor

(The 404 on the script was because GitHub changed the PasteBin link.)

@Konamiman
Copy link
Contributor

Hi @tgglv, there are merge conflicts, can you please address them?

Copy link
Member

@barryhughes barryhughes left a comment

Choose a reason for hiding this comment

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

One last note from me (re ::get_featured()), plus we need to resolve conflicts per note from @Konamiman.

Those things done, it should be good to merge 👍

@tgglv
Copy link
Contributor Author

tgglv commented Oct 14, 2021

Hi @tgglv, there are merge conflicts, can you please address them?

Hey @Konamiman, fortunately, conflicts are gone.

Copy link
Member

@barryhughes barryhughes left a comment

Choose a reason for hiding this comment

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

LGTM!

@barryhughes
Copy link
Member

@andfinally I didn't want to merge without your approval on the PR, but we're all set from my perspective.

@Konamiman Konamiman added this to the 5.9.0 milestone Oct 15, 2021
@Konamiman Konamiman merged commit d5b874a into trunk Oct 15, 2021
@Konamiman Konamiman deleted the update/marketplace-featured-page branch October 15, 2021 07:22
@Konamiman Konamiman added the release: add changelog Mark all PRs that have not had their changelog entries added. [auto] label Oct 15, 2021
@github-actions
Copy link
Contributor

Hi @Konamiman, thanks for merging this pull request. Please take a look at these follow-up tasks you may need to perform:

  • Add the status: needs changelog label
  • Add the status: needs testing instructions label

@Konamiman Konamiman added release: add testing instructions PRs that have not had testing instructions added to the wiki. [auto] release: cherry-pick Commits from this PR also needs to be added to current release branch. labels Oct 15, 2021
@Konamiman
Copy link
Contributor

I have updated the testing instructions since they were pointing to the deprecated get_featured method for the code changes, instead of the render_featured method. Also added a mention to replace wp_safe_remote_get with wp_remote_get, otherwise WP will throw an "Invalid URL" error when serving the script from localhost.

@Konamiman Konamiman added cherry picked and removed release: cherry-pick Commits from this PR also needs to be added to current release branch. release: add changelog Mark all PRs that have not had their changelog entries added. [auto] labels Oct 15, 2021
@tammullen tammullen added testing instructions added and removed release: add testing instructions PRs that have not had testing instructions added to the wiki. [auto] labels Oct 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs: triage feedback Issues for which we requested feedback from the author and received it.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants