|
/ Knowledge Base /Products/ How to Display Product Reviews Using Shortcodes

How to Display Product Reviews Using Shortcodes

This document explains how to use SureCart’s product review shortcodes to display reviews on any page, including pages built with Divi, Beaver Builder, Oxygen, and other page builders that do not support the WordPress Block Editor.

Requirements

  • WordPress admin access
  • SureCart installed and activated
  • Reviews enabled on the product in SureCart

Available Shortcodes

sc_product_review_rating_stars

Displays the average rating as filled, half, or empty stars.

Basic usage:

[sc_product_review_rating_stars]

With attributes:

[sc_product_review_rating_stars id="123" size="24px" fill_color="#f59e0b" link_to_reviews="true"]
AttributeTypeDefaultDescription
sizestring20pxSize of each star icon.
fill_colorstringTheme primary colorColor for filled stars (e.g. #f59e0b).
link_to_reviewsbooleanfalseWraps stars in a link to the reviews section.

sc_product_review_rating_value

Displays the average rating as a numeric value (e.g., 4.5).

Basic usage:

[sc_product_review_rating_value]

With attributes:

[sc_product_review_rating_value link_to_reviews="true"]
AttributeTypeDefaultDescription
link_to_reviewsbooleanfalseWraps the value in a link to the reviews section.

sc_product_review_total_count

Displays the total number of reviews (e.g., 156 reviews).

Basic usage:

[sc_product_review_total_count]

With attributes:

[sc_product_review_total_count show_label="false" link_to_reviews="false"]
AttributeTypeDefaultDescription
show_labelbooleantrueShows the “reviews” label next to the count. Set to false to display the number only.
show_for_zero_reviewsbooleantrueRenders the block even when the product has no reviews. Set to false to hide it.
link_to_reviewsbooleantrueWraps the count in a link to the reviews section.

sc_product_review_breakdown

Displays a 5-star breakdown with progress bars showing the distribution of ratings.

Basic usage:

[sc_product_review_breakdown]

With attributes:

[sc_product_review_breakdown columns="2" bar_fill_color="#f59e0b"]
AttributeTypeDefaultDescription
columnsnumber1Number of columns for the breakdown layout.
fill_colorstring—Color for the star icons in each row (e.g. #f59e0b).
bar_fill_colorstring—Color for the filled portion of the progress bars (e.g. #f59e0b).
bar_background_colorstring—Background color for the progress bar track (e.g. #e5e7eb).

Note: fill_color controls the star icon color in each row. bar_fill_color controls the progress bar fill color. These are separate attributes. The star icon size within the breakdown rows is fixed and cannot be changed via shortcode.

sc_product_review_list

Displays the full review experience, including a summary section, filter sidebar, individual reviews with pagination, and the Write a Review form modal.

Basic usage:

[sc_product_review_list]

This shortcode includes:

  • Summary section — Average rating value, stars, total count, and star breakdown
  • Filter sidebar — Star rating filter tags and checkboxes
  • Review items — Reviewer name, verified buyer badge, date, star rating, title, and content
  • Pagination — Previous, page numbers, and next controls
  • Empty state — A “No reviews yet” message with a Write a Review button
  • Write a Review button — Opens the review form modal

This is the most complete shortcode and is equivalent to the full review block in the Block Editor.

sc_product_review_add_button

Displays a Write a Review button that opens the review form modal. If the user is not logged in, they are redirected to the customer dashboard to log in first.

Basic usage:

[sc_product_review_add_button]

With attributes:

[sc_product_review_add_button label="Leave a Review" button_type="text"]
AttributeTypeDefaultDescription
labelstringWrite a ReviewButton text label. Has no effect when button_type=”icon”.
button_typestringbothDetermines what the button displays: both (icon + text), text (text only), or icon (icon only).
iconstringedit-2Icon name displayed in the button.
classNamestringis-style-fillCSS class for button style. Use is-style-fill for a filled button or is-style-outline for an outlined button.

Examples

Display stars and rating on a landing page

[sc_product_review_rating_stars size="24px"]

[sc_product_review_rating_value] / 5.0

[sc_product_review_total_count]

Display the full review section on a custom page

[sc_product_review_list]

Display review count without label or link

[sc_product_review_total_count show_label="false" link_to_reviews="false"]

Display the breakdown with custom colors

[sc_product_review_breakdown columns="2" bar_fill_color="#f59e0b" bar_background_color="#e5e7eb"]

Display a standalone review button with a custom label

[sc_product_review_add_button label="Leave a Review" button_type="text"]

Use shortcodes directly on a product page (no ID required)

[sc_product_review_rating_stars]

[sc_product_review_breakdown]

[sc_product_review_list]

Notes

  • Reviews must be enabled on the product in SureCart for any shortcode to render output.
  • These shortcodes use the WordPress Interactivity API. Interactive features, such as pagination, filters, and the review form modal, function without full page reloads.
  • These shortcodes override the auto-generated ones from the block registration loop, which do not set up product context correctly.

FAQ

Was this doc helpful?
What went wrong?

We don't respond to the article feedback, we use it to improve our support content.

Need help? Contact Support
On this page
Scroll to Top