getjson - How to make an API call to get the reviews in bazaarvoice extension?reviews.phtml code is mentioned below -
<?php if ($this->getisenabled()):?> <?php $doshowcontentjs = mage::getstoreconfig('bazaarvoice/rr/do_show_content_js'); $seocontent = $this->getseocontent(); ?> <div id="bvrrcontainer"> <?php echo $seocontent ?> </div> <script type="text/javascript"> $bv.ui( 'rr', 'show_reviews', { doshowcontent : function () { <?php echo $doshowcontentjs ?> } }); </script> <?php endif; ?>
this answer here provides example of how retrieve reviews, i'll provide snippet:
$(document).ready(function(){ $.ajax({ url: "https://stg.api.bazaarvoice.com/data/reviews.json?apiversion=5.4&passkey=***enter passkey here***&filter=productid:***productid***", data: "json", success: function(data){ console.log(data); (i in data['results']){ var info = data['results'][i]; console.log(info.authorid + " || " + info.reviewtext); } } }) });
Comments
Post a Comment