Skip to content

Conversation

@tgglv
Copy link
Contributor

@tgglv tgglv commented Sep 29, 2021

All Submissions:

Changes proposed in this Pull Request:

The search on WooCommerce > Marketplace page that shows product from the WooCommerce.com marketplace as cards. During previous re-design phase we added updated product cards in #30410.

This PR updates those product cards by:

  • replacing a product image with icon (if it exists) that fits better
  • mentioning a vendor who developed a product together with a link to reach the rest of their products on WooCommerce.com
  • adding an average rating represented as 5 stars (golden, gray, or 50/50)
  • adding the number of reviews left by customers for the product

Also, the text color for recurring payment cadence ("per year") was changed according to the design.

Closes 10867-gh-Automattic/woocommerce.com

How to test the changes in this Pull Request:

  1. Check out this branch to your local environment
  2. Go to WooCommerce > Marketplace
  3. Search for "memberships"
  4. Ensure you see products like WooCommerce Memberships that contain:
    • icon (instead of a product image),
    • developed by ... (with a link to a vendor page on WooCommerce.com)
    • average rating represented as stars
    • number of reviews left by customers

Screen Shot 2021-09-30 at 11 07 48

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 - Add ratings, reviews and icons into Marketplace's Product Cards.

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 self-assigned this Sep 29, 2021
@tgglv tgglv marked this pull request as ready for review September 30, 2021 08:49
@tgglv tgglv added the needs: author feedback The issue/PR needs a response from any of the parties involved in the issue. label Sep 30, 2021
@tgglv
Copy link
Contributor Author

tgglv commented Sep 30, 2021

Local test run results:

Test Suites: 2 failed, 2 skipped, 36 passed, 38 of 40 total
Tests:       9 failed, 5 skipped, 173 passed, 187 total

Failed scenarios:

  • Import Products from a CSV file › can upload the CSV file and import products
  • A japanese store can complete the selective bundle install but does not include WCPay. › should display the choose payments task, and not the woocommerce payments task

It looks like failed tests aren't connected with the changes.

@github-actions github-actions bot added needs: triage feedback Issues for which we requested feedback from the author and received it. and removed needs: author feedback The issue/PR needs a response from any of the parties involved in the issue. labels Sep 30, 2021
@tgglv tgglv added needs: author feedback The issue/PR needs a response from any of the parties involved in the issue. and removed needs: triage feedback Issues for which we requested feedback from the author and received it. labels Sep 30, 2021
@andfinally andfinally added this to the In-App Marketplace milestone Oct 1, 2021
andfinally
andfinally previously approved these changes Oct 1, 2021
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! I just left a couple of minor suggestions.

Copy link
Contributor

@kloon kloon left a comment

Choose a reason for hiding this comment

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

Changes looks great so far @tgglv, just left a small couple of comments that needs addressing.

<span class="price"><?php esc_html_e( 'Free', 'woocommerce' ); ?></span>
<?php else : ?>
<span class="price"><?php echo wp_kses_post( $addon->price ); ?></span>
<span class="price-suffix"><?php esc_html_e( 'per year', 'woocommerce' ); ?></span>
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 fetch the suffix from the API with a fallback to per year?

Copy link
Contributor

@andfinally andfinally Oct 13, 2021

Choose a reason for hiding this comment

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

Added in 4e370a4. I'm not sure how we'd translate such strings – we'll have to start passing the locale to the endpoint. Added 11488-gh-Automattic/woocommerce.com for the back end changes.

@kloon kloon self-requested a review October 5, 2021 13:04
@corsonr
Copy link
Contributor

corsonr commented Oct 7, 2021

@tgglv I just tested it, and that works beautifully! Just a small comment, I'd suggest that the comments in the admin.scss file use the following format // comment instead of /* comment */ so that they do not render in the compiled file.

I made the changes in this diff file in case you want to implement it.

@github-actions github-actions bot added needs: triage feedback Issues for which we requested feedback from the author and received it. and removed needs: author feedback The issue/PR needs a response from any of the parties involved in the issue. labels Oct 7, 2021
andfinally
andfinally previously approved these changes Oct 8, 2021
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.

Thanks for the changes, looking good! Approving on the assumption we'll apply Gerhard and Remi's suggestions.

@andfinally andfinally requested a review from a team October 13, 2021 11:17
@andfinally
Copy link
Contributor

andfinally commented Oct 13, 2021

I took the liberty to pushing Remi's comment changes to the branch. Still waiting for confirmation on the UTM tags from marketing.

Copy link
Contributor

@vedanshujain vedanshujain left a comment

Choose a reason for hiding this comment

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

Left a minor comment. Looks like tests are also failing but seems unrelated, can you please rebase with latest trunk to see if that fixes the failing tests.

*
* @return string CSS class to use.
*/
function wccom_get_star_class( $rating, $index ) {
Copy link
Contributor

Choose a reason for hiding this comment

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

can we move this function to class-wc-admin-addons.php? seems like this can be used in multiple views in the future and not just this one.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, @vedanshujain! Addressed in 8e2f8bd.

@tgglv
Copy link
Contributor Author

tgglv commented Oct 13, 2021

Left a minor comment. Looks like tests are also failing but seems unrelated, can you please rebase with latest trunk to see if that fixes the failing tests.

@vedanshujain, it seems that the problem is in the trunk as well.
Solved the problem with tests by changing hash in the composer.lock. It looks like coincidentally phpunit files in cache break running composer install.

vedanshujain
vedanshujain previously approved these changes Oct 14, 2021
Copy link
Contributor

@vedanshujain vedanshujain 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 the changes, LGTM! I am not merging it just yet, and will leave it to @Konamiman to see where we want to fix the composer for unit tests.

@Konamiman
Copy link
Contributor

I am not merging it just yet, and will leave it to @Konamiman to see where we want to fix the composer for unit tests.

Also there are merge conflicts, once fixed let's see what can we do with that composer.json thing.

@Konamiman Konamiman modified the milestones: In-App Marketplace, 5.9.0 Oct 14, 2021
@Konamiman Konamiman merged commit 30df9f4 into trunk Oct 14, 2021
@Konamiman Konamiman deleted the add/reviews-into-marketplace-product-card branch October 14, 2021 14:14
@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: add changelog Mark all PRs that have not had their changelog entries added. [auto] release: cherry-pick Commits from this PR also needs to be added to current release branch. 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 14, 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
andfinally added a commit that referenced this pull request Oct 25, 2021
… allowing prices per month. This was added in #30840, but was accidentally omitted when we fixed conflicts.
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.

8 participants