By default, when you install Product Reviews on your website, the app will store all reviews that are submitted under a default "Product Id" of "0". However, if you like, you can collect reviews for several different products with a single app by modifying the install code snippets.
Product reviews has the ability to collect and display only those reviews associated with a unique product id. This means that you can create a Product Reviews app for your website. Then you can install this app on both your "T-shirt" product page and your "Cowboy Hat" product page and make it so each only shows the correct reviews. You will need to modify both the app and badge snippets with a product id to enable this behavior.
App Install
When you publish your Product Reviews app, the install snippet should look something like this (note your id will be different):
<div class="powr-product-reviews" id="01e34985_1645038425"></div>
<script src="https://localhost:3000/powr_local.js?platform=html"></script>
To add a product id, you want to modify the first line and add the product id by adding the attribute data-product-id="12345" to the <div> tag in the first line. Replace the number to be the product id of your product.
The updated code should look something like this:
<div class="powr-product-reviews" id="01e34985_1645038425" data-product-id="12345"></div>
<script src="https://localhost:3000/powr_local.js?platform=html"></script>
You can also add a data-product-name="t-shirt" using the same technique. Note that the name will only be show on the Reviews Management screen, it will not appear in the publish reviews.
Review Badge Install
You will need to do the same modification to the Review Badge install code snippet.
Original will look like this:
<script type="text/javascript" async="async" src="https://localhost:3000/powr_product_review_badge.js"></script>
<div class="product-reviews-badge-powr" data-app-id="01e34985_1645038425" >
</div>
After adding the product id (data-product-id="12345"), it will look similar to this:
<div class="powr-product-reviews" id="01e34985_1645038425" data-product-id="12345"></div>
<script src="https://localhost:3000/powr_local.js?platform=html"></script>
NOTE: Product Reviews on Shopify handles multiple products by default without requiring any changes.
Comments
0 comments
Please sign in to leave a comment.