Help with Product ID code for Third Party Review Service

For general questions and discussions specific to the AbleCommerce GOLD ASP.Net shopping cart software.
Post Reply
jill224
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 23
Joined: Sat Aug 22, 2009 3:19 pm
Location: Northaeast Pennsylvania

Help with Product ID code for Third Party Review Service

Post by jill224 » Fri Nov 25, 2016 1:11 pm

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!

nadeem
Captain (CAPT)
Captain (CAPT)
Posts: 258
Joined: Tue Jul 31, 2012 7:23 pm

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

Post by nadeem » Mon Nov 28, 2016 4:53 am

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.

kwikstand
Commodore (COMO)
Commodore (COMO)
Posts: 410
Joined: Mon Feb 19, 2007 8:12 pm
Contact:

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

Post by kwikstand » Sat Dec 09, 2017 11:21 am

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"?
Contractor's Solutions
www. contractors-solutions.net

User avatar
xplosi0n1
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 30
Joined: Mon Nov 30, 2009 10:54 am
Location: Dayton, OH
Contact:

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

Post by xplosi0n1 » Tue Dec 12, 2017 8:23 am

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

kwikstand
Commodore (COMO)
Commodore (COMO)
Posts: 410
Joined: Mon Feb 19, 2007 8:12 pm
Contact:

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

Post by kwikstand » Wed Dec 13, 2017 2:10 pm

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
Contractor's Solutions
www. contractors-solutions.net

kwikstand
Commodore (COMO)
Commodore (COMO)
Posts: 410
Joined: Mon Feb 19, 2007 8:12 pm
Contact:

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

Post by kwikstand » Sat Jan 06, 2018 7:20 am

Does anybody know the best way to implement the Product page Code?

Any help would be appreciated,

Scott
Contractor's Solutions
www. contractors-solutions.net

Post Reply