2016-03-07 19 views
-2
<?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; ?> 
+0

由於格式不正確,您的代碼被隱藏。我爲你編輯。接受編輯。 – Raviteja

回答

0

This答案提供瞭如何檢索審查的例子reviews.phtml代碼被提及,但我會提供一個片段:

$(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); 
     for (i in data['Results']){ 
     var info = data['Results'][i]; 
     console.log(info.AuthorId + " || " + info.ReviewText); 
     } 
    } 
    }) 
}); 
+0

是否適用於特定產品。我們在此處不提供任何過濾器,那麼它如何獲取我們產品的詳細信息 – Haritha1315

+0

請查看API文檔。不過,我在URL中添加了一個過濾器參數。您只需指定產品ID即可。 –

+0

我已經看到了文檔,如果我傳遞下面的網址我無法獲得輸出。 URL:http://stg.api.bazaarvoice.com/data/reviews.json?apiversion = 5.4&include = products,authors&Filter = ProductId:C1&filter = isRatingsOnly:false&filter = DisplayLocale:en_US&passkey = ywwm6ry3sw5r4ak9j7f2x9ed&limit = 5 – Haritha1315

相關問題