I'm having a helluva time implementing the product review feature from bundle 2772. I've followed the (scarce...) instructions and got everything plugged in, but no matter what I do to it, the code won't work and the browser keeps throwing up errors. I've made a very stripped-down version of my item template and the code is as follows.
Addition to the head:
<%=declareCurrentAttribute("item","custitem_productreviews1")%> <%=declareCurrentAttribute("item","custitem_productreviews2")%>Template:<!-- start products item drilldown template - Basic : Clean Lines --> <TD> <script language="JavaScript"> function showProductReviewPopup() { var productId = escape("<%=getCurrentAttribute('item', 'internalid')%>"); var formurl = "https://forms.netsuite.com/app/site/crm/externalcustrecordpage.nl?compid=999464&formid=2&h=b0cb9099a3a57a1e5f5a"; window.open(formurl + '&productId=' + productId, 'productReview', 'toolbar=0, status=1, menubar=0, location=0, scrollbars=1, resizable=1,width=600,height=400'); } function displayReviews() { var review1 = "<%=getCurrentAttribute("item","custitem_productreviews1")%>"; var review2 = "<%=getCurrentAttribute("item","custitem_productreviews2")%>"; return HtmlDecode(review1 + review2); } //--> </script> <script type="text/javascript" src="/site/js/HtmlDecodeStripped.js"></script> <img src="<%=getCurrentAttribute("item","storedisplayimage")%>" name="mainImage" id="mainImage" /> <h1><%=getCurrentAttribute('item','storeDisplayName')%></h1> <div id="reviews" style="clear:both;"> <span style="font-weight: bold; font-size: 120%;">Product Reviews</span> <br /><B>Score</B>: <%=getCurrentAttribute('item','custitem_review_average_rating','0')%> <br /> <br /> <a href="#" onclick="showProductReviewPopup()">Submit Your Review</a> <br /><br /> <div style="float: left; padding: 8px;" id="divReview"> <%=getCurrentAttribute('item','custitem_productreviews1')%> <script language="javascript">document.write(displayReviews());</script> </div> </div> </td>This causes three things to happen:[LIST=1][*]The most notable is that I get an error in Firefox saying that a string is unterminated. I looked into and found that it's where it defines var review 1. The quotes don't get closed, no matter what I do. (Side note. Why do I need to call the displayReviews function when I could just as easily call <%=getCurrentAttribute("item","custitm_productreviews1")%>?)[*](I'm assuming #1 causes this) It lists displayReviews as not defined[*]showProductReviewPopup is not defined as well (again, I'm assuming #1 causes this)[/LIST]So, what's the deal? Why do the variables (that NetSuite assigns, I might add) cause a JavaScript error? Has anybody else had this problem? Can anybody point me in the right direction to some coherent instructions?Any help would be much appreciated...