1. Home
  2. Review Widgets
  3. How do I display a review widget on a custom page?

How do I display a review widget on a custom page?

If you build a custom page in Shopify, it might not have access to the product object in the liquid template. When importing reviews to Shopify in this way, we need the custom page to have access to this product object to show reviews.

A workaround to display review widgets on custom pages is to use the all_products function. Instead of the usual code for the review widget, use this review widget code:

<div style="clear:both;"></div><div id="opinew-reviews-product-page-code" class="">
<span id="opinew-plugin" data-server-address="https://www.opinew.com" 
data-opw-prodreviews="{{ all_products['PRODUCT HANDLE'].metafields.opinew_metafields['product_plugin'] }}" data-opinew-shop-id="{{ shop.id }}" data-shop-url="{{shop.domain}}" data-platform-product-id="{{ all_products['PRODUCT HANDLE'].id }}">
                 <span id="opinew_product_plugin_app"></span>
                </span></div>

The next step in custom page display is to replace the PRODUCT HANDLE in the code.

The PRODUCT HANDLE is the ending of the URL of the product page.

An example of this code snippet is:

https://demo.opinew.com/collections/frontpage/products/mega-helmet

In this example, the product handle is “mega-helmet”

Updated on May 23, 2021

Was this article helpful?

Related Articles

Leave a Comment