Converting Reviews from Image to Numerical Values |
Post Reply |
Author | |||
Lindsay
Newbie Joined: 17-December-2008 Status: Offline Points: 17 |
Post Options
Thanks(0)
Posted: 09-July-2013 at 6:49pm |
||
Since ProductCart's latest release doesn't include structured data markup or the option to add metadata into product pages, I'm trying to use Google's Structured Data Markup Helper to add this information manually. It appears that Google's tool is not able to recognize and convert productcart's stars, empty stars, and half stars to a numerical value- so I'm looking for a way to display a numerical value/aggregate score next to (or even instead of) the stars that are just under the product title, on the main product page. Any suggestions? |
|||
Hamish
Admin Group Joined: 12-October-2006 Location: United Kingdom Status: Offline Points: 56 |
Post Options
Thanks(0)
|
||
In pc/prv_incfunctions.asp find the following two lines and uncomment the second one :-
' Uncomment the following line to show the text value (e.g. "3.5") ' response.write Rev_SaveRate |
|||
Lindsay
Newbie Joined: 17-December-2008 Status: Offline Points: 17 |
Post Options
Thanks(0)
|
||
Great- but is there a way to hide that number on listings in search results? |
|||
Guests
Guest |
Post Options
Thanks(0)
|
||
If you only want the numeric value to show on product pages, you could change
to
or perhaps this is a bit nicer display:
Edited by Sean@WMS - 10-September-2013 at 2:52pm |
|||
Lindsay
Newbie Joined: 17-December-2008 Status: Offline Points: 17 |
Post Options
Thanks(0)
|
||
PERFECT! Thank you Sean! |
|||
Guests
Guest |
Post Options
Thanks(0)
|
||
Hi Lindsay,
Well, maybe not so perfect after all. Knowing that you are working on structured data/schema.org markup (which I am too), my quick edit above is way too down and dirty for that, and now that I look at the full implications of it, rather unsightly -- The numeric value will display next to everywhere the icons are called (via the WriteStar subroutine), including on each individual review. That, I think, makes it unsightly. More to the point for structured data/schema.org markup, though, it's not practical: this sub can't be used to markup the aggregateRating properties, else they will recur over an over again. The better solution is to append some code to the end of the pcs_ShowRating subroutine in viewPrdCode.asp and/or on prv_increviews.asp and then again on prv_allreviews.asp. Here's a rough on what that code would look like, though I would abstract this out to a subroutine called in each of these instances. In each of these files, find something like:
(white space varies a bit in each file) Just after that, add:
My preference would be to add it on prv_increviews.asp (rather than viewPrdCode.asp -- so's not to have this twice on the product page AND so's not to clutter up the top of the product page data with it) and then again on prv_allreviews.asp Here's an example (WARNING: wear a hardhat -- work in progress) with this in all three locations: Hope this helps you out better. Meanwhile, lots of structured data stuff to do regarding the reviews themselves on both product pages and the "all reviews" page for a product (along with other SEO issues with the latter including duplicate title tag, duplicate meta description tag, bad canonical URL tag, etc. -- issues I've already solved if you are interested).
|
|||
Lindsay
Newbie Joined: 17-December-2008 Status: Offline Points: 17 |
Post Options
Thanks(0)
|
||
Thanks Sean for sharing that code, I will try inserting it later today and see if I can get it working for me. My understanding is simplistic, I'm sure, but I believe I have added all the necessary schema product markup via editing viewPrdCode.asp and prv_increviews.asp, though I'm still trying to work out a few errors that show when I use google's Structured Data Testing Tool I'm Interested in the fix for duplicate title tag, duplicate meta description tag with review pages, how much to purchase? I want to say EI already helped me with the canonical URLs issues, I'd have to check back in emails but I remember it was causing issues creating a sitemap and seems like we worked out a fix.. |
|||
Lindsay
Newbie Joined: 17-December-2008 Status: Offline Points: 17 |
Post Options
Thanks(0)
|
||
Just a note on the code above, when I play with it on a product with a large number of reviews, pcv_tmpRating no longer rounds to the second decimal point. In the case of one popular product, this displayed:
(4.82352941176471/5) based on 17 customer ratings
|
|||
Guests
Guest |
Post Options
Thanks(0)
|
||
Thanks, Lindsay.
I still haven't had the time to hash through exactly how PC is calculating/storing this value as it appears rather situational. I any event, the code block I suggested above can be tamed to one decimal place by replacing: <%=pcv_tmpRating%> with: <%=FormatNumber(pcv_tmpRating,1)%> Looks like there's logic elsewhere to have that come out to either N or N.5, mostly for rendering the graphic representation. Not sure how important (or even desirable) it is to have the numeric representation render the same way, though.
|
|||
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |