Page 1 of 1

Help with Product ID code for Third Party Review Service

Posted: Fri Nov 25, 2016 1:11 pm
by jill224
We recently signed up to collect product reviews with a third party service called Shopper Approved that syndicates the reviews in our Google Shopping listing. We need to insert some javascript code on the Receipt page to ensure that the product ids that are purchased are being passed on for them to collect reviews and then match up the product ids with those in our Google Feed.

Below is the "demo code" they have provided that needs to be modified. I was wondering if anyone could help me out with the variables that should be used that would be able to identify and pass on the same product ids and product descriptions that are being used the the Google product feed for each product purchased in the order? Also, what other type of backend work would need to be done for this code to function properly?

Code: Select all

<script type="text/javascript">
/* Include all products in the object below 'product id':'Product Name' */
var sa_products = { 'productid1':'Product Description One', 'productid2':'Product Description Two', 'productid3':'Product Description Three' };
</script>

Any help or pointers is much appreciated. Thanks!

Re: Help with Product ID code for Third Party Review Service

Posted: Mon Nov 28, 2016 4:53 am
by nadeem
Create a new control to use for the purpose on receipt page and add the script something like:

Code: Select all

<script runat="server">
    int ProductId { get; set; }
    string ProductName { get; set;}
    string ProductIdWithName { get; set; }
    List<string> productList = new List<string>();
    protected void Page_PreRender(object sender, EventArgs e)
    {
        CommerceBuilder.Orders.Order order = OrderDataSource.Load(AbleCommerce.Code.PageHelper.GetOrderId());
        if (order != null)
        {
            foreach(OrderItem oi in order.Items)
            {
                if (oi != null && oi.OrderItemType == OrderItemType.Product)
                {
                    ProductId = oi.ProductId;
                    ProductName = oi.Product.Name;
                    productList.Add(string.Format("'{0}':'{1}'", ProductId, ProductName));
                }
            }
            ProductIdWithName = string.Join(",", productList.ToArray());
        }
    }
</script>
<script type="text/javascript">
/* Include all products in the object below 'product id':'Product Name' */
    var sa_products = { <%=ProductIdWithName%> }; //{ 'productid1':'Product Description One', 'productid2':'Product Description Two', 'productid3':'Product Description Three' };
</script>
The above code isn't tested and may not work 100% but at least it will give you an idea of how to proceed with this. Hope this helps. Thanks.

Re: Help with Product ID code for Third Party Review Service

Posted: Sat Dec 09, 2017 11:21 am
by kwikstand
How does that Shopper Approved work? I am thinking about using it myself. Is it difficult to integrate with Able? Are you using it for simple "Merchant Reviews" or "Product Reviews"?

Re: Help with Product ID code for Third Party Review Service

Posted: Tue Dec 12, 2017 8:23 am
by xplosi0n1
We have been using it for 6 years now.

It is easy to integrate, just add a snippet of code to the bottom of the receipt.aspx page to start collecting reviews. You can add the widgets they supply to display your review counts, reviews and badges on your site.
I think its easy. Once integrated Google will start to show your review rating on their searches, after about 50 reviews.

You can check out the pricing here - http://www.shopperapproved.com/19227

Let me know if you have any further questions, I would love to help.

Mike

Re: Help with Product ID code for Third Party Review Service

Posted: Wed Dec 13, 2017 2:10 pm
by kwikstand
Are you using product reviews, or just merchant reviews? I think the product reviews are a bit more to integrate. Have you seen better organic search rankings from it?

Thanks,

Scott

Re: Help with Product ID code for Third Party Review Service

Posted: Sat Jan 06, 2018 7:20 am
by kwikstand
Does anybody know the best way to implement the Product page Code?

Any help would be appreciated,

Scott