[wcj_product_average_rating]

Display WooCommerce product average rating

Description

[wcj_product_average_rating] shortcode displays WooCommerce product average rating. Shortcode has no required attributes, optional attributes are listed below.

Args

product_id
(optional) The integer ID for a product.

Default: The current product ID, if exists
before
(optional) Text to place before the content. If content is empty this argument is ignored.

Default: None
after
(optional) Text to place after the content. If content is empty this argument is ignored.

Default: None
visibility
(optional) User visibility. Possible values are WordPress user roles (including custom), e.g. administrator, shop_manager, customer, guest etc.

Default: all
location
(optional) Make shortcode results visible only to customers from specific country (by user IP). Value is two letter country code.

Default: all
site_visibility
(optional) Restrict shortcode output to some pages only. Possible values: single, page, archive.

Default: None
wpml_language
(optional) Restrict shortcode output to certain WPML language only. Possible values are two letter language codes. Can be comma separated list.

Default: None
not_wpml_language
(optional) Restrict shortcode output to exclude certain WPML languages. Possible values are two letter language codes. Can be comma separated list.

Default: None

Examples

[wcj_product_average_rating before="Product rating: "]
Recommended for WooCommerce Product Info module
Accessible through:
  • [wcj_product_average_rating]
Tested on WooCommerce 3.5.4 and WordPress 5.0.3
Plugin can be downloaded here. If there are any locked fields in the module, you will need to get Booster Plus to unlock them.

Leave a Reply

Comments

2 Comments

  1. Jartsev January 13, 2019 at 4:59 pm #

    Hello,

    I’d like to have ratings on my Category pages, and similar.

    I already have ratings on Peoduct pages. Like here:
    https://popdivari.fi/tuote/iivana-julma-venaja-tsaari-isabel-madariaga/

    I tried to use this shortcode via the Product Info module. It kind of worked, but returns only _numbers_. I don’t know how to use CSS on this. Is this the right approach ITFP?

    Reply to thread

    • RokasJ January 15, 2019 at 12:02 pm #

      Hi,

      This shortcode is not supposed to be used for categories. Unfortunately there is no such shortcode but we have added it to our todo list.

      Best regards,
      Rokas – Support Team