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

Popular posts from this blog

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

reactjs - React router and this.props.children - how to pass state to this.props.children -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -