Last active
August 29, 2015 14:14
-
-
Save matt-bailey/e19cfb4729e73bc2acdd to your computer and use it in GitHub Desktop.
Magento & Nosto: How to add Star Ratings to Nosto recommendation templates
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- | |
/** | |
* Add this markup to the recommendation template in your Nosto control panel | |
*/ | |
--> | |
<div class="ratings-wrapper"> | |
<div class="ratings"> | |
<div class="rating-box"> | |
<div class="rating" style="width:$!product.tags1.get(0)%"></div> | |
</div> | |
</div> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- | |
/** | |
* Copy `/app/design/frontend/base/default/template/nostotagging/product.phtml` | |
* into the same location in your own theme to override the original file. | |
* | |
* Add the custom mapping section below to the end of the `nosto_product` div. | |
*/ | |
--> | |
<div class="nosto_product" style="display:none"> | |
<!-- Existing Nosto tags should be here... --> | |
<!-- Custom mapping --> | |
<span class="tag1"><?php | |
// Get star rating | |
$storeId = Mage::app()->getStore()->getId(); | |
$summaryData = Mage::getModel('review/review_summary')->setStoreId($storeId)->load($product->getId()); | |
if ($summaryData['rating_summary']): | |
echo $summaryData['rating_summary']; | |
endif; | |
?></span> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment