This is the API docs for LemonStand V1, which has been discontinued. LemonStand is now a cloud based platform, available at lemonstand.com.

LemonStand API

shop:on_addProductReview AJAX handler

Defined in /modules/shop/classes/shop_actions.php, lines 378-410
Author LemonStand eCommerce Inc.
Adds a product review. This AJAX handler processes a product review form. Please read Displaying product rating and reviews article to learn how to implement the Write a Review form.

Supported form fields

Field Type Description
rating integer specifies a product rating.
review_title string specifies a review title.
review_author_name string specifies the review author name.
review_author_email string specifies the review author email address.
review_text string specifies the review text.
product_id string specifies the product identifier.
redirect string an optional URL to redirect the browser to.
no_flash boolean disables the "Your review has been successfully posted." message.
message string an optional flash message text.

Generated PHP variables

Variable Type Description
review_posted boolean this variable is set after successful review post.

Supported form field details

rating form field

Specifies a product rating. The rating should be a number (1-5) or empty value. If you do not need to implement the rating feature, you can skip this field. You can disable the ratings on the System/Settings/Ratings & Reviews Settings page.

review_title form field

Specifies a review title.

review_author_name form field

Specifies the review author name. You can hide this field for logged in customers, because if the customer is logged in, the review author name will match the customer's name.

review_author_email form field

Specifies the review author email address. You can hide this field for logged in customers, because if the customer is logged in, the review author name will match the customer's email address.

review_text form field

Specifies the review text.

product_id form field

Specifies the product identifier. This field is optional if the review form is implemented on the Product Details page.

redirect form field

An optional URL to redirect the browser to.

no_flash form field

Disables the "Your review has been successfully posted." message. Possible values: 0, 1. By default the handler puts the message to the flash storage. The message can be displayed with the flash_message() function.

message form field

An optional flash message text. Example:
<input type="button" value="Submit" onclick="return $(this).getForm().sendRequest(
  'shop:on_addProductReview', {
    extraFields: {message: 'Your review has been succesfuly posted'}, 
    update:{'product_page': 'product_partial'}
  })"/>

Generated PHP variable details

review_posted variable

boolean $review_posted;
This variable is set after successful review post. This variable is set only if the browser was not redirected to another page.