Calculated price The calculated price option simply sums the price of the products that this BOM product consists of. If the product consists of 3 products, priced 100, 25 and 17, the price will be 100+25+17=142.
Fixed price The fixed price disregards the price of the products that this BOM product consists of. When using fixed price, the price of this BOM product is taken from the Price field from the product details. If the product consists of 3 products, priced 100, 25 and 17 and Price is set to 130, 130 will be the price of the product. Calculated price plus changes This option is only for BOM products with a configurator
attached. First the price is calculated as the sum of the products that this BOM product consists of – if one or more of the options are a configurator, the price of the default product will be used.
Then if one of the options in one of the configurators is changed by the user, the price of the default product is subtracted and the price of the new selection is added. Fixed price plus changes This option is only for BOM products with a configurator
attached. The initial price is taken from the Price field from the product details of the BOM product. Then if one of the options in one of the configurators is changed by the user, the price of the default product is subtracted and the price of the new selection is added.
4.7 Comments and Rating
Customer ratings have become a must-have tool for many web sites, particularly online stores. The majority of shoppers nowadays look for customer-generated reviews – from 5-star ratings to the more elaborate questions and answers — to help guide their buying decisions.
In fact, a number of studies point to the huge importance customers give to reviews and ratings, especially among young consumers.
Dynamicweb eCommerce 8 has a built in comments and rating functionality to support this. Comments and Rating enable the following features:
- Let users rate and/or comment on the products
- Show the rating on product lists as well as on individual products - Show comments from users on the products
- Sort lists of products by rating so highly rated products are sorted at the top of lists - Editing of comments and ratings from the eCommerce Product catalog.
Comments and ratings are easy to configure as you’ll see next.
Walkthrough – using Comments and Rating
1. In the Navigation panel, locate the Catalog page, open the paragraph with the eCommerce catalog module attached and open the module’s settings.
2. In the templates section, choose to edit the Product template
(eCom/Product/Product.html) by clicking the Edit template icon next to the template chooser.
3. The eCom/Product folder in the template system has a template called Comment.html which holds an implementation of the comment and rating feature. It can be activated by including it in the product template using the Include tag. In the bottom of the product template, insert the following code if it’s not already there:
<!--@Include(Comment.html)-->
4. Save your changes and close the module settings. 5. In the frontend, navigate to a product to see the result:
Figure 4-34
5. Fill out the form with a rating from the dropdown, your name, e-mail, website and a comment and submit the form by clicking the Send comment button.
6. Repeat step number 5 with different rating and comments 7. After submitting the form the rating and comments will appear:
Figure 4-35
To see how this works, open the Comment.html template from the File manager – the template is located at /Templates/eCom/Product/Comment.html.
At the top of the template you will see something like this: <!--@If Defined(Ecom:Product.Rating)-->
<h3>Reviews</h3>
<!--@LoopStart(Comments)--> <!--@DwTemplateTags--> <!--@If Defined(Website)-->
<a href="<!--@Website-->"><!--@Name--></a> <!--@EndIf(Website)-->
<!--@If Not Defined(Website)--> <!--@Name-->
<!--@EndIf(Website)-->
<span style="color:#c5c5c5;">
<[email protected]> <[email protected]></span><br /> <!--@Stars--><br />
<!--@Text--> <hr />
<!--@LoopEnd(Comments)--> <!--@EndIf(Ecom:Product.Rating)-->
This is the part that shows the list of comments and their ratings of the product if there is any. The block starts with an If Defined on Ecom:Product.Rating tag so the Review heading and the comments loop will not be rendered if there are no ratings. The template is pretty self-explaining, but note the tag Stars. It will render a series of images (stars) matching the rating of that specific comment. When doing that,
<!--@Rating--> tag which is the rating in numeric, by creating an image tag like this: <img src="/Files/System/<!--@Rating-->.gif">. Make sure to have images named 1.gif, 2.gif etc. in the System folder.
Further down in the template you will find the form that submits the comment and rating. It will look like this:
<form method="post" action="/Admin/Public/404.aspx" id="commentform" onsubmit="return comment_validate()">
<input type="hidden" name="Comment.Command" id="Comment.Command" value="" /> <input type="hidden" name="Comment.ItemType" value="ecomProduct" />
<input type="hidden" name="Comment.ItemID" value="<!--@Ecom:Product.ID-->" />
<input type="hidden" name="Comment.LangID" value="<!--@Ecom:Product.LanguageID-->" /> <label for="Comment.Rating">Your rating</label>
<select name="Comment.Rating" id="Comment.Rating"> <option value="">Rate product....</option> <option value="1">1 (Poor)</option>
<option value="2">2 (Below average)</option> <option value="3">3 (Average)</option> <option value="4">4 (Good)</option> <option value="5">5 (Great)</option> </select><br />
<label for="Comment.Name">Name</label>
<input type="text" name="Comment.Name" id="Comment.Name" value="" /><br /> <label for="Comment.Name">E-mail</label>
<input type="text" name="Comment.Email" id="Comment.Email" value="" /><br /> <label for="Comment.Name">Website</label>
<input type="text" name="Comment.Website" id="Comment.Website" value="" /><br /> <label for="Comment.Text">Comment</label>
<textarea name="Comment.Text" id="Comment.Text" rows="10" cols="50"></textarea><br />
<input type="submit" value="Send comment" /> </form>
By default the form calls the JavaScript function comment_validate when submitted. This JavaScript function fills out the hidden fields and the action of the form to limit issues with spam-bots submitting data.
4.7.2 Managing comments and ratings
Comments and ratings are usually coming from users, and you may have the need to edit them if they contain bad language. It is easy to manage the comments and ratings for a product. To edit comments, locate the product in the eCommerce Product Catalog. Then on the Ribbon bar, in the Tools section, click the Comments button. The following dialog appears:
Figure 4-36
From the Comments dialog you can edit, add and delete the comments and rating for this product.
4.7.3 Using comments and ratings in product lists
The ratings can also be used for sorting products in product lists so that the highest rated products are shown at the top. You see how to do this next.