{"id":688,"date":"2020-05-09T13:37:52","date_gmt":"2020-05-09T13:37:52","guid":{"rendered":"https:\/\/www.opinew.com\/help-center\/?post_type=ht_kb&#038;p=688"},"modified":"2023-07-25T05:52:29","modified_gmt":"2023-07-25T05:52:29","slug":"display-review-widget-on-a-custom-page","status":"publish","type":"ht_kb","link":"https:\/\/www.opinew.com\/help-center\/knowledge-base\/display-review-widget-on-a-custom-page\/","title":{"rendered":"How do I display a review widget on a custom page?"},"content":{"rendered":"\n<p>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.<\/p>\n\n\n\n<p>A workaround to display review widgets on custom pages is to use the <strong>all_products<\/strong> function. Instead of the usual code for the review widget, use this review widget code:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">&lt;div style=\"clear:both;\">&lt;\/div>&lt;div id=\"opinew-reviews-product-page-code\" class=\"\">\n&lt;span id=\"opinew-plugin\" data-server-address=\"https:\/\/www.opinew.com\" \ndata-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 }}\">\n                 &lt;span id=\"opinew_product_plugin_app\">&lt;\/span>\n                &lt;\/span>&lt;\/div><\/code><\/pre>\n\n\n\n<p>The next step in the custom page display is to replace the <strong>PRODUCT HANDLE<\/strong>\u00a0in\u00a0the\u00a0code.<\/p>\n\n\n\n<p>The <strong>PRODUCT HANDLE<\/strong> is the ending of the URL of the product page. <\/p>\n\n\n\n<p>An example of this code snippet is: <a class=\"rank-math-link\" href=\"https:\/\/demo.opinew.com\/collections\/couches\/products\/wellgarden-3-seater-sofa-bed\">https:\/\/demo.opinew.com\/collections\/couches\/products\/wellgarden-3-seater-sofa-bed<\/a><\/p>\n\n\n\n<p>In this example, the product handle is<strong> &#8220;wellgarden-3-seater-sofa-bed&#8221;<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>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&#8230;<\/p>\n","protected":false},"author":1,"comment_status":"open","ping_status":"closed","template":"","format":"standard","meta":[],"ht-kb-category":[24],"ht-kb-tag":[26],"_links":{"self":[{"href":"https:\/\/www.opinew.com\/help-center\/wp-json\/wp\/v2\/ht-kb\/688"}],"collection":[{"href":"https:\/\/www.opinew.com\/help-center\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/www.opinew.com\/help-center\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/www.opinew.com\/help-center\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.opinew.com\/help-center\/wp-json\/wp\/v2\/comments?post=688"}],"version-history":[{"count":10,"href":"https:\/\/www.opinew.com\/help-center\/wp-json\/wp\/v2\/ht-kb\/688\/revisions"}],"predecessor-version":[{"id":2892,"href":"https:\/\/www.opinew.com\/help-center\/wp-json\/wp\/v2\/ht-kb\/688\/revisions\/2892"}],"wp:attachment":[{"href":"https:\/\/www.opinew.com\/help-center\/wp-json\/wp\/v2\/media?parent=688"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/www.opinew.com\/help-center\/wp-json\/wp\/v2\/ht-kb-category?post=688"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/www.opinew.com\/help-center\/wp-json\/wp\/v2\/ht-kb-tag?post=688"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}