Bestseller_products - Version 1.1.4

Version Notes

Best Seller

Download this release

Release Info

Developer Capacity Web Solutions
Extension Bestseller_products
Version 1.1.4
Comparing to
See all releases


Code changes from version 1.1.3 to 1.1.4

app/code/community/CapacityWebSolutions/Bestseller/etc/config.xml CHANGED
@@ -8,57 +8,73 @@
8
<config>
9
<global>
10
<modules>
11
- <CapacityWebSolutions_Bestseller>
12
- <version>1.0.0</version>
13
- </CapacityWebSolutions_Bestseller>
14
</modules>
15
- <blocks>
16
<bestseller>
17
<rewrite>
18
- <bestseller>CapacityWebSolutions_Bestseller_Block_Bestseller</bestseller>
19
- </rewrite>
20
</bestseller>
21
- </blocks>
22
-
23
- </global>
24
- <frontend>
25
- <routers>
26
- <bestseller>
27
- <use>standard</use>
28
- <args>
29
- <module>CapacityWebSolutions_Bestseller</module>
30
- <frontName>bestseller</frontName>
31
- </args>
32
- </bestseller>
33
- </routers>
34
<layout>
35
<updates>
36
<bestseller>
37
<file>bestseller.xml</file>
38
</bestseller>
39
</updates>
40
- </layout>
41
- </frontend>
42
- <adminhtml>
43
- <acl>
44
- <resources>
45
- <admin>
46
- <children>
47
- <system>
48
- <children>
49
- <config>
50
- <children>
51
- <bestseller>
52
- <title>Bestseller Section</title>
53
- </bestseller>
54
- </children>
55
- </config>
56
- </children>
57
- </system>
58
- </children>
59
- </admin>
60
- </resources>
61
- </acl>
62
-
63
- </adminhtml>
64
</config>
8
<config>
9
<global>
10
<modules>
11
+ <CapacityWebSolutions_Bestseller>
12
+ <version>1.0.0</version>
13
+ </CapacityWebSolutions_Bestseller>
14
</modules>
15
+ <blocks>
16
<bestseller>
17
<rewrite>
18
+ <bestseller>CapacityWebSolutions_Bestseller_Block_Bestseller</bestseller>
19
+ </rewrite>
20
</bestseller>
21
+ </blocks>
22
+ </global>
23
+ <frontend>
24
+ <routers>
25
+ <bestseller>
26
+ <use>standard</use>
27
+ <args>
28
+ <module>CapacityWebSolutions_Bestseller</module>
29
+ <frontName>bestseller</frontName>
30
+ </args>
31
+ </bestseller>
32
+ </routers>
33
<layout>
34
<updates>
35
<bestseller>
36
<file>bestseller.xml</file>
37
</bestseller>
38
</updates>
39
+ </layout>
40
+ </frontend>
41
+ <adminhtml>
42
+ <acl>
43
+ <resources>
44
+ <admin>
45
+ <children>
46
+ <system>
47
+ <children>
48
+ <config>
49
+ <children>
50
+ <bestseller>
51
+ <title>Bestseller Section</title>
52
+ </bestseller>
53
+ </children>
54
+ </config>
55
+ </children>
56
+ </system>
57
+ </children>
58
+ </admin>
59
+ </resources>
60
+ </acl>
61
+ </adminhtml>
62
+ <default> <!-- Default text value set from admin-->
63
+ <bestseller>
64
+ <general>
65
+ <enabled>1</enabled>
66
+ <heading>BESTSELLER PRODUCTS</heading>
67
+ <number_of_items>6</number_of_items>
68
+ <number_of_items_per_row>3</number_of_items_per_row>
69
+ <thumbnail_height>135</thumbnail_height>
70
+ <thumbnail_width>135</thumbnail_width>
71
+ <time_period>60</time_period>
72
+ <products_price>1</products_price>
73
+ <review>1</review>
74
+ <add_to_cart>1</add_to_cart>
75
+ <active>1</active>
76
+ <add_to_compare>1</add_to_compare>
77
+ </general>
78
+ </bestseller>
79
+ </default>
80
</config>
app/code/community/CapacityWebSolutions/Bestseller/etc/system.xml CHANGED
@@ -6,8 +6,7 @@
6
*/
7
-->
8
<config>
9
-
10
- <tabs>
11
<bestseller>
12
<label>Capacity Web Solutions</label>
13
<sort_order>100</sort_order>
@@ -32,58 +31,66 @@
32
<show_in_website>1</show_in_website>
33
<show_in_store>1</show_in_store>
34
<fields>
35
- <heading translate="label">
36
<label>Heading</label>
37
<frontend_type>text</frontend_type>
38
- <sort_order>0</sort_order>
39
<show_in_default>1</show_in_default>
40
<show_in_website>1</show_in_website>
41
<show_in_store>1</show_in_store>
42
</heading>
43
-
44
- <number_of_items translate="label comment">
45
<label>Number Of Items in Main Block</label>
46
- <comment>How many best seller products will be showed in main block?</comment>
47
<frontend_type>text</frontend_type>
48
- <sort_order>1</sort_order>
49
<show_in_default>1</show_in_default>
50
<show_in_website>1</show_in_website>
51
<show_in_store>1</show_in_store>
52
</number_of_items>
53
-
54
<number_of_items_per_row translate="label comment">
55
<label>Number Of Items per row in Main Block</label>
56
- <comment>How many best seller products will be showed per row?</comment>
57
<frontend_type>text</frontend_type>
58
- <sort_order>2</sort_order>
59
<show_in_default>1</show_in_default>
60
<show_in_website>1</show_in_website>
61
<show_in_store>1</show_in_store>
62
</number_of_items_per_row>
63
-
64
<thumbnail_height translate="label">
65
- <label>Thumbnail Width</label>
66
<frontend_type>text</frontend_type>
67
- <sort_order>3</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
</thumbnail_height>
72
-
73
<thumbnail_width translate="label">
74
- <label>Thumbnail Height </label>
75
<frontend_type>text</frontend_type>
76
- <sort_order>4</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
</thumbnail_width>
81
-
82
<time_period translate="label">
83
<label>Time Period</label>
84
<comment>Days bestselling product. Default 60 days.</comment>
85
<frontend_type>text</frontend_type>
86
- <sort_order>5</sort_order>
87
<show_in_default>1</show_in_default>
88
<show_in_website>1</show_in_website>
89
<show_in_store>1</show_in_store>
@@ -92,80 +99,72 @@
92
<label>Time Period</label>
93
<comment>Days bestselling product. Default 60 days.</comment>
94
<frontend_type>text</frontend_type>
95
- <sort_order>5</sort_order>
96
<show_in_default>1</show_in_default>
97
<show_in_website>1</show_in_website>
98
<show_in_store>1</show_in_store>
99
</time_period>
100
-
101
- <products_price translate="label">
102
<label>Show Products Price</label>
103
<comment>Select Yes for display the Products Price on frontend.</comment>
104
<source_model>adminhtml/system_config_source_yesno</source_model>
105
<frontend_type>select</frontend_type>
106
- <sort_order>6</sort_order>
107
<show_in_default>1</show_in_default>
108
<show_in_website>1</show_in_website>
109
<show_in_store>1</show_in_store>
110
</products_price>
111
-
112
- <review translate="label">
113
<label>Show Reviews Ratings</label>
114
<comment>Select Yes for display the Reviews Ratings on frontend.</comment>
115
<source_model>adminhtml/system_config_source_yesno</source_model>
116
<frontend_type>select</frontend_type>
117
- <sort_order>7</sort_order>
118
<show_in_default>1</show_in_default>
119
<show_in_website>1</show_in_website>
120
<show_in_store>1</show_in_store>
121
</review>
122
-
123
<add_to_cart translate="label">
124
<label>Add to Cart</label>
125
<comment>Select Yes for display the Add to cart button on frontend.</comment>
126
<source_model>adminhtml/system_config_source_yesno</source_model>
127
<frontend_type>select</frontend_type>
128
- <sort_order>8</sort_order>
129
<show_in_default>1</show_in_default>
130
<show_in_website>1</show_in_website>
131
<show_in_store>1</show_in_store>
132
</add_to_cart>
133
-
134
- <active translate="label">
135
<label>Add to Wishlist</label>
136
<comment>Select Yes for display the Add to Wishlist Link on frontend.</comment>
137
<frontend_type>select</frontend_type>
138
<source_model>adminhtml/system_config_source_yesno</source_model>
139
- <sort_order>9</sort_order>
140
<show_in_default>1</show_in_default>
141
<show_in_website>1</show_in_website>
142
<show_in_store>1</show_in_store>
143
</active>
144
-
145
<add_to_compare translate="label">
146
<label>Add to Compare</label>
147
<comment>Select Yes for display the Add to Compare Link on frontend.</comment>
148
<source_model>adminhtml/system_config_source_yesno</source_model>
149
<frontend_type>select</frontend_type>
150
- <sort_order>10</sort_order>
151
<show_in_default>1</show_in_default>
152
<show_in_website>1</show_in_website>
153
<show_in_store>1</show_in_store>
154
</add_to_compare>
155
-
156
<out_of_stoke translate="label">
157
<label>Display out of stock items</label>
158
<comment>Select Yes for display the out of stock items on frontend.</comment>
159
<source_model>adminhtml/system_config_source_yesno</source_model>
160
<frontend_type>select</frontend_type>
161
- <sort_order>11</sort_order>
162
<show_in_default>1</show_in_default>
163
<show_in_website>1</show_in_website>
164
<show_in_store>1</show_in_store>
165
</out_of_stoke>
166
-
167
-
168
- </fields>
169
</general>
170
</groups>
171
</bestseller>
6
*/
7
-->
8
<config>
9
+ <tabs>
10
<bestseller>
11
<label>Capacity Web Solutions</label>
12
<sort_order>100</sort_order>
31
<show_in_website>1</show_in_website>
32
<show_in_store>1</show_in_store>
33
<fields>
34
+ <enabled translate="label">
35
+ <label>Enabled</label>
36
+ <comment>Select Yes for display the Bestseller Products Extension on frontend.</comment>
37
+ <source_model>adminhtml/system_config_source_yesno</source_model>
38
+ <frontend_type>select</frontend_type>
39
+ <sort_order>0</sort_order>
40
+ <show_in_default>1</show_in_default>
41
+ <show_in_website>1</show_in_website>
42
+ <show_in_store>1</show_in_store>
43
+ </enabled>
44
+ <heading translate="label">
45
<label>Heading</label>
46
+ <comment>Here, We can Set Heading.</comment>
47
<frontend_type>text</frontend_type>
48
+ <sort_order>1</sort_order>
49
<show_in_default>1</show_in_default>
50
<show_in_website>1</show_in_website>
51
<show_in_store>1</show_in_store>
52
</heading>
53
+ <number_of_items translate="label comment">
54
<label>Number Of Items in Main Block</label>
55
+ <comment>Show Number of best seller products in main block</comment>
56
<frontend_type>text</frontend_type>
57
+ <sort_order>2</sort_order>
58
<show_in_default>1</show_in_default>
59
<show_in_website>1</show_in_website>
60
<show_in_store>1</show_in_store>
61
</number_of_items>
62
<number_of_items_per_row translate="label comment">
63
<label>Number Of Items per row in Main Block</label>
64
+ <comment>Show Number of best seller products in per row</comment>
65
<frontend_type>text</frontend_type>
66
+ <sort_order>3</sort_order>
67
<show_in_default>1</show_in_default>
68
<show_in_website>1</show_in_website>
69
<show_in_store>1</show_in_store>
70
</number_of_items_per_row>
71
<thumbnail_height translate="label">
72
+ <label>Thumbnail Width</label>
73
+ <comment>Default Thumbnail Width: 135px</comment>
74
<frontend_type>text</frontend_type>
75
+ <sort_order>4</sort_order>
76
<show_in_default>1</show_in_default>
77
<show_in_website>1</show_in_website>
78
<show_in_store>1</show_in_store>
79
</thumbnail_height>
80
<thumbnail_width translate="label">
81
+ <label>Thumbnail Height </label>
82
+ <comment>Default Thumbnail Height: 135px</comment>
83
<frontend_type>text</frontend_type>
84
+ <sort_order>5</sort_order>
85
<show_in_default>1</show_in_default>
86
<show_in_website>1</show_in_website>
87
<show_in_store>1</show_in_store>
88
</thumbnail_width>
89
<time_period translate="label">
90
<label>Time Period</label>
91
<comment>Days bestselling product. Default 60 days.</comment>
92
<frontend_type>text</frontend_type>
93
+ <sort_order>6</sort_order>
94
<show_in_default>1</show_in_default>
95
<show_in_website>1</show_in_website>
96
<show_in_store>1</show_in_store>
99
<label>Time Period</label>
100
<comment>Days bestselling product. Default 60 days.</comment>
101
<frontend_type>text</frontend_type>
102
+ <sort_order>7</sort_order>
103
<show_in_default>1</show_in_default>
104
<show_in_website>1</show_in_website>
105
<show_in_store>1</show_in_store>
106
</time_period>
107
+ <products_price translate="label">
108
<label>Show Products Price</label>
109
<comment>Select Yes for display the Products Price on frontend.</comment>
110
<source_model>adminhtml/system_config_source_yesno</source_model>
111
<frontend_type>select</frontend_type>
112
+ <sort_order>8</sort_order>
113
<show_in_default>1</show_in_default>
114
<show_in_website>1</show_in_website>
115
<show_in_store>1</show_in_store>
116
</products_price>
117
+ <review translate="label">
118
<label>Show Reviews Ratings</label>
119
<comment>Select Yes for display the Reviews Ratings on frontend.</comment>
120
<source_model>adminhtml/system_config_source_yesno</source_model>
121
<frontend_type>select</frontend_type>
122
+ <sort_order>9</sort_order>
123
<show_in_default>1</show_in_default>
124
<show_in_website>1</show_in_website>
125
<show_in_store>1</show_in_store>
126
</review>
127
<add_to_cart translate="label">
128
<label>Add to Cart</label>
129
<comment>Select Yes for display the Add to cart button on frontend.</comment>
130
<source_model>adminhtml/system_config_source_yesno</source_model>
131
<frontend_type>select</frontend_type>
132
+ <sort_order>10</sort_order>
133
<show_in_default>1</show_in_default>
134
<show_in_website>1</show_in_website>
135
<show_in_store>1</show_in_store>
136
</add_to_cart>
137
+ <active translate="label">
138
<label>Add to Wishlist</label>
139
<comment>Select Yes for display the Add to Wishlist Link on frontend.</comment>
140
<frontend_type>select</frontend_type>
141
<source_model>adminhtml/system_config_source_yesno</source_model>
142
+ <sort_order>11</sort_order>
143
<show_in_default>1</show_in_default>
144
<show_in_website>1</show_in_website>
145
<show_in_store>1</show_in_store>
146
</active>
147
<add_to_compare translate="label">
148
<label>Add to Compare</label>
149
<comment>Select Yes for display the Add to Compare Link on frontend.</comment>
150
<source_model>adminhtml/system_config_source_yesno</source_model>
151
<frontend_type>select</frontend_type>
152
+ <sort_order>12</sort_order>
153
<show_in_default>1</show_in_default>
154
<show_in_website>1</show_in_website>
155
<show_in_store>1</show_in_store>
156
</add_to_compare>
157
<out_of_stoke translate="label">
158
<label>Display out of stock items</label>
159
<comment>Select Yes for display the out of stock items on frontend.</comment>
160
<source_model>adminhtml/system_config_source_yesno</source_model>
161
<frontend_type>select</frontend_type>
162
+ <sort_order>13</sort_order>
163
<show_in_default>1</show_in_default>
164
<show_in_website>1</show_in_website>
165
<show_in_store>1</show_in_store>
166
</out_of_stoke>
167
+ </fields>
168
</general>
169
</groups>
170
</bestseller>
app/design/frontend/default/default/template/bestseller/bestseller.phtml CHANGED
@@ -13,198 +13,181 @@
13
.productList .product .addWishlist {clear:both; text-align:center; }
14
</style>
15
<?php
16
- $result = $this->getBestsellerProduct();
17
- $upperLimit = ($this->getLimit()) ? $this->getLimit() : 1;
18
- $itemPerRow = ($this->getItemsPerRow()) ? $this->getItemsPerRow() : 1 ;
19
- $model = Mage::getModel('catalog/product');
20
- $products_price = Mage::getStoreConfig('bestseller/general/products_price');
21
- $review = Mage::getStoreConfig('bestseller/general/review');
22
- $out_of_stoke = Mage::getStoreConfig('bestseller/general/out_of_stoke');
23
?>
24
<div class="sectionHead"><h2><?php echo $this->getHeader(); ?></h2></div>
25
- <table border="0" cellpadding="0" cellspacing="0" class="productList">
26
- <?php
27
- if ($out_of_stoke == 0)
28
- {
29
- ?>
30
-
31
- <tr>
32
- <?php
33
- $i=0;
34
- $x = 1;
35
- for($cnt = 0; $cnt<count($result); $cnt++)
36
- {
37
- $_product = $model->load($result[$cnt]); //getting product object for particular product id
38
- $status = $_product->getData('status');
39
- $is_salable = $_product->getData('is_salable');
40
-
41
- if($status == 1)
42
- {
43
- if ($is_salable == 1 )
44
- {
45
- if($x <= $upperLimit)
46
- {
47
- if($i>($itemPerRow-1))
48
- echo '<tr valign="top">';
49
- ?>
50
- <td class="product">
51
- <div class="prodimage">
52
- <a href="<?php echo $this->getBaseUrl().$_product['url_path']; ?>" title="<?php echo $this->htmlEscape($_product->getName()) ?>">
53
- <img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(($this->getImageHeight()) ? $this->getImageHeight() : 135,($this->getImageWidth()) ? $this->getImageWidth() : 135); ?>" alt="<?php echo $this->htmlEscape($_product['name']) ?>"/>
54
- </a>
55
- </div>
56
- <div align="center">
57
- <div class="prodDetails" align="center" style="width:150px;" >
58
- <a href="<?php echo $this->getBaseUrl().$_product['url_path'] ?>" title="<?php echo $this->htmlEscape($_product['name']) ?>"><?php echo $this->htmlEscape($_product['name']) ?></a>
59
-
60
- <?php if($review == 1)
61
- {
62
- $_product = Mage::getModel('catalog/product')->load($_product->getId());
63
- echo $this->getReviewsSummaryHtml($_product, 'short');
64
- }
65
- if($products_price == 1)
66
- {
67
- $_product = Mage::getModel('catalog/product')->load($_product->getId());
68
- echo $this->getPriceHtml($_product, true);
69
- }
70
- ?>
71
- </div>
72
- <?php $addtocartval = $this->getAddToCart();
73
- if($addtocartval == 1){
74
- if($_product->isSaleable()): ?>
75
-
76
- <button class="button btn-cart" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>')"><span><?php echo $this->__('Add to Cart') ?></span></button>
77
- <?php else: ?>
78
- <span class="out-of-stock"><?php echo $this->__('Out of stock') ?></span>
79
- <?php endif; }?>
80
- </div>
81
- <div class="cl">
82
- <?php $wishlists = $this->getActive();
83
- if($wishlists == 1){
84
- if ($this->helper('wishlist')->isAllow()) : ?>
85
- <a href="<?php echo $this->getAddToWishlistUrl($_product) ?>" class="addWishlist"><?php echo $this->__('Add to Wishlist') ?></a>
86
- <?php endif; }?>
87
- </div>
88
- <div class="cl">
89
- <?php $addtocompare = $this->getAddToCompare();
90
if($addtocompare==1){
91
- if($_compareUrl=$this->getAddToCompareUrl($_product)): ?>
92
- &nbsp;<a href="<?php echo $_compareUrl; ?>" class="addCompare"><?php echo $this->__('Add to Compare') ?></a>
93
- <?php endif; }?>
94
- </div>
95
- </td>
96
- <?php
97
- $i++;
98
- if($i>($itemPerRow-1))
99
- { $i=0;
100
- echo "</tr>";
101
- echo '<tr><td colspan="3" class="hline"><img src="'. $this->getSkinUrl('images/spacer.gif') .'" alt="" /></td></tr>';
102
- }
103
- if($i==($itemPerRow))
104
- {
105
- echo '<td class="vline"><img src="'. $this->getSkinUrl('images/spacer.gif') .'" alt=""/></td>';
106
- }
107
- }
108
- else
109
- {
110
- //break;
111
- }
112
- $x++;
113
}
114
-
115
- }
116
- }
117
- ?>
118
- </tr>
119
- <?php
120
- }
121
- else
122
- {
123
- ?>
124
- <tr>
125
- <?php
126
- $i=0;
127
- $x = 1;
128
- for($cnt = 0; $cnt<count($result); $cnt++)
129
- {
130
- $_product = $model->load($result[$cnt]); //getting product object for particular product id
131
- $status = $_product->getData('status');
132
- if ($status == 1)
133
- {
134
- if($x <= $upperLimit)
135
- {
136
- if($i>($itemPerRow-1))
137
- echo '<tr valign="top">';
138
- ?>
139
- <td class="product">
140
- <div class="prodimage">
141
- <a href="<?php echo $this->getBaseUrl().$_product['url_path']; ?>" title="<?php echo $this->htmlEscape($_product->getName()) ?>">
142
- <img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(($this->getImageHeight()) ? $this->getImageHeight() : 135,($this->getImageWidth()) ? $this->getImageWidth() : 135); ?>" alt="<?php echo $this->htmlEscape($_product['name']) ?>"/>
143
- </a>
144
- </div>
145
- <div align="center">
146
- <div class="prodDetails" align="center" style="width:150px;" >
147
- <a href="<?php echo $this->getBaseUrl().$_product['url_path'] ?>" title="<?php echo $this->htmlEscape($_product['name']) ?>"><?php echo $this->htmlEscape($_product['name']) ?></a>
148
-
149
- <?php if($review == 1)
150
- {
151
- $_product = Mage::getModel('catalog/product')->load($_product->getId());
152
- echo $this->getReviewsSummaryHtml($_product, 'short');
153
- }
154
- if($products_price == 1)
155
- {
156
- $_product = Mage::getModel('catalog/product')->load($_product->getId());
157
- echo $this->getPriceHtml($_product, true);
158
- }
159
- ?>
160
- </div>
161
- <?php $addtocartval = $this->getAddToCart();
162
- if($addtocartval == 1){
163
- if($_product->isSaleable()): ?>
164
-
165
- <button class="button btn-cart" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>')"><span><?php echo $this->__('Add to Cart') ?></span></button>
166
- <?php else: ?>
167
- <span class="out-of-stock"><?php echo $this->__('Out of stock') ?></span>
168
- <?php endif; }?>
169
- </div>
170
- <div class="cl">
171
- <?php $wishlists = $this->getActive();
172
- if($wishlists == 1){
173
- if ($this->helper('wishlist')->isAllow()) : ?>
174
- <a href="<?php echo $this->getAddToWishlistUrl($_product) ?>" class="addWishlist"><?php echo $this->__('Add to Wishlist') ?></a>
175
- <?php endif; }?>
176
- </div>
177
- <div class="cl">
178
- <?php $addtocompare = $this->getAddToCompare();
179
- if($addtocompare==1){
180
- if($_compareUrl=$this->getAddToCompareUrl($_product)): ?>
181
- &nbsp;<a href="<?php echo $_compareUrl; ?>" class="addCompare"><?php echo $this->__('Add to Compare') ?></a>
182
- <?php endif; }?>
183
- </div>
184
- </td>
185
- <?php
186
- $i++;
187
- if($i>($itemPerRow-1))
188
- { $i=0;
189
- echo "</tr>";
190
- echo '<tr><td colspan="3" class="hline"><img src="'. $this->getSkinUrl('images/spacer.gif') .'" alt="" /></td></tr>';
191
- }
192
- if($i==($itemPerRow))
193
- {
194
- echo '<td class="vline"><img src="'. $this->getSkinUrl('images/spacer.gif') .'" alt=""/></td>';
195
- }
196
- }
197
- else
198
- {
199
- // break;
200
- }
201
- $x++;
202
}
203
- }
204
- ?>
205
- </tr>
206
- <?php
207
- }
208
- ?>
209
-
210
- </table>
13
.productList .product .addWishlist {clear:both; text-align:center; }
14
</style>
15
<?php
16
+ $result = $this->getBestsellerProduct();
17
+ $upperLimit = ($this->getLimit()) ? $this->getLimit() : 1;
18
+ $itemPerRow = ($this->getItemsPerRow()) ? $this->getItemsPerRow() : 1 ;
19
+ $model = Mage::getModel('catalog/product');
20
+ $enabled = Mage::getStoreConfig('bestseller/general/enabled');
21
+ $products_price = Mage::getStoreConfig('bestseller/general/products_price');
22
+ $review = Mage::getStoreConfig('bestseller/general/review');
23
+ $out_of_stoke = Mage::getStoreConfig('bestseller/general/out_of_stoke');
24
?>
25
+ <?php if($enabled == 1): ?>
26
<div class="sectionHead"><h2><?php echo $this->getHeader(); ?></h2></div>
27
+ <table border="0" cellpadding="0" cellspacing="0" class="productList">
28
+ <?php if ($out_of_stoke == 0) { ?>
29
+ <tr>
30
+ <?php
31
+ $i=0; $x = 1;
32
+ for($cnt = 0; $cnt<count($result); $cnt++)
33
+ {
34
+ $_product = $model->load($result[$cnt]); //getting product object for particular product id
35
+ $status = $_product->getData('status');
36
+ $is_salable = $_product->getData('is_salable');
37
+ if($status == 1)
38
+ {
39
+ if ($is_salable == 1 )
40
+ {
41
+ if($x <= $upperLimit)
42
+ {
43
+ if($i>($itemPerRow-1))
44
+ echo '<tr valign="top">';
45
+ ?>
46
+ <td class="product">
47
+ <div class="prodimage">
48
+ <a href="<?php echo $this->getBaseUrl().$_product['url_path']; ?>" title="<?php echo $this->htmlEscape($_product->getName()) ?>">
49
+ <img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(($this->getImageHeight()) ? $this->getImageHeight() : 135,($this->getImageWidth()) ? $this->getImageWidth() : 135); ?>" alt="<?php echo $this->htmlEscape($_product['name']) ?>"/></a>
50
+ </div>
51
+ <div align="center">
52
+ <div class="prodDetails" align="center" style="width:150px;" >
53
+ <a href="<?php echo $this->getBaseUrl().$_product['url_path'] ?>" title="<?php echo $this->htmlEscape($_product['name']) ?>"><?php echo $this->htmlEscape($_product['name']) ?></a>
54
+ <?php
55
+ if($review == 1)
56
+ {
57
+ $_product = Mage::getModel('catalog/product')->load($_product->getId());
58
+ echo $this->getReviewsSummaryHtml($_product, 'short');
59
+ }
60
+ if($products_price == 1)
61
+ {
62
+ $_product = Mage::getModel('catalog/product')->load($_product->getId());
63
+ echo $this->getPriceHtml($_product, true);
64
+ }
65
+ ?>
66
+ </div>
67
+ <?php $addtocartval = $this->getAddToCart();
68
+ if($addtocartval == 1){
69
+ if($_product->isSaleable()): ?>
70
+ <button class="button btn-cart" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>')"><span><?php echo $this->__('Add to Cart') ?></span></button>
71
+ <?php else: ?>
72
+ <span class="out-of-stock"><?php echo $this->__('Out of stock') ?></span>
73
+ <?php endif; }?>
74
+ </div>
75
+ <div class="cl">
76
+ <?php $wishlists = $this->getActive();
77
+ if($wishlists == 1){
78
+ if ($this->helper('wishlist')->isAllow()) : ?>
79
+ <a href="<?php echo $this->getAddToWishlistUrl($_product) ?>" class="addWishlist"><?php echo $this->__('Add to Wishlist') ?></a>
80
+ <?php endif; }?>
81
+ </div>
82
+ <div class="cl">
83
+ <?php $addtocompare = $this->getAddToCompare();
84
if($addtocompare==1){
85
+ if($_compareUrl=$this->getAddToCompareUrl($_product)): ?>
86
+ &nbsp;<a href="<?php echo $_compareUrl; ?>" class="addCompare"><?php echo $this->__('Add to Compare') ?></a>
87
+ <?php endif; }?>
88
+ </div>
89
+ </td>
90
+ <?php
91
+ $i++;
92
+ if($i>($itemPerRow-1))
93
+ {
94
+ $i=0;
95
+ echo "</tr>";
96
+ echo '<tr><td colspan="3" class="hline"><img src="'. $this->getSkinUrl('images/spacer.gif') .'" alt="" /></td></tr>';
97
+ }
98
+ if($i==($itemPerRow))
99
+ {
100
+ echo '<td class="vline"><img src="'. $this->getSkinUrl('images/spacer.gif') .'" alt=""/></td>';
101
+ }
102
+ }
103
+ $x++;
104
+ }
105
+ }
106
+ }
107
+ ?>
108
+ </tr>
109
+ <?php
110
}
111
+ else
112
+ {
113
+ ?>
114
+ <tr>
115
+ <?php
116
+ $i=0; $x = 1;
117
+ for($cnt = 0; $cnt<count($result); $cnt++)
118
+ {
119
+ $_product = $model->load($result[$cnt]); //getting product object for particular product id
120
+ $status = $_product->getData('status');
121
+ if ($status == 1)
122
+ {
123
+ if($x <= $upperLimit)
124
+ {
125
+ if($i>($itemPerRow-1))
126
+ echo '<tr valign="top">';
127
+ ?>
128
+ <td class="product">
129
+ <div class="prodimage">
130
+ <a href="<?php echo $this->getBaseUrl().$_product['url_path']; ?>" title="<?php echo $this->htmlEscape($_product->getName()) ?>">
131
+ <img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(($this->getImageHeight()) ? $this->getImageHeight() : 135,($this->getImageWidth()) ? $this->getImageWidth() : 135); ?>" alt="<?php echo $this->htmlEscape($_product['name']) ?>"/></a>
132
+ </div>
133
+ <div align="center">
134
+ <div class="prodDetails" align="center" style="width:150px;" >
135
+ <a href="<?php echo $this->getBaseUrl().$_product['url_path'] ?>" title="<?php echo $this->htmlEscape($_product['name']) ?>"><?php echo $this->htmlEscape($_product['name']) ?></a>
136
+ <?php
137
+ if($review == 1)
138
+ {
139
+ $_product = Mage::getModel('catalog/product')->load($_product->getId());
140
+ echo $this->getReviewsSummaryHtml($_product, 'short');
141
+ }
142
+ if($products_price == 1)
143
+ {
144
+ $_product = Mage::getModel('catalog/product')->load($_product->getId());
145
+ echo $this->getPriceHtml($_product, true);
146
+ }
147
+ ?>
148
+ </div>
149
+ <?php $addtocartval = $this->getAddToCart();
150
+ if($addtocartval == 1){
151
+ if($_product->isSaleable()): ?>
152
+ <button class="button btn-cart" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>')"><span><?php echo $this->__('Add to Cart') ?></span></button>
153
+ <?php else: ?>
154
+ <span class="out-of-stock"><?php echo $this->__('Out of stock') ?></span>
155
+ <?php endif; }?>
156
+ </div>
157
+ <div class="cl">
158
+ <?php $wishlists = $this->getActive();
159
+ if($wishlists == 1){
160
+ if ($this->helper('wishlist')->isAllow()) : ?>
161
+ <a href="<?php echo $this->getAddToWishlistUrl($_product) ?>" class="addWishlist"><?php echo $this->__('Add to Wishlist') ?></a>
162
+ <?php endif; }?>
163
+ </div>
164
+ <div class="cl">
165
+ <?php $addtocompare = $this->getAddToCompare();
166
+ if($addtocompare==1){
167
+ if($_compareUrl=$this->getAddToCompareUrl($_product)): ?>
168
+ &nbsp;<a href="<?php echo $_compareUrl; ?>" class="addCompare"><?php echo $this->__('Add to Compare') ?></a>
169
+ <?php endif; }?>
170
+ </div>
171
+ </td>
172
+ <?php
173
+ $i++;
174
+ if($i>($itemPerRow-1))
175
+ { $i=0;
176
+ echo "</tr>";
177
+ echo '<tr><td colspan="3" class="hline"><img src="'. $this->getSkinUrl('images/spacer.gif') .'" alt="" /></td></tr>';
178
+ }
179
+ if($i==($itemPerRow))
180
+ {
181
+ echo '<td class="vline"><img src="'. $this->getSkinUrl('images/spacer.gif') .'" alt=""/></td>';
182
+ }
183
+ }
184
+ $x++;
185
+ }
186
+ }
187
+ ?>
188
+ </tr>
189
+ <?php
190
}
191
+ ?>
192
+ </table>
193
+ <?php endif; ?>
package.xml CHANGED
@@ -1,7 +1,7 @@
1
<?xml version="1.0"?>
2
<package>
3
<name>Bestseller_products</name>
4
- <version>1.1.3</version>
5
<stability>stable</stability>
6
<license uri="http://opensource.org/licenses/osl-3.0.php">OSL 3.0</license>
7
<channel>community</channel>
@@ -10,9 +10,9 @@
10
<description>This extension is display best seller product.</description>
11
<notes>Best Seller</notes>
12
<authors><author><name>Capacity Web Solutions</name><user>capacitywebsolutions</user><email>magento@capacitywebsolutions.com</email></author></authors>
13
- <date>2013-12-31</date>
14
- <time>09:51:47</time>
15
- <contents><target name="magecommunity"><dir name="CapacityWebSolutions"><dir name="Bestseller"><dir name="Block"><file name="Bestseller.php" hash="f093834ec19c9d52cad2e1894510c539"/></dir><dir name="Helper"><file name="Data.php" hash="4f32df17e74aa95c488782c3d6cf0286"/></dir><dir name="controllers"><file name="IndexController.php" hash="a9d5c5fde53e96b28272fbb59a6fefe9"/></dir><dir name="etc"><file name="config.xml" hash="4442fe49feb8c2d85f47dca490416d81"/><file name="system.xml" hash="c424576d1ef1ae368bb26323abde2e33"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="template"><dir name="bestseller"><file name="bestseller.phtml" hash="255726be101f48d4cd14278c5a1938a4"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="CapacityWebSolutions_Bestseller.xml" hash="2da8de0fa3abb8b91292f66ceb23bc33"/></dir></target></contents>
16
<compatible/>
17
<dependencies><required><php><min>5.0.0</min><max>5.5.5</max></php></required></dependencies>
18
</package>
1
<?xml version="1.0"?>
2
<package>
3
<name>Bestseller_products</name>
4
+ <version>1.1.4</version>
5
<stability>stable</stability>
6
<license uri="http://opensource.org/licenses/osl-3.0.php">OSL 3.0</license>
7
<channel>community</channel>
10
<description>This extension is display best seller product.</description>
11
<notes>Best Seller</notes>
12
<authors><author><name>Capacity Web Solutions</name><user>capacitywebsolutions</user><email>magento@capacitywebsolutions.com</email></author></authors>
13
+ <date>2014-01-30</date>
14
+ <time>07:01:52</time>
15
+ <contents><target name="magecommunity"><dir name="CapacityWebSolutions"><dir name="Bestseller"><dir name="Block"><file name="Bestseller.php" hash="f093834ec19c9d52cad2e1894510c539"/></dir><dir name="Helper"><file name="Data.php" hash="4f32df17e74aa95c488782c3d6cf0286"/></dir><dir name="controllers"><file name="IndexController.php" hash="a9d5c5fde53e96b28272fbb59a6fefe9"/></dir><dir name="etc"><file name="config.xml" hash="c8d09a7c20b23f329d41be5e1d89d367"/><file name="system.xml" hash="094abb0a44915e9c3bac76cf1cae06a6"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="template"><dir name="bestseller"><file name="bestseller.phtml" hash="2a4ca03121d0e3445758117244e6f9ad"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="CapacityWebSolutions_Bestseller.xml" hash="2da8de0fa3abb8b91292f66ceb23bc33"/></dir></target></contents>
16
<compatible/>
17
<dependencies><required><php><min>5.0.0</min><max>5.5.5</max></php></required></dependencies>
18
</package>