Actions overview
| Action | Description |
|---|---|
ProductRatingAdd | Creates a new product rating. |
ProductRatingUpdate | Edits an existing product rating. |
ProductRatingDelete | Deletes an existing product rating. |
Actions
ProductRatingAdd
This action creates a new rating for a product. The customer must be logged in for this. Usage exampleCan be used on the product detail page or in the order history to give logged-in customers the option to rate a purchased product. Parameters
| Name | Description |
|---|---|
productId | The ID of the product to be rated. |
orderId | The ID of the order to which the rating belongs. |
points | The rating in points (e.g., 1-5 stars). |
subject | The title of the rating. |
description | The rating text. |
anonymous | Indicates whether the rating should be submitted anonymously. |
| Error code | Description |
|---|---|
notLoggedIn | The user is not logged in. |
missingProductId | Parameter productId is missing. |
missingOrderId | Parameter orderId is missing. |
missingPoints | Parameter points is missing. |
ratingAlreadyExists | A rating already exists for this product and this order. |
- $wsProductRating
- $wsProductRating.checkRatingExistence()
- $wsProductRating.loadAllProductRatings()
- $wsAccount.isLoggedIn
ProductRatingUpdate
This action edits an existing product rating of the logged-in customer. Usage exampleCan be used on the product detail page or in the customer account when a customer wants to subsequently adjust the rating they have submitted. Parameters
| Name | Description |
|---|---|
productId | The ID of the product whose rating should be edited. |
orderId | The ID of the order to which the rating belongs. |
points | The new rating in points. |
subject | The new title of the rating. |
description | The new rating text. |
anonymous | Indicates whether the rating should be submitted anonymously. |
| Error code | Description |
|---|---|
notLoggedIn | The user is not logged in. |
missingProductId | Parameter productId is missing. |
missingOrderId | Parameter orderId is missing. |
invalidRating | The rating does not exist or does not belong to this customer account. |
- $wsProductRating
- $wsProductRating.loadSingleRating()
- $wsProductRating.loadRatingByAccount()
- $wsAccount.isLoggedIn
ProductRatingDelete
This action deletes an existing product rating of the logged-in customer. Usage exampleCan be used on the product detail page or in the customer account when a customer wants to remove the rating they have submitted. Parameters
| Name | Description |
|---|---|
productId | The ID of the product whose rating should be deleted. |
orderId | The ID of the order to which the rating belongs. |
| Error code | Description |
|---|---|
notLoggedIn | The user is not logged in. |
missingProductId | Parameter productId is missing. |
missingOrderId | Parameter orderId is missing. |
invalidRating | The rating does not exist or does not belong to this customer account. |
