Jump to content

Adding rating widget underneath Add to Cart button

Recommended Posts

Site URL: https://www.jonasstensgaard.com/free-craft-files-svgs-and-more/free-heart-arrow-svg-files

I'm on the York template and I'm using the Rating Widget to add a rating option on my products. I want to do two things:

1) How do I remove the "Rate this" box? It's not pretty, takes up space and seems unnecessary.

2) More importantly, I want to move the rating to underneath the Add to Cart button on my product pages. Is that possible? In the example shown, we're in the freebie section and I've replaced the Add to Cart button with a "FREE" text but that probably shouldn't change anything?

This is the Javascript code I've inserted into the site wide footer code injection as instructed by the Rating Widget website:

<script type="text/javascript">(function(d, t, e, m){
    
    // Async Rating-Widget initialization.
    window.RW_Async_Init = function(){
                
        RW.init({
            huid: "453808",
            uid: "8f1f467d9b5cc29128dfe57c5c13d115",
            source: "website",
            options: {
                "advanced": {
                    "font": {
                        "hover": {
                            "color": "#3C68BB"
                        },
                        "color": "#3C68BB"
                    }
                },
                "size": "medium",
                "label": {
                    "background": "#B6C3DB"
                },
                "style": "flat_yellow",
                "isDummy": false
            } 
        });
        RW.render();
    };
        // Append Rating-Widget JavaScript library.
    var rw, s = d.getElementsByTagName(e)[0], id = "rw-js",
        l = d.location, ck = "Y" + t.getFullYear() + 
        "M" + t.getMonth() + "D" + t.getDate(), p = l.protocol,
        f = ((l.search.indexOf("DBG=") > -1) ? "" : ".min"),
        a = ("https:" == p ? "secure." + m + "js/" : "js." + m);
    if (d.getElementById(id)) return;              
    rw = d.createElement(e);
    rw.id = id; rw.async = true; rw.type = "text/javascript";
    rw.src = p + "//" + a + "external" + f + ".js?ck=" + ck;
    s.parentNode.insertBefore(rw, s);
    }(document, new Date(), "script", "rating-widget.com/"));</script>

And this is the on-page code that I've inserted into a code block on the specific product page:

<div class="rw-ui-container"></div>

Thanks in advance! 🙂 

rating.jpg

Link to comment
  • Replies 0
  • Views 400
  • Created
  • Last Reply

Archived

This topic is now archived and is closed to further replies.


×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.