{"id":2011,"date":"2022-02-03T15:49:52","date_gmt":"2022-02-03T15:49:52","guid":{"rendered":"https:\/\/www.opinew.com\/help-center\/?post_type=ht_kb&#038;p=2011"},"modified":"2024-03-27T11:49:26","modified_gmt":"2024-03-27T11:49:26","slug":"web-components","status":"publish","type":"ht_kb","link":"https:\/\/www.opinew.com\/help-center\/knowledge-base\/web-components\/","title":{"rendered":"Web Components"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">1. Add the following code in &lt;head&gt;<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">&lt;link rel=\"preload\" href=\"https:\/\/cdn.opinew.com\/shop-widgets-components\/v2\/static\/i18n\/lang.json\" as=\"fetch\"&gt;\n&lt;link rel=\"stylesheet\" href=\"https:\/\/cdn.opinew.com\/shop-widgets-components\/v2\/static\/css\/index.css\"&gt;\n&lt;link rel=\"stylesheet\" href=\"https:\/\/cdn.opinew.com\/styles\/opw-icons\/style.css\"&gt;\n&lt;script src=\"https:\/\/cdn.opinew.com\/shop-widgets-components\/v2\/static\/js\/index.js\" async &gt;&lt;\/script&gt;<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">2. Insert widget tag in desired place in shop code<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">General usage<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">&lt;opinew-plugin type=\"&lt;WIDGET_TYPE&gt;\" product-id=\"&lt;PRODUCT_ID&gt;\" domain=\"&lt;SHOP_DOMAIN&gt;.myshopify.com\"&gt;&lt;\/opinew-plugin&gt;<\/code><\/pre>\n\n\n    \t\t<div class=\"hts-messages hts-messages--info   hts-messages--withicon \"   >\r\n    \t\t\t    \t\t\t    \t\t\t\t<p>\r\n    \t\t\t\t\tYou will need to change &lt;WIDGET_TYPE&gt;, &lt;PRODUCT_ID&gt; and &lt;SHOP_DOMAIN&gt; to data specific for your shop. Please note that you need to use your myshopify.com shop domain and not your custom domain.    \t\t\t\t<\/p>\r\n    \t\t\t    \t\t\t\r\n    \t\t<\/div><!-- \/.ht-shortcodes-messages -->\r\n    \t\t\n\n\n\n<h4 class=\"wp-block-heading\">Tag attributes<\/h4>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>Name<\/td><td>Description<\/td><\/tr><tr><td>type<\/td><td>Required value to choose desired widget type. Available options are:<br><code>product<\/code>, <code>floating<\/code>,<code> all<\/code>, <code>carousel<\/code>, <code>request<\/code>,<code>product-stars<\/code>, <code>collection-stars<\/code>,<code>footer-badge<\/code><\/td><\/tr><tr><td>product-id<\/td><td>Shopify product id. Required for: <code>product, product-stars, collection-stars<\/code><\/td><\/tr><tr><td>domain<\/td><td>Shop domain &#8211; Optional. When not set, the domain is read from browser <code>window.location.host<\/code> property. Recommended to set to make sure widgets work properly on dev environment. This needs to be your myshopify.com domain provided by Shopify, not your custom domain (if you use one).<\/td><\/tr><tr><td>lang (optional)<\/td><td>ISO 639-1 language code to specify the language of the widget eg. <code>fr, en, pt<\/code><\/td><\/tr><tr><td>theme <br>(optional for type=&#8221;product&#8221;)<\/td><td>specify theme of the product review widget e.g. theme=&#8221;carousel&#8221;<br>possible values are <code>default, minimal, modern, carousel<\/code><\/td><\/tr><tr><td>search-text<br>(optional for type=&#8221;product&#8221;)<\/td><td>If set, the value will be used to prefill the product reviews widget search bar.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Widget examples<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Product review widget<\/h3>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"714\" height=\"506\" src=\"https:\/\/www.opinew.com\/help-center\/wp-content\/uploads\/2022\/02\/image-1.png\" alt=\"\" class=\"wp-image-2024\" srcset=\"https:\/\/www.opinew.com\/help-center\/wp-content\/uploads\/2022\/02\/image-1.png 714w, https:\/\/www.opinew.com\/help-center\/wp-content\/uploads\/2022\/02\/image-1-300x213.png 300w, https:\/\/www.opinew.com\/help-center\/wp-content\/uploads\/2022\/02\/image-1-50x35.png 50w, https:\/\/www.opinew.com\/help-center\/wp-content\/uploads\/2022\/02\/image-1-60x43.png 60w, https:\/\/www.opinew.com\/help-center\/wp-content\/uploads\/2022\/02\/image-1-100x71.png 100w\" sizes=\"(max-width: 714px) 100vw, 714px\" \/><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">&lt;opinew-plugin type=\"product\" product-id=\"123142412\" domain=\"shop.myshopify.com\"&gt;&lt;\/opinew-plugin&gt;<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">All reviews widget<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">&lt;opinew-plugin type=\"all\" domain=\"shop.myshopify.com\">&lt;\/opinew-plugin><\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Floating all reviews widget<\/h3>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.opinew.com\/help-center\/wp-content\/uploads\/2021\/10\/floating-widget.png\" alt=\"Floating widget preview\"\/><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">&lt;opinew-plugin type=\"floating\" product-id=\"123142412\" domain=\"shop.myshopify.com\"&gt;&lt;\/opinew-plugin&gt;<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Featured reviews carousel<\/h3>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"356\" src=\"https:\/\/www.opinew.com\/help-center\/wp-content\/uploads\/2022\/02\/image-2-1024x356.png\" alt=\"\" class=\"wp-image-2025\" srcset=\"https:\/\/www.opinew.com\/help-center\/wp-content\/uploads\/2022\/02\/image-2-1024x356.png 1024w, https:\/\/www.opinew.com\/help-center\/wp-content\/uploads\/2022\/02\/image-2-300x104.png 300w, https:\/\/www.opinew.com\/help-center\/wp-content\/uploads\/2022\/02\/image-2-768x267.png 768w, https:\/\/www.opinew.com\/help-center\/wp-content\/uploads\/2022\/02\/image-2-50x17.png 50w, https:\/\/www.opinew.com\/help-center\/wp-content\/uploads\/2022\/02\/image-2-1536x534.png 1536w, https:\/\/www.opinew.com\/help-center\/wp-content\/uploads\/2022\/02\/image-2-60x21.png 60w, https:\/\/www.opinew.com\/help-center\/wp-content\/uploads\/2022\/02\/image-2-100x35.png 100w, https:\/\/www.opinew.com\/help-center\/wp-content\/uploads\/2022\/02\/image-2.png 1673w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">&lt;opinew-plugin type=\"carousel\" domain=\"shop.myshopify.com\"&gt;&lt;\/opinew-plugin&gt;  <\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Review request form<\/h3>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"896\" height=\"865\" src=\"https:\/\/www.opinew.com\/help-center\/wp-content\/uploads\/2022\/02\/image-3.png\" alt=\"\" class=\"wp-image-2026\" srcset=\"https:\/\/www.opinew.com\/help-center\/wp-content\/uploads\/2022\/02\/image-3.png 896w, https:\/\/www.opinew.com\/help-center\/wp-content\/uploads\/2022\/02\/image-3-300x290.png 300w, https:\/\/www.opinew.com\/help-center\/wp-content\/uploads\/2022\/02\/image-3-768x741.png 768w, https:\/\/www.opinew.com\/help-center\/wp-content\/uploads\/2022\/02\/image-3-50x48.png 50w, https:\/\/www.opinew.com\/help-center\/wp-content\/uploads\/2022\/02\/image-3-60x58.png 60w, https:\/\/www.opinew.com\/help-center\/wp-content\/uploads\/2022\/02\/image-3-100x97.png 100w\" sizes=\"(max-width: 896px) 100vw, 896px\" \/><\/figure><\/div>\n\n\n<pre class=\"wp-block-code\"><code class=\"\">&lt;opinew-plugin type=\"request\" domain=\"shop.myshopify.com\"&gt;&lt;\/opinew-plugin&gt;<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Product page stars badge<\/h3>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"449\" height=\"260\" src=\"https:\/\/www.opinew.com\/help-center\/wp-content\/uploads\/2022\/02\/image-4.png\" alt=\"\" class=\"wp-image-2027\" srcset=\"https:\/\/www.opinew.com\/help-center\/wp-content\/uploads\/2022\/02\/image-4.png 449w, https:\/\/www.opinew.com\/help-center\/wp-content\/uploads\/2022\/02\/image-4-300x174.png 300w, https:\/\/www.opinew.com\/help-center\/wp-content\/uploads\/2022\/02\/image-4-50x29.png 50w, https:\/\/www.opinew.com\/help-center\/wp-content\/uploads\/2022\/02\/image-4-60x35.png 60w, https:\/\/www.opinew.com\/help-center\/wp-content\/uploads\/2022\/02\/image-4-100x58.png 100w\" sizes=\"(max-width: 449px) 100vw, 449px\" \/><\/figure><\/div>\n\n\n<pre class=\"wp-block-preformatted\">&lt;opinew-plugin type=\"product-stars\" product-id=\"123142412\" domain=\"shop.myshopify.com\"&gt;&lt;\/opinew-plugin&gt;  <\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Collection page stars badge<\/h3>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"265\" height=\"354\" src=\"https:\/\/www.opinew.com\/help-center\/wp-content\/uploads\/2022\/02\/image-5.png\" alt=\"\" class=\"wp-image-2028\" srcset=\"https:\/\/www.opinew.com\/help-center\/wp-content\/uploads\/2022\/02\/image-5.png 265w, https:\/\/www.opinew.com\/help-center\/wp-content\/uploads\/2022\/02\/image-5-225x300.png 225w, https:\/\/www.opinew.com\/help-center\/wp-content\/uploads\/2022\/02\/image-5-37x50.png 37w, https:\/\/www.opinew.com\/help-center\/wp-content\/uploads\/2022\/02\/image-5-45x60.png 45w, https:\/\/www.opinew.com\/help-center\/wp-content\/uploads\/2022\/02\/image-5-75x100.png 75w\" sizes=\"(max-width: 265px) 100vw, 265px\" \/><\/figure><\/div>\n\n\n<pre class=\"wp-block-code\"><code class=\"\">&lt;opinew-plugin type=\"collection-stars\" product-id=\"123142412\" domain=\"shop.myshopify.com\"&gt;&lt;\/opinew-plugin&gt; <\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">3. Check out our example Hydrogen app<\/h2>\n\n\n\n<p>If you want to see an example of how our widgets can be integrated with Shopify Hydrogen, check out our demo project at <a href=\"https:\/\/github.com\/opinewdev\/opinew-headless-hydrogen-examples\" class=\"rank-math-link\">https:\/\/github.com\/opinewdev\/opinew-headless-hydrogen-examples<\/a>.<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>1. Add the following code in &lt;head&gt; 2. Insert widget tag in desired place in shop code General usage Tag attributes Name Description type Required value to choose desired widget type. Available options are:product, floating, all, carousel, request,product-stars, collection-stars,footer-badge product-id Shopify product id. Required for: product, product-stars, collection-stars domain Shop&#8230;<\/p>\n","protected":false},"author":1,"comment_status":"open","ping_status":"closed","template":"","format":"standard","meta":[],"ht-kb-category":[],"ht-kb-tag":[],"_links":{"self":[{"href":"https:\/\/www.opinew.com\/help-center\/wp-json\/wp\/v2\/ht-kb\/2011"}],"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=2011"}],"version-history":[{"count":17,"href":"https:\/\/www.opinew.com\/help-center\/wp-json\/wp\/v2\/ht-kb\/2011\/revisions"}],"predecessor-version":[{"id":3155,"href":"https:\/\/www.opinew.com\/help-center\/wp-json\/wp\/v2\/ht-kb\/2011\/revisions\/3155"}],"wp:attachment":[{"href":"https:\/\/www.opinew.com\/help-center\/wp-json\/wp\/v2\/media?parent=2011"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/www.opinew.com\/help-center\/wp-json\/wp\/v2\/ht-kb-category?post=2011"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/www.opinew.com\/help-center\/wp-json\/wp\/v2\/ht-kb-tag?post=2011"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}