BigCommerce Seller Ratings Integration Guide

BigCommerce Seller Ratings Integration Guide Get Started Collecting Seller Ratings - Automated 

I. In the BigCommerce dashboard, click on Storefront --> Themes to get started

II. On the themes page, Click on Advanced --> Edit Theme Files

III. Inside of the theme editor click on templates --> pages --> order-confirmation.html

IV. Place the following script near the bottom of this file. Click Save. Remember to replace YOUR_SELLER_ID with your unique SellerID.


<script>
var _rrPR = {
seller_id: XXXXXX,
auto: false,
invoice:{{checkout.order.id}}
};
fetch('/api/storefront/order/{{checkout.order.id}}', {
credentials: 'include'
}).then(function (response) {
return response.json();
}).then(function (myJson) {
if(myJson.lineItems && myJson.orderId)
{
skus = [];
var RR_phys_items = myJson.lineItems.physicalItems;
for(var phys_inc = 0; phys_inc < RR_phys_items.length; phys_inc++)
{
skus.push(RR_phys_items[phys_inc].sku);
}
var RR_dig_items = myJson.lineItems.digitalItems;
for(var dig_inc = 0; dig_inc < RR_dig_items.length; dig_inc++)
{
skus.push(RR_dig_items[dig_inc].sku);
}
_rrPR.sku = skus;
_rrPR.email = myJson.billingAddress.email;
(function() {
var s=document.createElement('script');s.type='text/javascript';
s.async=true;
s.src="https://www.resellerratings.com/popup/include/load.js";
var ss=document.getElementsByTagName('script')[0];
ss.parentNode.insertBefore(s,ss);
})();
}
});

 


IIII. Click Save

Did this answer your question?