Snippets on non-product page

This tutorial will show you how to add Ryviu snippet code on a non-product page of your store.

In Ryviu, you can include code snippets on the non-product page. If you want to add Ryviu snippet codes to display reviews on a single product on every page, you can follow the instruction below.

Add the following code in the place where you want to display stars review for your page:

<div class="review-widget">
	<ryviu-widget-total product_id="{{product.id}}" handle="{{product.handle}}" reviews_data="{{product.metafields.ryviu.product_reviews_info  | escape  }}"></ryviu-widget-total>
</div>

Add this one in the review widget to display comments for a product

<div class="lt-block-reviews"> 
	<ryviu-widget product_id="{{product.id}}" handle="{{product.handle}}"    title_product="{{product.title}}" image_product="{{ product.featured_image.src | img_url: '100x' }}"></ryviu-widget>
</div>

But please replace these values in snippet codes above:

  • {{product.id}} by your product ID

  • {{product.handle}} by your product handle

  • {{product.title}} by your product name

  • {{ product.featured_image.src | img_url: '100x' }} by URL of thumbnail image of your product

Example code will be like this:

<div class="lt-block-reviews">
	<ryviu-widget product_id="66669999" handle="handle-of-this-product" title_product="This is name of product" image_product="{{ product.featured_image.src | img_url: '100x' }}"</ryviu-widget>
</div>

How to get product ID?

1. For Shopify:

  1. To get the Product ID Number, log in to your Shopify store admin > navigate to Products

  2. Click on the product that you want to get the Product ID Number for.

  3. Go to the URL at the top and copy the number that comes after '…/ products/ as below.

2. For Woocommerce:

Login your WordPress admin > open Products section > hover on a product then you can see the product ID

How to get the product's handle?

1. For Shopify

Log in your Shopify admin > Products > click on your product > scroll down to the bottom > click Edit website SEO, copy your handle in URL and handle

2. For WooCommerce:

Login your WordPress admin > Products > All products > click Edit in a product that you want to import reviews > click Edit in Permalink section of that product > copy product's handle

How to get an image URL of the product?

Open your product > right-click on an image then select "Copy link address" to get the image URL

Remember to Save all things you have done.

If you have any questions, please let us know via live chat or email.

Last updated