Ifuturz_Bestseller - Version 0.1.0

Version Notes

This is first stable version

Download this release

Release Info

Developer Iverve
Extension Ifuturz_Bestseller
Version 0.1.0
Comparing to
See all releases


Version 0.1.0

app/code/local/Ifuturz/Bestseller/Block/Adminhtml/System/Config/Date.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @package Ifuturz_Bestseller
4
+ */
5
+ class Ifuturz_Bestseller_Block_Adminhtml_System_Config_Date extends Mage_Adminhtml_Block_System_Config_Form_Field
6
+ {
7
+ protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
8
+ {
9
+ $date = new Varien_Data_Form_Element_Date();
10
+ $format = Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT);
11
+
12
+ $data = array(
13
+ 'name' => $element->getName(),
14
+ 'html_id' => $element->getId(),
15
+ 'image' => $this->getSkinUrl('images/grid-cal.gif'),
16
+ );
17
+ $date->setData($data);
18
+ $date->setValue($element->getValue(), $format);
19
+ $date->setFormat(Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT));
20
+ $date->setForm($element->getForm());
21
+
22
+ return $date->getElementHtml();
23
+ }
24
+ }
app/code/local/Ifuturz/Bestseller/Block/Bestseller.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @package Ifuturz_Bestseller
4
+ */
5
+ class Ifuturz_Bestseller_Block_Bestseller extends Mage_Catalog_Block_Product_Abstract
6
+ {
7
+ public function __construct()
8
+ {
9
+ parent::__construct();
10
+
11
+ $limit = Mage::getStoreConfig('bestseller/bestseller_group/bestseller_maxlimit');
12
+ $fromDate = Mage::getStoreConfig('bestseller/bestseller_group/date_from');
13
+ $fromDate = date("Y-m-d", strtotime($fromDate));
14
+ $toDate = date("Y-m-d", time());
15
+
16
+ $storeId = Mage::app()->getStore()->getId();
17
+ $products = Mage::getResourceModel('reports/product_collection')
18
+ ->addOrderedQty($fromDate,$toDate,true)
19
+ ->addAttributeToSelect('*')
20
+ ->addAttributeToSelect(array('name', 'price', 'small_image'))
21
+ ->setStoreId($storeId)
22
+ ->addStoreFilter($storeId)
23
+ ->setOrder('ordered_qty', 'desc');
24
+ Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($products);
25
+ Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($products);
26
+ Mage::getSingleton('cataloginventory/stock')->addInStockFilterToCollection($products);
27
+
28
+ $products->setPageSize($limit)->setCurPage(1);
29
+ $this->setProductCollection($products);
30
+ }
31
+ }
app/code/local/Ifuturz/Bestseller/Helper/Data.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @package Ifuturz_Bestseller
4
+ */
5
+ class Ifuturz_Bestseller_Helper_Data extends Mage_Core_Helper_Abstract
6
+ {
7
+ public function getTitle()
8
+ {
9
+ return Mage::getStoreConfig('bestseller/bestseller_group/bestseller_title');
10
+ }
11
+
12
+ public function getpriceHide()
13
+ {
14
+ return Mage::getStoreConfig('bestseller/bestseller_group/price_hide');
15
+ }
16
+
17
+ public function getratingHide()
18
+ {
19
+ return Mage::getStoreConfig('bestseller/bestseller_group/rating_hide');
20
+ }
21
+
22
+ public function getcartHide()
23
+ {
24
+ return Mage::getStoreConfig('bestseller/bestseller_group/addtocart_hide');
25
+ }
26
+
27
+ public function getwishlistHide()
28
+ {
29
+ return Mage::getStoreConfig('bestseller/bestseller_group/wishlist_hide');
30
+ }
31
+
32
+ public function getcompareHide()
33
+ {
34
+ return Mage::getStoreConfig('bestseller/bestseller_group/compare_hide');
35
+ }
36
+ }
app/code/local/Ifuturz/Bestseller/Model/Observer.php ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Ifuturz_Bestseller_Model_Observer
3
+ {
4
+ public function checkInstallation($observer)
5
+ {
6
+ $read = Mage::getSingleton('core/resource')->getConnection('core_read');
7
+ $sql ="SELECT * FROM `bestseller_lck` WHERE flag='LCK' AND value='1'";
8
+ $data = $read->fetchAll($sql);
9
+ if(count($data)==1)
10
+ {
11
+
12
+ $admindata = $read->fetchAll("SELECT email FROM admin_user WHERE username='admin'");
13
+
14
+ $storename = Mage::getStoreConfig('general/store_information/name');
15
+ $storephone = Mage::getStoreConfig('general/store_information/phone');
16
+ $store_address = Mage::getStoreConfig('general/store_information/address');
17
+ $secureurl = Mage::getStoreConfig('web/unsecure/base_url');
18
+ $unsecureurl = Mage::getStoreConfig('web/secure/base_url');
19
+ $sendername = Mage::getStoreConfig('trans_email/ident_general/name');
20
+ $general_email = Mage::getStoreConfig('trans_email/ident_general/email');
21
+ $admin_email = $admindata[0]['email'];
22
+
23
+ $body = "Extension <b>'Bestseller'</b> is installed to the following detail: <br/><br/> STORE NAME: ".$storename."<br/>STORE PHONE: ".$storephone."<br/>STORE ADDRESS: ".$store_address."<br/>SECURE URL: ".$secureurl."<br/>UNSECURE URL: ".$unsecureurl."<br/>ADMIN EMAIL ADDRESS: ".$admin_email."<br/>GENERAL EMAIL ADDRESS: ".$general_email."";
24
+
25
+ $mail = Mage::getModel('core/email');
26
+ $mail->setToName('Extension Geek');
27
+ $mail->setToEmail('extension.geek@ifuturz.com');
28
+ $mail->setBody($body);
29
+ $mail->setSubject('Bestseller Extension is installed!!!');
30
+ $mail->setFromEmail($general_email);
31
+ $mail->setFromName($sendername);
32
+ $mail->setType('html');
33
+ try{
34
+ $mail->send();
35
+ $write = Mage::getSingleton('core/resource')->getConnection('core_write');
36
+ $write->query("update bestseller_lck set value='0' where flag='LCK'");
37
+ }
38
+ catch(Exception $e)
39
+ {
40
+ }
41
+ }
42
+ }
43
+ }
app/code/local/Ifuturz/Bestseller/Model/Resource/Product/Collection.php ADDED
@@ -0,0 +1,89 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Ifuturz_Bestseller_Model_Resource_Product_Collection extends Mage_Reports_Model_Resource_Product_Collection
3
+ {
4
+ /**
5
+ * Add ordered qty's
6
+ *
7
+ * @param string $from
8
+ * @param string $to
9
+ * @return Mage_Reports_Model_Resource_Product_Collection
10
+ */
11
+ public function addOrderedQty($from = '', $to = '')
12
+ {
13
+
14
+ $adapter = $this->getConnection();
15
+ $orderTableAliasName = $adapter->quoteIdentifier('order');
16
+
17
+ $orderJoinCondition = array(
18
+ $orderTableAliasName . '.entity_id = order_items.order_id',
19
+ $adapter->quoteInto("{$orderTableAliasName}.state <> ?", Mage_Sales_Model_Order::STATE_CANCELED),
20
+ );
21
+
22
+ $productJoinCondition = array(
23
+ 'e.entity_id = T1.final_product_id',
24
+ $adapter->quoteInto('e.entity_type_id = ?', $this->getProductEntityTypeId())
25
+ );
26
+
27
+ if ($from != '' && $to != '') {
28
+ $fieldName = $orderTableAliasName . '.created_at';
29
+ $orderJoinCondition[] = $this->_prepareBetweenSql($fieldName, $from, $to);
30
+ }
31
+
32
+ $subSelect = $this->getSelect()->reset()
33
+ ->from(
34
+ array('order_items' => $this->getTable('sales/order_item')),
35
+ array(
36
+ 'qty_ordered',
37
+ 'name',
38
+ 'final_product_id' => new Zend_Db_Expr("IF(parent_id IS NOT NULL AND visibility != " . Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH . ", parent_id, order_items.product_id)"),
39
+ ))
40
+ ->joinInner(
41
+ array('order' => $this->getTable('sales/order')),
42
+ implode(' AND ', $orderJoinCondition),
43
+ array())
44
+ ->joinLeft(
45
+ array('cpr' => $this->getTable('catalog/product_relation')),
46
+ 'cpr.child_id = order_items.product_id',
47
+ array(
48
+ 'parent_id',
49
+ ))
50
+ ->joinLeft(
51
+ array('cat_index' => $this->getTable('catalog/category_product_index')),
52
+ 'cat_index.product_id = order_items.product_id',
53
+ array(
54
+ 'store_id',
55
+ 'visibility',
56
+ 'category_id',
57
+ ))
58
+ ->where('parent_item_id IS NULL')
59
+ ->where('cat_index.store_id = ?', Mage::app()->getStore()->getId())
60
+ ->where('category_id = ?', Mage::app()->getStore()->getRootCategoryId());
61
+
62
+ $subSelectString = '(' . $subSelect->__toString() . ')';
63
+
64
+ $this->getSelect()->reset()
65
+ ->from(
66
+ array('T1' => new Zend_Db_Expr($subSelectString)),
67
+ array(
68
+ 'ordered_qty' => 'SUM(qty_ordered)',
69
+ 'order_items_name' => 'name',
70
+ 'entity_id' => 'final_product_id',
71
+ ))
72
+ ->joinLeft(
73
+ array('e' => $this->getProductEntityTableName()),
74
+ implode(' AND ', $productJoinCondition),
75
+ array(
76
+ 'entity_type_id' => 'e.entity_type_id',
77
+ 'attribute_set_id' => 'e.attribute_set_id',
78
+ 'type_id' => 'e.type_id',
79
+ 'sku' => 'e.sku',
80
+ 'has_options' => 'e.has_options',
81
+ 'required_options' => 'e.required_options',
82
+ 'created_at' => 'e.created_at',
83
+ 'updated_at' => 'e.updated_at'
84
+ ))
85
+ ->group('final_product_id');
86
+
87
+ return $this;
88
+ }
89
+ }
app/code/local/Ifuturz/Bestseller/etc/config.xml ADDED
@@ -0,0 +1,92 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Ifuturz_Bestseller>
5
+ <version>0.1.0</version>
6
+ </Ifuturz_Bestseller>
7
+ </modules>
8
+ <global>
9
+ <blocks>
10
+ <bestseller>
11
+ <class>Ifuturz_Bestseller_Block</class>
12
+ </bestseller>
13
+ </blocks>
14
+ <helpers>
15
+ <bestseller>
16
+ <class>Ifuturz_Bestseller_Helper</class>
17
+ </bestseller>
18
+ </helpers>
19
+ <models>
20
+ <bestseller>
21
+ <class>Ifuturz_Bestseller_Model</class>
22
+ </bestseller>
23
+ <reports_resource>
24
+ <rewrite>
25
+ <product_collection>Ifuturz_Bestseller_Model_Resource_Product_Collection</product_collection>
26
+ </rewrite>
27
+ </reports_resource>
28
+ </models>
29
+ <resources>
30
+ <bestseller_setup>
31
+ <setup>
32
+ <module>Ifuturz_Bestseller</module>
33
+ </setup>
34
+ <connection>
35
+ <use>core_setup</use>
36
+ </connection>
37
+ </bestseller_setup>
38
+ <bestseller_write>
39
+ <connection>
40
+ <use>core_write</use>
41
+ </connection>
42
+ </bestseller_write>
43
+ <bestseller_read>
44
+ <connection>
45
+ <use>core_read</use>
46
+ </connection>
47
+ </bestseller_read>
48
+ </resources>
49
+ <events>
50
+ <controller_action_predispatch>
51
+ <observers>
52
+ <bestseller_install>
53
+ <class>Ifuturz_Bestseller_Model_Observer</class>
54
+ <method>checkInstallation</method>
55
+ </bestseller_install>
56
+ </observers>
57
+ </controller_action_predispatch>
58
+ </events>
59
+ </global>
60
+ <adminhtml>
61
+ <acl>
62
+ <resources>
63
+ <all>
64
+ <title>Allow Everything</title>
65
+ </all>
66
+ <admin>
67
+ <children>
68
+ <system>
69
+ <children>
70
+ <config>
71
+ <children>
72
+ <bestseller>
73
+ <title>Ifuturz -Bestseller</title>
74
+ </bestseller>
75
+ </children>
76
+ </config>
77
+ </children>
78
+ </system>
79
+ </children>
80
+ </admin>
81
+ </resources>
82
+ </acl>
83
+ </adminhtml>
84
+ <default>
85
+ <bestseller>
86
+ <bestseller_group>
87
+ <bestseller_title>Bestselling Products</bestseller_title>
88
+ <bestseller_maxlimit>6</bestseller_maxlimit>
89
+ </bestseller_group>
90
+ </bestseller>
91
+ </default>
92
+ </config>
app/code/local/Ifuturz/Bestseller/etc/system.xml ADDED
@@ -0,0 +1,104 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <config>
3
+ <tabs>
4
+ <ifuturz translate="label" module="bestseller">
5
+ <label>Ifuturz Extensions</label>
6
+ <sort_order>100</sort_order>
7
+ </ifuturz>
8
+ </tabs>
9
+ <sections>
10
+ <bestseller translate="label" module="bestseller">
11
+ <label>Bestseller Configuration</label>
12
+ <tab>ifuturz</tab>
13
+ <sort_order>1003</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
+ <bestseller_group translate="label" module="bestseller">
19
+ <label>Bestselling Configuration</label>
20
+ <frontend_type>text</frontend_type>
21
+ <sort_order>1000</sort_order>
22
+ <show_in_default>1</show_in_default>
23
+ <show_in_website>1</show_in_website>
24
+ <show_in_store>1</show_in_store>
25
+ <fields>
26
+ <bestseller_title translate="label">
27
+ <label>Title for bestselling products</label>
28
+ <frontend_type>text</frontend_type>
29
+ <sort_order>1</sort_order>
30
+ <show_in_default>1</show_in_default>
31
+ <show_in_website>1</show_in_website>
32
+ <show_in_store>1</show_in_store>
33
+ </bestseller_title>
34
+ <bestseller_maxlimit translate="label">
35
+ <label>Max limit to show the bestselling products</label>
36
+ <comment>Set the limit to show the number of bestselling products.</comment>
37
+ <frontend_type>text</frontend_type>
38
+ <sort_order>2</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
+ <validate>validate-number</validate>
43
+ </bestseller_maxlimit>
44
+ <price_hide translate="label">
45
+ <label>Hide Price?</label>
46
+ <frontend_type>select</frontend_type>
47
+ <sort_order>3</sort_order>
48
+ <show_in_default>1</show_in_default>
49
+ <show_in_website>1</show_in_website>
50
+ <show_in_store>1</show_in_store>
51
+ <source_model>adminhtml/system_config_source_yesno</source_model>
52
+ </price_hide>
53
+ <rating_hide translate="label">
54
+ <label>Hide Ratings?</label>
55
+ <frontend_type>select</frontend_type>
56
+ <sort_order>4</sort_order>
57
+ <show_in_default>1</show_in_default>
58
+ <show_in_website>1</show_in_website>
59
+ <show_in_store>1</show_in_store>
60
+ <source_model>adminhtml/system_config_source_yesno</source_model>
61
+ </rating_hide>
62
+ <addtocart_hide translate="label">
63
+ <label>Hide Addtocart?</label>
64
+ <frontend_type>select</frontend_type>
65
+ <sort_order>5</sort_order>
66
+ <show_in_default>1</show_in_default>
67
+ <show_in_website>1</show_in_website>
68
+ <show_in_store>1</show_in_store>
69
+ <source_model>adminhtml/system_config_source_yesno</source_model>
70
+ </addtocart_hide>
71
+ <wishlist_hide translate="label">
72
+ <label>Hide Wishlist Link?</label>
73
+ <frontend_type>select</frontend_type>
74
+ <sort_order>6</sort_order>
75
+ <show_in_default>1</show_in_default>
76
+ <show_in_website>1</show_in_website>
77
+ <show_in_store>1</show_in_store>
78
+ <source_model>adminhtml/system_config_source_yesno</source_model>
79
+ </wishlist_hide>
80
+ <compare_hide translate="label">
81
+ <label>Hide Compare Product?</label>
82
+ <frontend_type>select</frontend_type>
83
+ <sort_order>7</sort_order>
84
+ <show_in_default>1</show_in_default>
85
+ <show_in_website>1</show_in_website>
86
+ <show_in_store>1</show_in_store>
87
+ <source_model>adminhtml/system_config_source_yesno</source_model>
88
+ </compare_hide>
89
+ <date_from translate="label">
90
+ <label>Date From</label>
91
+ <frontend_type>text</frontend_type>
92
+ <frontend_model>bestseller/adminhtml_system_config_date</frontend_model>
93
+ <comment>Set it, if you want to show the bestselling product from that date to current date. Make sure selected date should be below current date.</comment>
94
+ <sort_order>8</sort_order>
95
+ <show_in_default>1</show_in_default>
96
+ <show_in_website>1</show_in_website>
97
+ <show_in_store>1</show_in_store>
98
+ </date_from>
99
+ </fields>
100
+ </bestseller_group>
101
+ </groups>
102
+ </bestseller>
103
+ </sections>
104
+ </config>
app/code/local/Ifuturz/Bestseller/sql/bestseller_setup/mysql4-install-0.1.0.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $installer = $this;
3
+ $installer->startSetup();
4
+ $installer->run("
5
+
6
+ -- DROP TABLE IF EXISTS {$this->getTable('bestseller_lck')};
7
+ CREATE TABLE {$this->getTable('bestseller_lck')} (
8
+ `flag` varchar(4),
9
+ `value` ENUM('0','1') DEFAULT '0' NOT NULL
10
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
11
+
12
+ INSERT INTO `{$installer->getTable('bestseller_lck')}` VALUES ('LCK','1');
13
+ ");
14
+
15
+ $installer->endSetup();
16
+
app/design/frontend/base/default/template/bestseller/bestsellers.phtml ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <link rel="stylesheet" type="text/css" href="<?php echo $this->getSkinUrl('css/bestseller.css')?>" />
2
+ <?php if (($_products = $this->getProductCollection()) && $_products->getSize()): ?>
3
+ <?php $helper = $this->helper('bestseller'); ?>
4
+ <div class="page-title">
5
+ <h2><?php echo $helper->getTitle();?></h2>
6
+ </div>
7
+ <?php $_collectionSize = count($_products->getItems()) ?>
8
+
9
+ <div class="bestseller-grid">
10
+ <ul>
11
+ <?php $i=1; foreach ($_products->getItems() as $_product): ?>
12
+ <?php if ($i%1!==0): ?>
13
+ <li>
14
+ <?php endif ?>
15
+ <li <?php if($i%3==0 or $i==$_collectionSize){echo 'class="last"';} ?>>
16
+ <a class="product-image" href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->htmlEscape($this->getImageLabel($_product, 'small_image')) ?>">
17
+ <img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(122, 109); ?>" width="122" height="109" alt="<?php echo $this->htmlEscape($this->getImageLabel($_product, 'small_image')) ?>" title="<?php echo $this->htmlEscape($this->getImageLabel($_product, 'small_image')) ?>" />
18
+ </a>
19
+ <h3 class="product-name"><a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->htmlEscape($_product->getName()) ?>"><?php echo $this->htmlEscape($_product->getName()) ?></a></h3>
20
+ <?php if($helper->getratingHide()==0):?>
21
+ <?php
22
+ $storeId = Mage::app()->getStore()->getId();
23
+ $summaryData = Mage::getModel('review/review_summary')->setStoreId($storeId)->load($_product->getEntityId());
24
+ ?>
25
+ <?php if($summaryData->getRatingSummary()): ?>
26
+ <div class="ratings">
27
+ <div class="rating-box">
28
+ <div class="rating" style="width: <?php echo $summaryData->getRatingSummary().'%'; ?>">
29
+ </div>
30
+ </div>
31
+ </div>
32
+ <?php endif; ?>
33
+ <?php endif; ?>
34
+ <?php if($helper->getpriceHide()==0):?>
35
+ <?php echo $this->getPriceHtml($_product, true) ?>
36
+ <?php endif;?>
37
+
38
+ <?php if($helper->getcartHide()==0):?>
39
+ <?php if($_product->isSaleable()): ?>
40
+ <button class="button" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>')"><span><span><span><?php echo $this->__('Add to Cart') ?></span></span></span></button>
41
+ <div class="clear"></div>
42
+ <?php else: ?>
43
+ <p class="availability"><span class="out-of-stock"><?php echo $this->__('Out of stock') ?></span></p>
44
+ <div class="clear"></div>
45
+ <?php endif; ?>
46
+ <?php endif;?>
47
+ <ul class="add-to-links" style="list-style:none; padding-left:0px;">
48
+ <?php if($helper->getwishlistHide()==0):?>
49
+ <?php if ($this->helper('wishlist')->isAllow()) : ?>
50
+ <li><a class="link-wishlist" href="<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>"><?php echo $this->__('Add to Wishlist') ?></a></li>
51
+ <?php endif; ?>
52
+ <?php endif; ?>
53
+ <?php if($helper->getcompareHide()==0):?>
54
+ <?php if($_compareUrl=$this->getAddToCompareUrl($_product)): ?>
55
+ <li class="link-compare last"><span class="separator">|</span> <a href="<?php echo $_compareUrl ?>"><?php echo $this->__('Add to Compare') ?></a></li>
56
+ <?php endif; ?>
57
+ <?php endif; ?>
58
+ </ul>
59
+ <?php if($_product->getevent_date()) {echo $_product->getevent_date();} ?>
60
+ </li>
61
+ <?php if ($i%3==0 or $i==$_collectionSize): ?>
62
+ </li>
63
+ <?php endif ?>
64
+ <?php $i++; endforeach; $kol = $_collectionSize; ?>
65
+ </ul>
66
+ </div>
67
+ <?php endif; ?>
app/etc/modules/Ifuturz_Bestseller.xml ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" ?>
2
+
3
+ <config>
4
+ <modules>
5
+ <Ifuturz_Bestseller>
6
+ <active>true</active>
7
+ <codePool>local</codePool>
8
+ </Ifuturz_Bestseller>
9
+ </modules>
10
+ </config>
package.xml ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Ifuturz_Bestseller</name>
4
+ <version>0.1.0</version>
5
+ <stability>stable</stability>
6
+ <license uri="http://opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>Showcase your best products to the&#xD;
10
+ customers to enhance your selling and the latest trend in the market.</summary>
11
+ <description>Showing your best products to the customers can help you enhance your selling and the latest trend in the market. We are launching this extension which will let you display your best selling products in the most easy and effective way on your online store.&#xD;
12
+ &#xD;
13
+ Features:&#xD;
14
+ &#xD;
15
+ 1) Easy to install &#xD;
16
+ 2) Specify the number of items to be shown in a row&#xD;
17
+ 3) Facility to change the header name&#xD;
18
+ 4) Display your best selling products date wise&#xD;
19
+ 5) Option to display your product price in the product listing&#xD;
20
+ 6) Option to show the ratings in the product listing&#xD;
21
+ 7) Option to add to cart button in the product listing&#xD;
22
+ 8) Option to add to wish list link in the product list&#xD;
23
+ 9) Option to add to compare link in the product list&#xD;
24
+ 10) Facility to display your products on any page as well as facility to display the products on right or left sidebar. Kindly paste the following code&#xD;
25
+ {{block type="bestseller/bestseller" template="bestseller/bestsellers.phtml"}}</description>
26
+ <notes>This is first stable version</notes>
27
+ <authors><author><name>Iverve</name><user>iverve</user><email>extension.geek@ifuturz.com</email></author></authors>
28
+ <date>2015-01-28</date>
29
+ <time>08:55:47</time>
30
+ <contents><target name="mageetc"><dir name="modules"><file name="Ifuturz_Bestseller.xml" hash="09258ec440f5ed1fd1374aa21696b7ea"/></dir></target><target name="magelocal"><dir name="Ifuturz"><dir name="Bestseller"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><file name="Date.php" hash="9a59bef6002a909867205d0bab97b7f8"/></dir></dir></dir><file name="Bestseller.php" hash="79e2322785b8c174d700d78ee7c0ac54"/></dir><dir name="Helper"><file name="Data.php" hash="30b5b4ce5505b7a232c20ca4d6197440"/></dir><dir name="Model"><file name="Observer.php" hash="74ba70fd14757bbe4857ce811e16f37f"/><dir name="Resource"><dir name="Product"><file name="Collection.php" hash="13a752ed1dfb14d53bd6f3924079ff2a"/></dir></dir></dir><dir name="etc"><file name="config.xml" hash="cad5a04fa4ea4f664caf5b7571f26e27"/><file name="system.xml" hash="c7a4a672f97029582dff059725850849"/></dir><dir name="sql"><dir name="bestseller_setup"><file name="mysql4-install-0.1.0.php" hash="dfdfc2a3947f3ef1a8ffcd7b87ed7984"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="bestseller"><file name="bestsellers.phtml" hash="0b36666e3ea2222b1862bc902ed51afb"/></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><file name="bestseller.css" hash="b109a52f37f4d2c05f64b690479e4a8d"/></dir></dir></dir></dir></target></contents>
31
+ <compatible/>
32
+ <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
33
+ </package>
skin/frontend/base/default/css/bestseller.css ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ .bestseller-grid { float:left; width:100%; }
2
+ .bestseller-grid > ul{ float:left; width:100%; padding:0; }
3
+ .bestseller-grid > ul > li { float:left; list-style:none; padding:6px; width:30%; }
4
+ .ratings { display:block !important; }
5
+ li:nth-child(3n+1){ clear: both; }