Version Notes
Enabled customer reviews to left and right sidebar.
Download this release
Release Info
Developer | Magento Core Team |
Extension | VS_Sidebarreview |
Version | 1.0.0 |
Comparing to | |
See all releases |
Version 1.0.0
- app/code/community/VS/Sidebarreview/Block/Sidebarreview.php +4 -0
- app/code/community/VS/Sidebarreview/Helper/Data.php +11 -0
- app/code/community/VS/Sidebarreview/etc/config.xml +84 -0
- app/code/community/VS/Sidebarreview/etc/system.xml +89 -0
- app/design/frontend/default/default/layout/sidebarreview.xml +22 -0
- app/design/frontend/default/default/template/sidebarreview/sidebarreview.phtml +85 -0
- app/etc/modules/VS_Sidebarreview.xml +9 -0
- package.xml +18 -0
app/code/community/VS/Sidebarreview/Block/Sidebarreview.php
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class VS_Sidebarreview_Block_Sidebarreview extends Mage_Core_Block_Template {
|
3 |
+
|
4 |
+
}
|
app/code/community/VS/Sidebarreview/Helper/Data.php
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
* Edition :- Community
|
5 |
+
* Developed By :- virendra Kumar Sharma
|
6 |
+
*
|
7 |
+
*/
|
8 |
+
class VS_Sidebarreview_Helper_Data extends Mage_Core_Helper_Abstract
|
9 |
+
{
|
10 |
+
|
11 |
+
}
|
app/code/community/VS/Sidebarreview/etc/config.xml
ADDED
@@ -0,0 +1,84 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
|
3 |
+
<config>
|
4 |
+
<modules>
|
5 |
+
<VS_Sidebarreview>
|
6 |
+
<version>2.0</version>
|
7 |
+
</VS_Sidebarreview>
|
8 |
+
</modules>
|
9 |
+
<global>
|
10 |
+
<helpers>
|
11 |
+
<sidebarreview>
|
12 |
+
<class>VS_Sidebarreview_Helper</class>
|
13 |
+
</sidebarreview>
|
14 |
+
</helpers>
|
15 |
+
<blocks>
|
16 |
+
<sidebarreview>
|
17 |
+
<class>VS_Sidebarreview_Block</class>
|
18 |
+
</sidebarreview>
|
19 |
+
</blocks>
|
20 |
+
<resources>
|
21 |
+
<sidebarreview_setup>
|
22 |
+
<setup>
|
23 |
+
<module>VS_Sidebarreview</module>
|
24 |
+
</setup>
|
25 |
+
<connection>
|
26 |
+
<use>core_setup</use>
|
27 |
+
</connection>
|
28 |
+
</sidebarreview_setup>
|
29 |
+
<sidebarreview_write>
|
30 |
+
<connection>
|
31 |
+
<use>core_write</use>
|
32 |
+
</connection>
|
33 |
+
</sidebarreview_write>
|
34 |
+
<sidebarreview_read>
|
35 |
+
<connection>
|
36 |
+
<use>core_read</use>
|
37 |
+
</connection>
|
38 |
+
</sidebarreview_read>
|
39 |
+
</resources>
|
40 |
+
</global>
|
41 |
+
<default>
|
42 |
+
<sidebarreview>
|
43 |
+
<general>
|
44 |
+
<enabledleft>1</enabledleft>
|
45 |
+
<enabledright>1</enabledright>
|
46 |
+
<howmany>5</howmany>
|
47 |
+
<showproduct>0</showproduct>
|
48 |
+
<wordlimit>50</wordlimit>
|
49 |
+
<showptitle>1</showptitle>
|
50 |
+
</general>
|
51 |
+
</sidebarreview>
|
52 |
+
|
53 |
+
</default>
|
54 |
+
<frontend>
|
55 |
+
<layout>
|
56 |
+
<updates>
|
57 |
+
<sidebarreview>
|
58 |
+
<file>sidebarreview.xml</file>
|
59 |
+
</sidebarreview>
|
60 |
+
</updates>
|
61 |
+
</layout>
|
62 |
+
</frontend>
|
63 |
+
<adminhtml>
|
64 |
+
<acl>
|
65 |
+
<resources>
|
66 |
+
<admin>
|
67 |
+
<children>
|
68 |
+
<system>
|
69 |
+
<children>
|
70 |
+
<config>
|
71 |
+
<children>
|
72 |
+
<sidebarreview>
|
73 |
+
<title>Sidebar Review</title>
|
74 |
+
</sidebarreview>
|
75 |
+
</children>
|
76 |
+
</config>
|
77 |
+
</children>
|
78 |
+
</system>
|
79 |
+
</children>
|
80 |
+
</admin>
|
81 |
+
</resources>
|
82 |
+
</acl>
|
83 |
+
</adminhtml>
|
84 |
+
</config>
|
app/code/community/VS/Sidebarreview/etc/system.xml
ADDED
@@ -0,0 +1,89 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
|
3 |
+
<config>
|
4 |
+
<tabs>
|
5 |
+
<vs_extensions>
|
6 |
+
<label>VS Extensions</label>
|
7 |
+
<sort_order>195</sort_order>
|
8 |
+
</vs_extensions>
|
9 |
+
</tabs>
|
10 |
+
<sections>
|
11 |
+
<sidebarreview translate="label" >
|
12 |
+
<label>VS Sidebar Reviews</label>
|
13 |
+
<tab>vs_extensions</tab>
|
14 |
+
<frontend_type>text</frontend_type>
|
15 |
+
<sort_order>90</sort_order>
|
16 |
+
<show_in_default>1</show_in_default>
|
17 |
+
<show_in_website>1</show_in_website>
|
18 |
+
<show_in_store>1</show_in_store>
|
19 |
+
<groups>
|
20 |
+
<general translate="label">
|
21 |
+
<label>Sidebar Reviews Settings</label>
|
22 |
+
<frontend_type>text</frontend_type>
|
23 |
+
<sort_order>1</sort_order>
|
24 |
+
<show_in_default>1</show_in_default>
|
25 |
+
<show_in_website>1</show_in_website>
|
26 |
+
<show_in_store>1</show_in_store>
|
27 |
+
<fields>
|
28 |
+
<enabledleft translate="label">
|
29 |
+
<label>Enabled For Left</label>
|
30 |
+
<frontend_type>select</frontend_type>
|
31 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
32 |
+
<sort_order>1</sort_order>
|
33 |
+
<show_in_default>1</show_in_default>
|
34 |
+
<show_in_website>1</show_in_website>
|
35 |
+
<show_in_store>1</show_in_store>
|
36 |
+
</enabledleft>
|
37 |
+
|
38 |
+
<enabledright translate="label">
|
39 |
+
<label>Enabled For Right</label>
|
40 |
+
<frontend_type>select</frontend_type>
|
41 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
42 |
+
<sort_order>2</sort_order>
|
43 |
+
<show_in_default>1</show_in_default>
|
44 |
+
<show_in_website>1</show_in_website>
|
45 |
+
<show_in_store>1</show_in_store>
|
46 |
+
</enabledright>
|
47 |
+
<howmany translate="label">
|
48 |
+
<label>Reviews to display</label>
|
49 |
+
<frontend_type>text</frontend_type>
|
50 |
+
<sort_order>3</sort_order>
|
51 |
+
<show_in_default>1</show_in_default>
|
52 |
+
<show_in_website>1</show_in_website>
|
53 |
+
<show_in_store>1</show_in_store>
|
54 |
+
</howmany>
|
55 |
+
<wordlimit translate="label">
|
56 |
+
<label>Word limit</label>
|
57 |
+
<frontend_type>text</frontend_type>
|
58 |
+
<sort_order>3</sort_order>
|
59 |
+
<show_in_default>4</show_in_default>
|
60 |
+
<show_in_website>1</show_in_website>
|
61 |
+
<show_in_store>1</show_in_store>
|
62 |
+
</wordlimit>
|
63 |
+
<showproduct translate="label">
|
64 |
+
<label>Show product name</label>
|
65 |
+
<frontend_type>select</frontend_type>
|
66 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
67 |
+
<sort_order>5</sort_order>
|
68 |
+
<show_in_default>1</show_in_default>
|
69 |
+
<show_in_website>1</show_in_website>
|
70 |
+
<show_in_store>1</show_in_store>
|
71 |
+
</showproduct>
|
72 |
+
<showptitle translate="label">
|
73 |
+
<label>Show review title</label>
|
74 |
+
<frontend_type>select</frontend_type>
|
75 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
76 |
+
<sort_order>6</sort_order>
|
77 |
+
<show_in_default>1</show_in_default>
|
78 |
+
<show_in_website>1</show_in_website>
|
79 |
+
<show_in_store>1</show_in_store>
|
80 |
+
</showptitle>
|
81 |
+
</fields>
|
82 |
+
</general>
|
83 |
+
|
84 |
+
|
85 |
+
</groups>
|
86 |
+
|
87 |
+
</sidebarreview>
|
88 |
+
</sections>
|
89 |
+
</config>
|
app/design/frontend/default/default/layout/sidebarreview.xml
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
|
3 |
+
<layout version="0.1.0">
|
4 |
+
<default>
|
5 |
+
<reference name="left">
|
6 |
+
<block type="sidebarreview/sidebarreview" name="catalog.sidebarreview.left" after="-">
|
7 |
+
<action method="setTemplate" ifconfig="sidebarreview/general/enabledleft">
|
8 |
+
<template>sidebarreview/sidebarreview.phtml</template>
|
9 |
+
</action>
|
10 |
+
</block>
|
11 |
+
</reference>
|
12 |
+
|
13 |
+
<reference name="right">
|
14 |
+
<block type="sidebarreview/sidebarreview" name="catalog.sidebarreview.right" after="-">
|
15 |
+
<action method="setTemplate" ifconfig="sidebarreview/general/enabledright">
|
16 |
+
<template>sidebarreview/sidebarreview.phtml</template>
|
17 |
+
</action>
|
18 |
+
</block>
|
19 |
+
</reference>
|
20 |
+
</default>
|
21 |
+
</layout>
|
22 |
+
|
app/design/frontend/default/default/template/sidebarreview/sidebarreview.phtml
ADDED
@@ -0,0 +1,85 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/afl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category design
|
22 |
+
* @package base_default
|
23 |
+
* @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
|
24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
+
*/
|
26 |
+
?>
|
27 |
+
<?php
|
28 |
+
$reviews = Mage::getModel('review/review')->getResourceCollection();
|
29 |
+
$reviews->getSelect()->order('rand()');
|
30 |
+
$reviews->addStoreFilter( Mage::app()->getStore()->getId() )
|
31 |
+
->addStatusFilter( Mage_Review_Model_Review::STATUS_APPROVED )
|
32 |
+
->setDateOrder()
|
33 |
+
->addRateVotes()
|
34 |
+
->load();
|
35 |
+
|
36 |
+
$wordlimit = Mage::getStoreConfig('sidebarreview/general/wordlimit');
|
37 |
+
$reviewtodispaly = Mage::getStoreConfig('sidebarreview/general/howmany');
|
38 |
+
?>
|
39 |
+
<?php
|
40 |
+
if($reviews->count()): ?>
|
41 |
+
|
42 |
+
<div class="block block-review">
|
43 |
+
<div class="block-title">
|
44 |
+
<strong><span><?php echo $this->__('Customer Reviews')?></span></strong>
|
45 |
+
</div>
|
46 |
+
<div class="block-content">
|
47 |
+
<?php $_iterator = 0; ?>
|
48 |
+
<ol class="mini-products-list" id="block-review">
|
49 |
+
<?php foreach($reviews as $r){
|
50 |
+
if($_iterator<$reviewtodispaly){ ?>
|
51 |
+
<?php $prod = Mage::getModel('catalog/product')->load( $r->getEntityPkValue()) ;?>
|
52 |
+
<li class="item">
|
53 |
+
<div class="product">
|
54 |
+
<a href="<?php echo $prod->getProductUrl() ?>" title="<?php echo $this->htmlEscape($prod->getName()) ?>" class="product-image"><img src="<?php echo $this->helper('catalog/image')->init($prod, 'thumbnail')->resize(50) ?>" width="50" height="50" alt="<?php echo $this->htmlEscape($prod->getName()) ?>" /></a>
|
55 |
+
<div class="product-details">
|
56 |
+
<?php if(Mage::getStoreConfig('sidebarreview/general/showproduct')) {?>
|
57 |
+
<p class="product-name"><a href="<?php echo $prod->getProductUrl() ?>"><?php echo $this->htmlEscape($prod->getName()) ?></a></p>
|
58 |
+
<?php } ?>
|
59 |
+
<?php
|
60 |
+
$avg = 0;
|
61 |
+
if( count($r->getRatingVotes()) ) {
|
62 |
+
$ratings = array();
|
63 |
+
foreach( $r->getRatingVotes() as $rating ) {
|
64 |
+
$ratings[] = $rating->getPercent();
|
65 |
+
}
|
66 |
+
$avg = array_sum($ratings)/count($ratings);
|
67 |
+
}
|
68 |
+
?>
|
69 |
+
<div class="rating-box">
|
70 |
+
<div class="rating" style="width:<?php echo $avg ?>%"></div>
|
71 |
+
</div>
|
72 |
+
<?php if(Mage::getStoreConfig('sidebarreview/general/showptitle')) {?><br />
|
73 |
+
|
74 |
+
<h4><a href="<?php echo $this->getUrl();?>review/product/view/id/<?php echo $r->getId();?>/"><?php echo $r->getTitle();?></a></h4>
|
75 |
+
<?php } ?>
|
76 |
+
<p><?php echo substr($r->getDetail(),0,$wordlimit);?></p>
|
77 |
+
</div>
|
78 |
+
</div>
|
79 |
+
</li>
|
80 |
+
<?php } ?>
|
81 |
+
<?php $_iterator++; } ?>
|
82 |
+
</ol>
|
83 |
+
</div>
|
84 |
+
</div>
|
85 |
+
<?php endif; ?>
|
app/etc/modules/VS_Sidebarreview.xml
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<VS_Sidebarreview>
|
5 |
+
<active>true</active>
|
6 |
+
<codePool>community</codePool>
|
7 |
+
</VS_Sidebarreview>
|
8 |
+
</modules>
|
9 |
+
</config>
|
package.xml
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<package>
|
3 |
+
<name>VS_Sidebarreview</name>
|
4 |
+
<version>1.0.0</version>
|
5 |
+
<stability>stable</stability>
|
6 |
+
<license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
|
7 |
+
<channel>community</channel>
|
8 |
+
<extends/>
|
9 |
+
<summary>Enabled customer reviews to left and right sidebar.</summary>
|
10 |
+
<description>Enabled customer reviews to left and right sidebar.</description>
|
11 |
+
<notes>Enabled customer reviews to left and right sidebar.</notes>
|
12 |
+
<authors><author><name>virendra kumar sharma</name><user>auto-converted</user><email>bhardwajveerendra@gmail.com</email></author></authors>
|
13 |
+
<date>2011-07-18</date>
|
14 |
+
<time>11:30:12</time>
|
15 |
+
<contents><target name="magecommunity"><dir name="VS"><dir name="Sidebarreview"><dir name="Block"><file name="Sidebarreview.php" hash="1a586671809c4f09a59b411de6a91c98"/></dir><dir name="Helper"><file name="Data.php" hash="b5ccd0d18156d26821752a30b6701f16"/></dir><dir name="etc"><file name="config.xml" hash="171689f5f073c5e368bb9e63e3757124"/><file name="system.xml" hash="3461758ae92ff9a243dd4eb299cd2398"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="sidebarreview.xml" hash="42b64e2c2ba7dcec6863abd5d7d9efa6"/></dir><dir name="template"><dir name="sidebarreview"><file name="sidebarreview.phtml" hash="35b8b94818abee9691c80d13f18220fe"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="VS_Sidebarreview.xml" hash="7fd5fd506a5645c08774d158f5db7105"/></dir></target></contents>
|
16 |
+
<compatible/>
|
17 |
+
<dependencies/>
|
18 |
+
</package>
|