Version Notes
All Reviews allows you to display all reviews of your products on a single CMS page. Customers searching Google, Bing, Yahoo for "YOUR STORE Reviews" will be able to find a page controlled by you with recent reviews of your products.
Download this release
Release Info
| Developer | EKO Internet Marketing |
| Extension | All_Reviews |
| Version | 1.0.0 |
| Comparing to | |
| See all releases | |
Version 1.0.0
- app/code/community/EkoInternetMarketing/AllReviews/Block/AllReviews.php +132 -0
- app/code/community/EkoInternetMarketing/AllReviews/Helper/Data.php +6 -0
- app/code/community/EkoInternetMarketing/AllReviews/etc/adminhtml.xml +24 -0
- app/code/community/EkoInternetMarketing/AllReviews/etc/config.xml +51 -0
- app/code/community/EkoInternetMarketing/AllReviews/etc/system.xml +131 -0
- app/design/frontend/base/default/layout/allreviews.xml +19 -0
- app/design/frontend/base/default/template/allreviews/.DS_Store +0 -0
- app/design/frontend/base/default/template/allreviews/reviews.bak.phtml +53 -0
- app/design/frontend/base/default/template/allreviews/reviews.phtml +78 -0
- app/etc/modules/EkoInternetMarketing_AllReviews.xml +8 -0
- package.xml +18 -0
- skin/frontend/base/default/ekoim/allreviews/5-stars-empty.png +0 -0
- skin/frontend/base/default/ekoim/allreviews/5-stars-full.png +0 -0
- skin/frontend/base/default/ekoim/allreviews/allreviews.css +33 -0
app/code/community/EkoInternetMarketing/AllReviews/Block/AllReviews.php
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
class EkoInternetMarketing_AllReviews_Block_AllReviews extends Mage_Core_Block_Template
|
| 3 |
+
{
|
| 4 |
+
|
| 5 |
+
public function getReviews($numberOfReviews){
|
| 6 |
+
|
| 7 |
+
$_reviews = Mage::getModel('review/review')
|
| 8 |
+
->getResourceCollection()
|
| 9 |
+
->addStoreFilter(Mage::app()->getStore()->getId())
|
| 10 |
+
->addStatusFilter(Mage_Review_Model_Review::STATUS_APPROVED)
|
| 11 |
+
->setDateOrder('desc')
|
| 12 |
+
->setPageSize($numberOfReviews)
|
| 13 |
+
->addRateVotes();
|
| 14 |
+
|
| 15 |
+
return $_reviews;
|
| 16 |
+
}
|
| 17 |
+
|
| 18 |
+
public function getProductDetails(){
|
| 19 |
+
|
| 20 |
+
|
| 21 |
+
|
| 22 |
+
}
|
| 23 |
+
|
| 24 |
+
public function getAllReviews(){
|
| 25 |
+
|
| 26 |
+
// Get the number of reviews to display
|
| 27 |
+
$numberOfReviews = Mage::getStoreConfig('ekoim/allreviews/number_of_reviews');
|
| 28 |
+
|
| 29 |
+
// Get the reviews
|
| 30 |
+
$_reviews = $this->getReviews($numberOfReviews);
|
| 31 |
+
|
| 32 |
+
// Get the settings
|
| 33 |
+
$enable_product_image = Mage::getStoreConfig('ekoim/allreviews/enable_product_image');
|
| 34 |
+
$enable_totals = Mage::getStoreConfig('ekoim/allreviews/enable_totals');
|
| 35 |
+
|
| 36 |
+
$data['settings']['number_of_columns'] = Mage::getStoreConfig('ekoim/allreviews/number_of_columns');
|
| 37 |
+
$data['settings']['enable_review_nickname'] = Mage::getStoreConfig('ekoim/allreviews/enable_review_nickname');
|
| 38 |
+
$data['settings']['enable_review_title'] = Mage::getStoreConfig('ekoim/allreviews/enable_review_title');
|
| 39 |
+
$data['settings']['enable_review_date'] = Mage::getStoreConfig('ekoim/allreviews/enable_review_date');
|
| 40 |
+
$data['settings']['enable_review_stars'] = Mage::getStoreConfig('ekoim/allreviews/enable_review_stars');
|
| 41 |
+
$data['settings']['enable_totals'] = Mage::getStoreConfig('ekoim/allreviews/enable_totals');
|
| 42 |
+
$data['settings']['enable_rich_snippet'] = Mage::getStoreConfig('ekoim/allreviews/enable_rich_snippet');
|
| 43 |
+
$data['settings']['enable_module_credit'] = Mage::getStoreConfig('ekoim/allreviews/enable_module_credit');
|
| 44 |
+
|
| 45 |
+
if($enable_totals == "1"):
|
| 46 |
+
$data['totals'] = $this->getTotalReviews();
|
| 47 |
+
endif;
|
| 48 |
+
|
| 49 |
+
$i=0;
|
| 50 |
+
foreach($_reviews as $review):
|
| 51 |
+
|
| 52 |
+
$data['reviews'][$i]['review_title'] = $review->getTitle();
|
| 53 |
+
$data['reviews'][$i]['review_nickname'] = $review->getNickname();
|
| 54 |
+
$data['reviews'][$i]['review_created_at'] = $this->formatCreatedDate($review->getCreatedAt(), "m/d/Y");
|
| 55 |
+
$data['reviews'][$i]['review_detail'] = $review->getDetail();
|
| 56 |
+
$data['reviews'][$i]['review_percentage'] = $this->getReviewFinalPercentage($review->getRatingVotes());
|
| 57 |
+
|
| 58 |
+
if($enable_product_image == "1"):
|
| 59 |
+
|
| 60 |
+
$_product = Mage::getModel('catalog/product')->load($review->getData('entity_pk_value'));
|
| 61 |
+
|
| 62 |
+
$data['reviews'][$i]['product_image'] = '<a href="'.$_product->getProductUrl().'" title="'.$this->stripTags($this->getImageLabel($_product, 'small_image'), null, true).'" class="product-image"><img src="'.$this->helper('catalog/image')->init($_product, 'small_image')->resize(80).'" width="80" height="80" alt="'.$this->stripTags($this->getImageLabel($_product, 'small_image'), null, true).'" /></a>';
|
| 63 |
+
|
| 64 |
+
endif;
|
| 65 |
+
|
| 66 |
+
|
| 67 |
+
$i++;
|
| 68 |
+
endforeach;
|
| 69 |
+
|
| 70 |
+
return $data;
|
| 71 |
+
}
|
| 72 |
+
|
| 73 |
+
public function formatCreatedDate($date, $format){
|
| 74 |
+
|
| 75 |
+
$date = strtotime($date);
|
| 76 |
+
$reviewDate = date($format, $date);
|
| 77 |
+
|
| 78 |
+
return $reviewDate;
|
| 79 |
+
}
|
| 80 |
+
|
| 81 |
+
public function getReviewFinalPercentage($votes){
|
| 82 |
+
|
| 83 |
+
$cumulativeRating = 0;
|
| 84 |
+
$j=0;
|
| 85 |
+
foreach( $votes as $vote ) {
|
| 86 |
+
$cumulativeRating +=$vote->getPercent();
|
| 87 |
+
$j++;
|
| 88 |
+
}
|
| 89 |
+
|
| 90 |
+
$finalPercentage = 0;
|
| 91 |
+
if ($cumulativeRating != 0){
|
| 92 |
+
$finalPercentage = ($cumulativeRating/$j);
|
| 93 |
+
}
|
| 94 |
+
|
| 95 |
+
return $finalPercentage;
|
| 96 |
+
}
|
| 97 |
+
|
| 98 |
+
public function getModuleCredit(){
|
| 99 |
+
|
| 100 |
+
$showModuleCreditValue = Mage::getStoreConfig('ekoim/allreviews/show_module_credit');
|
| 101 |
+
|
| 102 |
+
$credit = 'Magento Module By <a href="http://www.ekoim.com">EKO Internet Marketing</a>';
|
| 103 |
+
|
| 104 |
+
if($showModuleCreditValue == "0"):
|
| 105 |
+
$credit = '<a href="http://www.ekoim.com" style="display: none;">EKO Internet Marketing</a>';
|
| 106 |
+
endif;
|
| 107 |
+
|
| 108 |
+
return $credit;
|
| 109 |
+
}
|
| 110 |
+
|
| 111 |
+
public function getTotalReviews(){
|
| 112 |
+
|
| 113 |
+
$_reviews = $this->getReviews();
|
| 114 |
+
|
| 115 |
+
$i=0;
|
| 116 |
+
$cumulativePercentage = 0;
|
| 117 |
+
foreach($_reviews as $review):
|
| 118 |
+
|
| 119 |
+
$cumulativePercentage = $cumulativePercentage + $this->getReviewFinalPercentage($review->getRatingVotes());
|
| 120 |
+
|
| 121 |
+
$i++;
|
| 122 |
+
endforeach;
|
| 123 |
+
|
| 124 |
+
$totalReviewRating['total_reviews'] = $i;
|
| 125 |
+
$totalReviewRating['total_percentage'] = ceil($cumulativePercentage / $i);
|
| 126 |
+
$totalReviewRating['total_of_five'] = round($totalReviewRating['total_percentage'] / 100 * 5, 2);
|
| 127 |
+
|
| 128 |
+
return $totalReviewRating;
|
| 129 |
+
}
|
| 130 |
+
|
| 131 |
+
}
|
| 132 |
+
?>
|
app/code/community/EkoInternetMarketing/AllReviews/Helper/Data.php
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
class EkoInternetMarketing_AllReviews_Helper_Data extends Mage_Core_Helper_Abstract
|
| 4 |
+
{
|
| 5 |
+
|
| 6 |
+
}
|
app/code/community/EkoInternetMarketing/AllReviews/etc/adminhtml.xml
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<adminhtml>
|
| 2 |
+
<acl>
|
| 3 |
+
<resources>
|
| 4 |
+
<all>
|
| 5 |
+
<title>Allow Everything</title>
|
| 6 |
+
</all>
|
| 7 |
+
<admin>
|
| 8 |
+
<children>
|
| 9 |
+
<system>
|
| 10 |
+
<children>
|
| 11 |
+
<config>
|
| 12 |
+
<children>
|
| 13 |
+
<ekoim>
|
| 14 |
+
<title>EKO Internet Marketing - All</title>
|
| 15 |
+
</ekoim>
|
| 16 |
+
</children>
|
| 17 |
+
</config>
|
| 18 |
+
</children>
|
| 19 |
+
</system>
|
| 20 |
+
</children>
|
| 21 |
+
</admin>
|
| 22 |
+
</resources>
|
| 23 |
+
</acl>
|
| 24 |
+
</adminhtml>
|
app/code/community/EkoInternetMarketing/AllReviews/etc/config.xml
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0"?>
|
| 2 |
+
<config>
|
| 3 |
+
<global>
|
| 4 |
+
<modules>
|
| 5 |
+
<EkoInternetMarketing_AllReviews>
|
| 6 |
+
<version>1.0.0</version>
|
| 7 |
+
</EkoInternetMarketing_AllReviews>
|
| 8 |
+
</modules>
|
| 9 |
+
<blocks>
|
| 10 |
+
<allreviews>
|
| 11 |
+
<rewrite>
|
| 12 |
+
<allreviews>EkoInternetMarketing_AllReviews_Block_AllReviews</allreviews>
|
| 13 |
+
</rewrite>
|
| 14 |
+
</allreviews>
|
| 15 |
+
</blocks>
|
| 16 |
+
</global>
|
| 17 |
+
<frontend>
|
| 18 |
+
<routers>
|
| 19 |
+
<allreviews>
|
| 20 |
+
<use>standard</use>
|
| 21 |
+
<args>
|
| 22 |
+
<module>EkoInternetMarketing_AllReviews</module>
|
| 23 |
+
<frontName>allreviews</frontName>
|
| 24 |
+
</args>
|
| 25 |
+
</allreviews>
|
| 26 |
+
</routers>
|
| 27 |
+
<layout>
|
| 28 |
+
<updates>
|
| 29 |
+
<allreviews>
|
| 30 |
+
<file>allreviews.xml</file>
|
| 31 |
+
</allreviews>
|
| 32 |
+
</updates>
|
| 33 |
+
</layout>
|
| 34 |
+
</frontend>
|
| 35 |
+
<default>
|
| 36 |
+
<ekoim>
|
| 37 |
+
<allreviews>
|
| 38 |
+
<number_of_reviews>10</number_of_reviews>
|
| 39 |
+
<number_of_columns>2</number_of_columns>
|
| 40 |
+
<enable_totals>1</enable_totals>
|
| 41 |
+
<enable_rich_snippet>1</enable_rich_snippet>
|
| 42 |
+
<enable_review_nickname>1</enable_review_nickname>
|
| 43 |
+
<enable_review_date>1</enable_review_date>
|
| 44 |
+
<enable_review_title>1</enable_review_title>
|
| 45 |
+
<enable_product_image>1</enable_product_image>
|
| 46 |
+
<enable_module_credit>1</enable_module_credit>
|
| 47 |
+
<enable_review_stars>1</enable_review_stars>
|
| 48 |
+
</allreviews>
|
| 49 |
+
</ekoim>
|
| 50 |
+
</default>
|
| 51 |
+
</config>
|
app/code/community/EkoInternetMarketing/AllReviews/etc/system.xml
ADDED
|
@@ -0,0 +1,131 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0"?>
|
| 2 |
+
<config>
|
| 3 |
+
<tabs>
|
| 4 |
+
<ekoim translate="label">
|
| 5 |
+
<label>Eko Internet Marketing</label>
|
| 6 |
+
<sort_order>150</sort_order>
|
| 7 |
+
</ekoim>
|
| 8 |
+
</tabs>
|
| 9 |
+
<sections>
|
| 10 |
+
<ekoim translate="label">
|
| 11 |
+
<label>All Reviews</label>
|
| 12 |
+
<tab>ekoim</tab>
|
| 13 |
+
<sort_order>10</sort_order>
|
| 14 |
+
<show_in_default>1</show_in_default>
|
| 15 |
+
<show_in_website>1</show_in_website>
|
| 16 |
+
<show_in_store>1</show_in_store>
|
| 17 |
+
<groups>
|
| 18 |
+
<allreviews translate="label comment">
|
| 19 |
+
<label>General</label>
|
| 20 |
+
<sort_order>50</sort_order>
|
| 21 |
+
<show_in_default>1</show_in_default>
|
| 22 |
+
<show_in_website>1</show_in_website>
|
| 23 |
+
<show_in_store>1</show_in_store>
|
| 24 |
+
<comment><![CDATA[<p><strong>To use this module, create a CMS page and paste the following snippet into the content area:</strong></p><p>{{block type="allreviews/allreviews" name="all_reviews" template="allreviews/reviews.phtml"}}<br /> </p><p><strong>Interested in increasing traffic to your store?</strong> That's what we specialize in. Visit us at <a href="http://www.ekoim.com/?utm_source=Magento%2BModule&utm_medium=module&utm_campaign=All%2BReviews" target="_blank">http://www.ekoim.com</a> for more information on how we can help you grow your business.<br /> </p> ]]></comment>
|
| 25 |
+
<fields>
|
| 26 |
+
<number_of_reviews translate="label comment">
|
| 27 |
+
<label>Number of Reviews</label>
|
| 28 |
+
<comment>The total number of reviews you want to show. Default is 10.</comment>
|
| 29 |
+
<validate>validate-number</validate>
|
| 30 |
+
<frontend_type>text</frontend_type>
|
| 31 |
+
<sort_order>10</sort_order>
|
| 32 |
+
<show_in_default>1</show_in_default>
|
| 33 |
+
<show_in_website>1</show_in_website>
|
| 34 |
+
<show_in_store>1</show_in_store>
|
| 35 |
+
</number_of_reviews>
|
| 36 |
+
<number_of_columns translate="label comment">
|
| 37 |
+
<label>Number of Columns</label>
|
| 38 |
+
<comment>The number of columns you want to show</comment>
|
| 39 |
+
<validate>validate-number</validate>
|
| 40 |
+
<frontend_type>text</frontend_type>
|
| 41 |
+
<sort_order>10</sort_order>
|
| 42 |
+
<show_in_default>1</show_in_default>
|
| 43 |
+
<show_in_website>1</show_in_website>
|
| 44 |
+
<show_in_store>1</show_in_store>
|
| 45 |
+
</number_of_columns>
|
| 46 |
+
<enable_totals translate="label comment">
|
| 47 |
+
<label>Display Total Reviews with Stars</label>
|
| 48 |
+
<comment>Show the total ratings with stars</comment>
|
| 49 |
+
<frontend_type>select</frontend_type>
|
| 50 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
| 51 |
+
<sort_order>20</sort_order>
|
| 52 |
+
<show_in_default>1</show_in_default>
|
| 53 |
+
<show_in_website>1</show_in_website>
|
| 54 |
+
<show_in_store>0</show_in_store>
|
| 55 |
+
</enable_totals>
|
| 56 |
+
<enable_review_stars translate="label comment">
|
| 57 |
+
<label>Display Stars</label>
|
| 58 |
+
<comment>Show the star ratings for each review?</comment>
|
| 59 |
+
<frontend_type>select</frontend_type>
|
| 60 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
| 61 |
+
<sort_order>20</sort_order>
|
| 62 |
+
<show_in_default>1</show_in_default>
|
| 63 |
+
<show_in_website>1</show_in_website>
|
| 64 |
+
<show_in_store>0</show_in_store>
|
| 65 |
+
</enable_review_stars>
|
| 66 |
+
<enable_review_date translate="label comment">
|
| 67 |
+
<label>Display Review Date</label>
|
| 68 |
+
<comment>Show the date of the review?</comment>
|
| 69 |
+
<frontend_type>select</frontend_type>
|
| 70 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
| 71 |
+
<sort_order>20</sort_order>
|
| 72 |
+
<show_in_default>1</show_in_default>
|
| 73 |
+
<show_in_website>1</show_in_website>
|
| 74 |
+
<show_in_store>0</show_in_store>
|
| 75 |
+
</enable_review_date>
|
| 76 |
+
<enable_review_title translate="label comment">
|
| 77 |
+
<label>Display Review Title</label>
|
| 78 |
+
<comment>Show the title of the review</comment>
|
| 79 |
+
<frontend_type>select</frontend_type>
|
| 80 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
| 81 |
+
<sort_order>20</sort_order>
|
| 82 |
+
<show_in_default>1</show_in_default>
|
| 83 |
+
<show_in_website>1</show_in_website>
|
| 84 |
+
<show_in_store>0</show_in_store>
|
| 85 |
+
</enable_review_title>
|
| 86 |
+
<enable_review_nickname translate="label comment">
|
| 87 |
+
<label>Display Reviewer Username</label>
|
| 88 |
+
<comment>Show the username of the reviewer</comment>
|
| 89 |
+
<frontend_type>select</frontend_type>
|
| 90 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
| 91 |
+
<sort_order>20</sort_order>
|
| 92 |
+
<show_in_default>1</show_in_default>
|
| 93 |
+
<show_in_website>1</show_in_website>
|
| 94 |
+
<show_in_store>0</show_in_store>
|
| 95 |
+
</enable_review_nickname>
|
| 96 |
+
<enable_product_image translate="label comment">
|
| 97 |
+
<label>Display Product Image</label>
|
| 98 |
+
<comment>Show the product image?</comment>
|
| 99 |
+
<frontend_type>select</frontend_type>
|
| 100 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
| 101 |
+
<sort_order>20</sort_order>
|
| 102 |
+
<show_in_default>1</show_in_default>
|
| 103 |
+
<show_in_website>1</show_in_website>
|
| 104 |
+
<show_in_store>0</show_in_store>
|
| 105 |
+
</enable_product_image>
|
| 106 |
+
<enable_rich_snippet translate="label comment">
|
| 107 |
+
<label>Enable Rich Snippet?</label>
|
| 108 |
+
<comment>Enable the rich snippet to show star ratings in Google Organic search results</comment>
|
| 109 |
+
<frontend_type>select</frontend_type>
|
| 110 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
| 111 |
+
<sort_order>60</sort_order>
|
| 112 |
+
<show_in_default>1</show_in_default>
|
| 113 |
+
<show_in_website>1</show_in_website>
|
| 114 |
+
<show_in_store>0</show_in_store>
|
| 115 |
+
</enable_rich_snippet>
|
| 116 |
+
<enable_module_credit translate="label comment">
|
| 117 |
+
<label>Enable Module Credit Link?</label>
|
| 118 |
+
<comment>Enable the link back to the module creator's website</comment>
|
| 119 |
+
<frontend_type>select</frontend_type>
|
| 120 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
| 121 |
+
<sort_order>60</sort_order>
|
| 122 |
+
<show_in_default>1</show_in_default>
|
| 123 |
+
<show_in_website>1</show_in_website>
|
| 124 |
+
<show_in_store>0</show_in_store>
|
| 125 |
+
</enable_module_credit>
|
| 126 |
+
</fields>
|
| 127 |
+
</allreviews>
|
| 128 |
+
</groups>
|
| 129 |
+
</ekoim>
|
| 130 |
+
</sections>
|
| 131 |
+
</config>
|
app/design/frontend/base/default/layout/allreviews.xml
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0"?>
|
| 2 |
+
|
| 3 |
+
<layout version="0.1.0">
|
| 4 |
+
<default>
|
| 5 |
+
<reference name="head">
|
| 6 |
+
<action method="addItem"><type>skin_css</type><name>ekoim/allreviews/allreviews.css</name><params/></action>
|
| 7 |
+
</reference>
|
| 8 |
+
</default>
|
| 9 |
+
|
| 10 |
+
<allreviews_index_index>
|
| 11 |
+
<reference name="root">
|
| 12 |
+
<action method="setTemplate"><template>page/1column.phtml</template></action>
|
| 13 |
+
</reference>
|
| 14 |
+
<reference name="content">
|
| 15 |
+
<block type="allreviews/allreviews" name="all_reviews" template="allreviews/reviews.phtml"/>
|
| 16 |
+
</reference>
|
| 17 |
+
</allreviews_index_index>
|
| 18 |
+
|
| 19 |
+
</layout>
|
app/design/frontend/base/default/template/allreviews/.DS_Store
ADDED
|
Binary file
|
app/design/frontend/base/default/template/allreviews/reviews.bak.phtml
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
$_reviews = $this->getAllReviews();
|
| 3 |
+
|
| 4 |
+
$i=0;
|
| 5 |
+
foreach($_reviews as $review):
|
| 6 |
+
|
| 7 |
+
$datetime = strtotime($review->getCreatedAt());
|
| 8 |
+
$reviewDate = date("m/d/y", $datetime);
|
| 9 |
+
|
| 10 |
+
$_product = Mage::getModel('catalog/product')->load($review->getData('entity_pk_value'));
|
| 11 |
+
|
| 12 |
+
$cumulativeRating = 0;
|
| 13 |
+
$j=0;
|
| 14 |
+
foreach( $review->getRatingVotes() as $vote ) {
|
| 15 |
+
$cumulativeRating +=$vote->getPercent();
|
| 16 |
+
$j++;
|
| 17 |
+
}
|
| 18 |
+
|
| 19 |
+
$finalPercentage = 0;
|
| 20 |
+
if ($cumulativeRating != 0){
|
| 21 |
+
$finalPercentage = ($cumulativeRating/$j);
|
| 22 |
+
}
|
| 23 |
+
|
| 24 |
+
|
| 25 |
+
?>
|
| 26 |
+
|
| 27 |
+
<div class="grid_12 alpha">
|
| 28 |
+
<div class="individual-review">
|
| 29 |
+
<div class="individual-review even">
|
| 30 |
+
<div class="review-heading">
|
| 31 |
+
<div class="rating-box">
|
| 32 |
+
<div style="width:<?php echo ceil($finalPercentage); ?>%;" class="rating"></div>
|
| 33 |
+
</div>
|
| 34 |
+
|
| 35 |
+
<strong><?php echo $review->getTitle(); ?></strong> by <em><?php echo $review->getNickname(); ?></em><small class="date"> on <?php echo $reviewDate?></small><br>
|
| 36 |
+
|
| 37 |
+
</div>
|
| 38 |
+
<div class="review-body">
|
| 39 |
+
|
| 40 |
+
<a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" class="product-image"><img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(80); ?>" width="80" height="80" alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" /></a>
|
| 41 |
+
|
| 42 |
+
<p><?php echo $review->getDetail(); ?></p>
|
| 43 |
+
|
| 44 |
+
<p><?php #echo $cumulativeRating; ?></p>
|
| 45 |
+
|
| 46 |
+
</div>
|
| 47 |
+
</div>
|
| 48 |
+
</div>
|
| 49 |
+
</div>
|
| 50 |
+
|
| 51 |
+
<?php endforeach; ?>
|
| 52 |
+
|
| 53 |
+
<div><?php echo $this->getModuleCredit(); ?></div>
|
app/design/frontend/base/default/template/allreviews/reviews.phtml
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
<?php $_reviews = $this->getAllReviews(); ?>
|
| 3 |
+
<?php $numberOfColumns = $_reviews['settings']['number_of_columns']; ?>
|
| 4 |
+
<?php $columnWidthPercentage = round(100 / $numberOfColumns )?>
|
| 5 |
+
<?php $i=0; ?>
|
| 6 |
+
|
| 7 |
+
<div id="all-reviews">
|
| 8 |
+
|
| 9 |
+
<?php if($_reviews['settings']['enable_totals'] == "1"):?>
|
| 10 |
+
<div class="all-reviews-summary">
|
| 11 |
+
<div class="all-reviews-stars">
|
| 12 |
+
<span style="width: <?php echo $_reviews['totals']['total_percentage']; ?>%"></span>
|
| 13 |
+
</div>
|
| 14 |
+
<div class="all-reviews-summary-text">
|
| 15 |
+
<p>Rated <?php echo $_reviews['totals']['total_of_five']; ?> out of 5 stars. Based on <?php echo $_reviews['totals']['total_reviews']; ?> Reviews</p>
|
| 16 |
+
</div>
|
| 17 |
+
</div>
|
| 18 |
+
<?php endif; ?>
|
| 19 |
+
|
| 20 |
+
<table width="100%" id="all-reviews-table" cellspacing="10">
|
| 21 |
+
<?php foreach($_reviews['reviews'] as $review):?>
|
| 22 |
+
|
| 23 |
+
<?php if($i % $numberOfColumns == 0):?>
|
| 24 |
+
<tr>
|
| 25 |
+
<?php endif; ?>
|
| 26 |
+
|
| 27 |
+
<td width="<?php echo $columnWidthPercentage; ?>%" class="<?php if($i % $numberOfColumns == 0):?>first<?php endif; ?> <?php if($i+1 % $numberOfColumns == 0):?>last<?php endif; ?>">
|
| 28 |
+
<div class="review-heading">
|
| 29 |
+
|
| 30 |
+
<?php if($_reviews['settings']['enable_review_stars'] == "1"):?>
|
| 31 |
+
<div class="rating-box">
|
| 32 |
+
<div style="width:<?php echo ceil($review['review_percentage']); ?>%;" class="rating"></div>
|
| 33 |
+
</div>
|
| 34 |
+
<?php endif; ?>
|
| 35 |
+
|
| 36 |
+
<?php if($_reviews['settings']['enable_review_title'] == "1"):?>
|
| 37 |
+
<strong><?php echo $review['review_title'] ?></strong>
|
| 38 |
+
<?php endif; ?>
|
| 39 |
+
|
| 40 |
+
<?php if($_reviews['settings']['enable_review_nickname'] == "1"):?>
|
| 41 |
+
by <em><?php echo $review['review_nickname'] ?></em>
|
| 42 |
+
<?php endif; ?>
|
| 43 |
+
|
| 44 |
+
<?php if($_reviews['settings']['enable_review_date'] == "1"):?>
|
| 45 |
+
<small class="date"> on <?php echo $review['review_created_at'] ?></small>
|
| 46 |
+
<?php endif; ?>
|
| 47 |
+
|
| 48 |
+
</div>
|
| 49 |
+
|
| 50 |
+
<div class="review-body">
|
| 51 |
+
|
| 52 |
+
<?php if($review['product_image']):?>
|
| 53 |
+
<?php echo $review['product_image'] ?>
|
| 54 |
+
<?php endif; ?>
|
| 55 |
+
|
| 56 |
+
<p><?php echo $review['review_detail'] ?></p>
|
| 57 |
+
|
| 58 |
+
<?php if($review['product_image']):?>
|
| 59 |
+
<div class="clear"></div>
|
| 60 |
+
<?php endif; ?>
|
| 61 |
+
|
| 62 |
+
</div>
|
| 63 |
+
|
| 64 |
+
</td>
|
| 65 |
+
|
| 66 |
+
<?php if($i+1 % $numberOfColumns == 0):?>
|
| 67 |
+
</tr>
|
| 68 |
+
<?php endif; ?>
|
| 69 |
+
|
| 70 |
+
<?php $i++; ?>
|
| 71 |
+
<?php endforeach; ?>
|
| 72 |
+
</table>
|
| 73 |
+
|
| 74 |
+
<?php if($_reviews['settings']['enable_rich_snippet'] == "1"):?>
|
| 75 |
+
<div text-align="center" class="rich-snippet-markup" itemscope itemtype="http://data-vocabulary.org/Review-aggregate"><span itemprop="itemreviewed"><?php echo Mage::getStoreConfig('general/store_information/name')?></span> <span itemprop="rating" itemscope itemtype="http://data-vocabulary.org/Rating">is ranked <span itemprop="average"><?php echo $_reviews['totals']['total_of_five']; ?></span> out of <span itemprop="best">5</span></span>. Based on <span itemprop="count"><?php echo $_reviews['totals']['total_reviews']; ?></span> user reviews.</div>
|
| 76 |
+
<?php endif; ?><?php if($_reviews['settings']['enable_module_credit'] == "1"):?><?php echo $this->getModuleCredit(); ?>
|
| 77 |
+
<?php endif; ?>
|
| 78 |
+
</div>
|
app/etc/modules/EkoInternetMarketing_AllReviews.xml
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<config>
|
| 2 |
+
<modules>
|
| 3 |
+
<EkoInternetMarketing_AllReviews>
|
| 4 |
+
<active>true</active>
|
| 5 |
+
<codePool>community</codePool>
|
| 6 |
+
</EkoInternetMarketing_AllReviews>
|
| 7 |
+
</modules>
|
| 8 |
+
</config>
|
package.xml
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0"?>
|
| 2 |
+
<package>
|
| 3 |
+
<name>All_Reviews</name>
|
| 4 |
+
<version>1.0.0</version>
|
| 5 |
+
<stability>stable</stability>
|
| 6 |
+
<license uri="http://opensource.org/licenses/osl-3.0.php">OSL</license>
|
| 7 |
+
<channel>community</channel>
|
| 8 |
+
<extends/>
|
| 9 |
+
<summary>All Reviews allows you to display all reviews of your products on a single CMS page. Customers searching Google, Bing, Yahoo for "YOUR STORE Reviews" will be able to find a page controlled by you with recent reviews of your products.</summary>
|
| 10 |
+
<description>All Reviews allows you to display all reviews of your products on a single CMS page. Customers searching Google, Bing, Yahoo for "YOUR STORE Reviews" will be able to find a page controlled by you with recent reviews of your products.</description>
|
| 11 |
+
<notes>All Reviews allows you to display all reviews of your products on a single CMS page. Customers searching Google, Bing, Yahoo for "YOUR STORE Reviews" will be able to find a page controlled by you with recent reviews of your products.</notes>
|
| 12 |
+
<authors><author><name>EKO Internet Marketing</name><user>ekoim</user><email>sean@ekoim.com</email></author></authors>
|
| 13 |
+
<date>2012-12-15</date>
|
| 14 |
+
<time>20:17:36</time>
|
| 15 |
+
<contents><target name="magecommunity"><dir name="EkoInternetMarketing"><dir name="AllReviews"><dir name="Block"><file name="AllReviews.php" hash="be9d05bf6973a74dc54cc4bdde900ddd"/></dir><dir name="Helper"><file name="Data.php" hash="81210b49288b21f89a57c9e68f9302bd"/></dir><dir name="etc"><file name="adminhtml.xml" hash="f12d7db8434a7f0d849e8a38395e3e50"/><file name="config.xml" hash="dc2e7383013bab1b6dc6bb83aa9233ed"/><file name="system.xml" hash="d454e272190652ce0a43dacea115b60c"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="EkoInternetMarketing_AllReviews.xml" hash="7cb85256e04ad790890bdc62ca09f20c"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="allreviews.xml" hash="3d637d0eb60c8ab250df20c8e12e31dd"/></dir><dir name="template"><dir name="allreviews"><file name="reviews.bak.phtml" hash="46cef9a397e1872a2265a58c817144e3"/><file name="reviews.phtml" hash="ceab7dcabfb9b151a3fe4eaa165cb206"/><file name=".DS_Store" hash="80c4b527339a69da63a06a3a4d35467e"/></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="ekoim"><dir name="allreviews"><file name="5-stars-empty.png" hash="cb292e1d37b85b3ca28394e57521125b"/><file name="5-stars-full.png" hash="829a1c85d9a29b71907b0e6367bd4387"/><file name="allreviews.css" hash="2f2d4ee78a39734e70412bc0a88dc264"/></dir></dir></dir></dir></dir></target></contents>
|
| 16 |
+
<compatible/>
|
| 17 |
+
<dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php><package><name>Mage_Core_Modules</name><channel>community</channel><min>1.6.0.0</min><max>1.7</max></package></required></dependencies>
|
| 18 |
+
</package>
|
skin/frontend/base/default/ekoim/allreviews/5-stars-empty.png
ADDED
|
Binary file
|
skin/frontend/base/default/ekoim/allreviews/5-stars-full.png
ADDED
|
Binary file
|
skin/frontend/base/default/ekoim/allreviews/allreviews.css
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#all-reviews .rich-snippet-markup{ display: none; }
|
| 2 |
+
|
| 3 |
+
#all-reviews-table .clear{ clear: both; }
|
| 4 |
+
#all-reviews-table td{ border-bottom: 1px dashed #E2E2E2; padding: 10px; border-left: 1px dashed #E2E2E2;}
|
| 5 |
+
#all-reviews-table td.first{ border-left: none !important; }
|
| 6 |
+
|
| 7 |
+
#all-reviews-table .review-body a.product-image{ float: left; padding-right: 15px; }
|
| 8 |
+
#all-reviews-table .review-body p{ padding-top: 10px; }
|
| 9 |
+
#all-reviews-table .review-heading{ padding-bottom: 10px; }
|
| 10 |
+
|
| 11 |
+
#all-reviews-table .rating-box{ float: left; margin-right: 10px; }
|
| 12 |
+
|
| 13 |
+
#all-reviews-table .individual-review{ padding: 12px; border-bottom: 1px solid #F2F2F2; }
|
| 14 |
+
|
| 15 |
+
#all-reviews-table .odd{ background: #faf9f9; }
|
| 16 |
+
|
| 17 |
+
#all-reviews-table div.review-heading{ color: #777; margin-bottom: 5px; }
|
| 18 |
+
#all-reviews-table div.review-heading strong{ color: #000 }
|
| 19 |
+
|
| 20 |
+
#all-reviews-table div.review-body p{ margin: 0px; }
|
| 21 |
+
|
| 22 |
+
#all-reviews-table div.form-add{ margin-top: 12px; }
|
| 23 |
+
|
| 24 |
+
#all-reviews-table .box-review-form h3{ font-size: 14px; font-weight: normal;}
|
| 25 |
+
|
| 26 |
+
#all-reviews-table .box-review-form h4{ font-size: 12px; display: none; }
|
| 27 |
+
|
| 28 |
+
#all-reviews-table .box-review-form .form-add .data-table{ margin: 15px 0px; }
|
| 29 |
+
|
| 30 |
+
.all-reviews-summary{ border-bottom: 1px dashed #E2E2E2; margin-bottom: 15px; }
|
| 31 |
+
.all-reviews-summary p{ text-align: center; padding-top: 5px; }
|
| 32 |
+
.all-reviews-stars{ height: 50px; width: 262px; background: url(5-stars-empty.png) no-repeat; margin: 0 auto; }
|
| 33 |
+
.all-reviews-stars span{ display: block; height: 50px; background: url(5-stars-full.png) no-repeat; }
|
