Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Reviews by Product: fix reviews count not appearing in product selector #11976

Merged
merged 1 commit into from
Nov 29, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 8 additions & 4 deletions assets/js/blocks/reviews/reviews-by-product/edit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,26 +38,30 @@ const ReviewsByProductEditor = ( {
return (
<SearchListItem
{ ...args }
item={ {
...item,
count: item.details.review_count,
} }
countLabel={ sprintf(
/* translators: %d is the review count. */
_n(
'%d review',
'%d reviews',
item.review_count,
item.details.review_count,
'woo-gutenberg-products-block'
),
item.review_count
item.details.review_count
) }
aria-label={ sprintf(
/* translators: %1$s is the item name, and %2$d is the number of reviews for the item. */
_n(
'%1$s, has %2$d review',
'%1$s, has %2$d reviews',
item.review_count,
item.details.review_count,
'woo-gutenberg-products-block'
),
item.name,
item.review_count
item.details.review_count
) }
/>
);
Expand Down