This text guides on how to install Reviews main widget in product's page:
Reviews main widget installation
Steps for installation are:
Configure Javascript scripts
We'll need to:
Provide some variables
Load Trustvox
widget.js
script
<script type="text/javascript">
window._trustvox = [];
_trustvox.push(['_storeId', storeId]);
_trustvox.push(['_productId', productId]);
_trustvox.push(['_productName', productName]);
_trustvox.push(['_productPhotos', productPhotosUrls]);
_trustvox.push(['_tags', tags]); // optional
_trustvox.push(['_productExtraAttributes', productExtraAttributes]); // optional
</script>
<script async="true" type="text/javascript" src="//static.trustvox.com.br/assets/widget.js"></script>
Where following variables must be provided:
storeId (string): the store's Reviews unique identifier Required
productId (string): product's unique identifier that store uses to identify products within Reviews services (e.g.: creating sales via Reviews API) Required
productName (string): product's name as shown in product's page Required
productPhotos (array of string): URLs to product's photos Required
tags (array of string): Metadata about product (e.g.: "Gender/Female", "Category/Clothes") Optional
productExtraAttributes (object): an object with arbitrary key-value elements which may be used for filtering products (e.g.:
{ "category": "health" }
) Optional
For Reviews Staging Environment
If the store for which we're loading opinions was installed within staging environment (staging.trustvox.com.br), we shall use
//s3-sa-east-1.amazonaws.com/trustvox.staging.widget/widget.js
Instead of
//static.trustvox.com.br/assets/widget.js
Place the HTML element placeholder
Place this HTML element where the widget should be rendered:
<div id="_trustvox_widget"></div>