Samples > Starter stores > Starter store enhancements > Social Commerce > WebSphere Commerce Dojo Enhancements API > User interface widgets
ibm.social.Reviews
The Reviews widget is used by shoppers to create a numeric rating with review text for a product. It also displays the average rating for a product. It supports two modes: item mode and user mode. Item mode provides the ratings and reviews content that is associated with a product. User mode provides the ratings and reviews content that is created by a single user.
Sample Output
The following screen capture shows the Reviews widget used by a registered shopper to create a review for a product.The following screen capture shows the Reviews widget used to view an existing review and rating for a product.
Example
<div dojoType="ibm.social.Reviews" resourceId="UserId" resourceType="users" loadOnStartup="true"> </div> <div dojoType="ibm.social.Reviews" resourceId="Product SKU" resourceType="items" itemDescription="Sample Product Reviews" loadOnStartup="true"> </div>
Parameters
- dojoType
- (String) The Dojo widget type. Set to ibm.social.Reviews.
- resourceId
- (String) Set to either the Item ID or the User ID.
- resourceType
- (String) Set to items for item mode or users for user mode.
- itemDescription
- (String) This parameter is only valid for item mode. Provides descriptive text about the item for which reviews are created.
- loadOnStartup
- (Boolean) Used to determine if review entries must be displayed when the ibm.social.Reviews widget is launched. The default value is false.
Related reference