Adding customer reviews to product page (SEO Friendly)
The following code will include the full product review on the extended description page. This solution will be more SEO friendly compared to the other guide as search engine will be able to see the review directly from the source code.
Place the following code near line 556 of shopfileio.asp:
Case "ADD_REVIEWS"
Handle_Reviews value, parsearray, parseRS
rc=0
Then near line 1977 place this in shopfileio.asp:
Sub Handle_Reviews (value, parsearray, parseRS)
dim rs, rsql, strrating, conn, title, comment, name, rating, image
rsql=" SELECT * from reviews where catalogid=" & catalogid & " AND authorized IS NOT NULL ORDER BY reviewdate DESC"
If getconfig("xproductdb")<>"" then
shopopendatabase conn
set rs=conn.execute(rsql)
else
set rs=dbc.execute(rsql)
end if
if not rs.eof then
While Not rs.eof
comment=rs("comment")
title=Ucase(rs("title"))
name=rs("name")
rating=rs("rating")
Select case rating
Case "1"
image="vpasp_stars1.gif"
Case "2"
image="vpasp_stars2.gif"
Case "3"
image="vpasp_stars3.gif"
Case "4"
image="vpasp_stars4.gif"
Case "5"
image="vpasp_stars5.gif"
Case else
image=""
End select
response.write "<div class=reviews>"
response.write "<table width=530 border=0 cellspacing=0 cellpadding=0>"
response.write " <tr>"
response.write " <td width=125 valign=top rowspan=2><img src=\images\misc\" & image & "></td>"
response.write " <td width=391 valign=top style=padding-right:28px;><strong>" & title & "</strong></td>"
response.write " </tr>"
response.write " <tr>"
response.write " <td width=391 valign=top style=padding-right:28px;><i>" & name & ": </i>" & comment & ""
response.write " </td>"
response.write " </tr>"
response.write "</table>"
response.write " </div>"
rs.MoveNext
Wend
end if
end sub
The final step is to add [ADD_REVIEWS] to your template file (tmp_product.htm). Credit goes to Dutch_guy who provided this helpful code on our forum
http://www.vpasp.com/virtprog/vpaspforum/topic.asp?TOPIC_ID=3532
Times Viewed:
1576 |
Added By:
Frank |
Date Created:
8/4/2009 |
Last Updated:
8/4/2009 |
|