Etatvasoft_5_In_one_catalog - Version 1.1.1

Version Notes

Homepage is the main visual part of any website. It's very important to show some meaningful

Download this release

Release Info

Developer Etatvasoft
Extension Etatvasoft_5_In_one_catalog
Version 1.1.1
Comparing to
See all releases


Version 1.1.1

Files changed (32) hide show
  1. app/code/local/Tatva/Catalogextensions/Block/Allproducts/List.php +65 -0
  2. app/code/local/Tatva/Catalogextensions/Block/Bestsellers/Home/List.php +68 -0
  3. app/code/local/Tatva/Catalogextensions/Block/Bestsellers/List.php +61 -0
  4. app/code/local/Tatva/Catalogextensions/Block/Catalogextensions.php +17 -0
  5. app/code/local/Tatva/Catalogextensions/Block/Featured/Home/List.php +67 -0
  6. app/code/local/Tatva/Catalogextensions/Block/Featured/List.php +60 -0
  7. app/code/local/Tatva/Catalogextensions/Block/Mostviewed/Home/List.php +68 -0
  8. app/code/local/Tatva/Catalogextensions/Block/Mostviewed/List.php +61 -0
  9. app/code/local/Tatva/Catalogextensions/Block/Newproduct/Home/List.php +104 -0
  10. app/code/local/Tatva/Catalogextensions/Block/Newproduct/List.php +91 -0
  11. app/code/local/Tatva/Catalogextensions/Helper/Data.php +6 -0
  12. app/code/local/Tatva/Catalogextensions/Model/Catalogextensions.php +10 -0
  13. app/code/local/Tatva/Catalogextensions/Model/Mysql4/Catalogextensions.php +10 -0
  14. app/code/local/Tatva/Catalogextensions/Model/Mysql4/Catalogextensions/Collection.php +10 -0
  15. app/code/local/Tatva/Catalogextensions/Model/Status.php +15 -0
  16. app/code/local/Tatva/Catalogextensions/Model/source/type/type.php +30 -0
  17. app/code/local/Tatva/Catalogextensions/controllers/IndexController.php +126 -0
  18. app/code/local/Tatva/Catalogextensions/etc/adminhtml.xml +29 -0
  19. app/code/local/Tatva/Catalogextensions/etc/config.xml +147 -0
  20. app/code/local/Tatva/Catalogextensions/etc/system.xml +203 -0
  21. app/code/local/Tatva/Catalogextensions/sql/catalogextensions_setup/mysql4-install-0.1.0.php +33 -0
  22. app/design/frontend/default/default/layout/catalogextensions/catalogextensions.xml +59 -0
  23. app/design/frontend/default/default/template/catalogextensions/home_bestsellers.phtml +47 -0
  24. app/design/frontend/default/default/template/catalogextensions/home_featured.phtml +47 -0
  25. app/design/frontend/default/default/template/catalogextensions/home_mostviewed.phtml +47 -0
  26. app/design/frontend/default/default/template/catalogextensions/home_newproduct.phtml +47 -0
  27. app/design/frontend/default/default/template/catalogextensions/newrecent.phtml +134 -0
  28. app/etc/modules/Tatva_Catalogextensions.xml +9 -0
  29. package.xml +18 -0
  30. skin/frontend/default/default/css/catalogextensions/catalogextensions.css +57 -0
  31. skin/frontend/default/default/images/catalogextensions/greyboxbg.gif +0 -0
  32. skin/frontend/default/default/images/catalogextensions/verticledivider.jpg +0 -0
app/code/local/Tatva/Catalogextensions/Block/Allproducts/List.php ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ * To change this template, choose Tools | Templates
5
+ * and open the template in the editor.
6
+ */
7
+
8
+ /**
9
+ * Description of List
10
+ *
11
+ * @author om
12
+ */
13
+ class Tatva_Catalogextensions_Block_Allproducts_List extends Mage_Catalog_Block_Product_List {
14
+
15
+ protected function _getProductCollection()
16
+ {
17
+ parent::__construct();
18
+
19
+ $storeId = Mage::app()->getStore()->getId();
20
+ $products = Mage::getModel('catalog/product')->getCollection()
21
+ ->addAttributeToSelect('*')
22
+ ->setStoreId($storeId)
23
+ ->addStoreFilter($storeId)
24
+ ->setPageSize($this->get_prod_count())
25
+ ->addAttributeToSort($this->get_order(), $this->get_order_dir())
26
+ ->setCurPage($this->get_cur_page());
27
+
28
+ Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($products);
29
+ Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($products);
30
+ Mage::getSingleton('cataloginventory/stock')->addInStockFilterToCollection($products);
31
+
32
+ $this->_productCollection = $products;
33
+
34
+ return $this->_productCollection;
35
+ }
36
+
37
+ function get_order()
38
+ {
39
+ //unset any saved limits
40
+ return (isset($_REQUEST['order'])) ? $_REQUEST['order'] : "entity_id";
41
+ }// get_prod_count
42
+
43
+ function get_order_dir()
44
+ {
45
+ //unset any saved limits
46
+ return (isset($_REQUEST['dir'])) ? $_REQUEST['dir'] : "asc";
47
+ }// get_prod_count
48
+
49
+
50
+ function get_prod_count()
51
+ {
52
+ //unset any saved limits
53
+ Mage::getSingleton('catalog/session')->unsLimitPage();
54
+ return (isset($_REQUEST['limit'])) ? intval($_REQUEST['limit']) : 12;
55
+ }// get_prod_count
56
+
57
+ function get_cur_page()
58
+ {
59
+ return (isset($_REQUEST['p'])) ? intval($_REQUEST['p']) : 1;
60
+ }// get_cur_page
61
+
62
+
63
+ }
64
+
65
+ ?>
app/code/local/Tatva/Catalogextensions/Block/Bestsellers/Home/List.php ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ * To change this template, choose Tools | Templates
5
+ * and open the template in the editor.
6
+ */
7
+
8
+ /**
9
+ * Description of List
10
+ *
11
+ * @author om
12
+ */
13
+ class Tatva_Catalogextensions_Block_Bestsellers_Home_List extends Tatva_Catalogextensions_Block_Bestsellers_List
14
+ {
15
+
16
+ protected function _getProductCollection()
17
+ {
18
+ parent::__construct();
19
+ $storeId = Mage::app()->getStore()->getId();
20
+ $products = Mage::getResourceModel('reports/product_collection')
21
+ ->addOrderedQty()
22
+ ->addAttributeToSelect('*')
23
+ ->setStoreId($storeId)
24
+ ->addStoreFilter($storeId)
25
+ ->setOrder('ordered_qty', 'desc');
26
+
27
+ if(Mage::getStoreConfig('catalogextensions/config1/max_product'))
28
+ {
29
+ $products->setPageSize(Mage::getStoreConfig('catalogextensions/config1/max_product'));
30
+ }
31
+
32
+
33
+ Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($products);
34
+ Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($products);
35
+ Mage::getSingleton('cataloginventory/stock')->addInStockFilterToCollection($products);
36
+
37
+ $this->_productCollection = $products;
38
+
39
+ return $this->_productCollection;
40
+ }
41
+
42
+ function get_prod_count()
43
+ {
44
+ //unset any saved limits
45
+ Mage::getSingleton('catalog/session')->unsLimitPage();
46
+ return (isset($_REQUEST['limit'])) ? intval($_REQUEST['limit']) : 9;
47
+ }// get_prod_count
48
+
49
+ function get_cur_page()
50
+ {
51
+ return (isset($_REQUEST['p'])) ? intval($_REQUEST['p']) : 1;
52
+ }// get_cur_page
53
+
54
+ function get_order()
55
+ {
56
+ return (isset($_REQUEST['order'])) ? ($_REQUEST['order']) : 'ordered_qty';
57
+ }// get_order
58
+
59
+ function get_order_dir()
60
+ {
61
+ return (isset($_REQUEST['dir'])) ? ($_REQUEST['dir']) : 'desc';
62
+ }// get_direction
63
+
64
+ public function getToolbarHtml()
65
+ {
66
+
67
+ }
68
+ }
app/code/local/Tatva/Catalogextensions/Block/Bestsellers/List.php ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ * To change this template, choose Tools | Templates
5
+ * and open the template in the editor.
6
+ */
7
+
8
+ /**
9
+ * Description of List
10
+ *
11
+ * @author om
12
+ */
13
+ class Tatva_Catalogextensions_Block_Bestsellers_List extends Mage_Catalog_Block_Product_List
14
+ {
15
+ protected function _getProductCollection()
16
+ {
17
+ parent::__construct();
18
+ $storeId = Mage::app()->getStore()->getId();
19
+ $products = Mage::getResourceModel('reports/product_collection')
20
+ ->addOrderedQty()
21
+ ->addAttributeToSelect('*')
22
+ ->setStoreId($storeId)
23
+ ->addStoreFilter($storeId)
24
+ //->setOrder('ordered_qty', 'desc')
25
+ ->setPageSize($this->get_prod_count())
26
+ ->setOrder($this->get_order(), $this->get_order_dir())
27
+ ->setCurPage($this->get_cur_page());
28
+
29
+ Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($products);
30
+ Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($products);
31
+ Mage::getSingleton('cataloginventory/stock')->addInStockFilterToCollection($products);
32
+
33
+ $this->_productCollection = $products;
34
+
35
+ return $this->_productCollection;
36
+ }
37
+
38
+ function get_prod_count()
39
+ {
40
+ //unset any saved limits
41
+ Mage::getSingleton('catalog/session')->unsLimitPage();
42
+ return (isset($_REQUEST['limit'])) ? intval($_REQUEST['limit']) : 9;
43
+ }// get_prod_count
44
+
45
+ function get_cur_page()
46
+ {
47
+ return (isset($_REQUEST['p'])) ? intval($_REQUEST['p']) : 1;
48
+ }// get_cur_page
49
+
50
+ function get_order()
51
+ {
52
+ return (isset($_REQUEST['order'])) ? ($_REQUEST['order']) : 'ordered_qty';
53
+ }// get_order
54
+
55
+ function get_order_dir()
56
+ {
57
+ return (isset($_REQUEST['dir'])) ? ($_REQUEST['dir']) : 'desc';
58
+ }// get_direction
59
+ }
60
+
61
+ ?>
app/code/local/Tatva/Catalogextensions/Block/Catalogextensions.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Tatva_Catalogextensions_Block_Catalogextensions extends Mage_Core_Block_Template
3
+ {
4
+ public function _prepareLayout()
5
+ {
6
+ return parent::_prepareLayout();
7
+ }
8
+
9
+ public function getCatalogextensions()
10
+ {
11
+ if (!$this->hasData('catalogextensions')) {
12
+ $this->setData('catalogextensions', Mage::registry('catalogextensions'));
13
+ }
14
+ return $this->getData('catalogextensions');
15
+
16
+ }
17
+ }
app/code/local/Tatva/Catalogextensions/Block/Featured/Home/List.php ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ * To change this template, choose Tools | Templates
5
+ * and open the template in the editor.
6
+ */
7
+
8
+ /**
9
+ * Description of List
10
+ *
11
+ * @author om
12
+ */
13
+ class Tatva_Catalogextensions_Block_Featured_Home_List extends Tatva_Catalogextensions_Block_Featured_List
14
+ {
15
+ protected function _getProductCollection()
16
+ {
17
+ parent::__construct();
18
+ $storeId = Mage::app()->getStore()->getId();
19
+ $products = Mage::getModel('catalog/product')->getCollection()
20
+ ->addAttributeToFilter(array(array('attribute' => 'featured', 'eq' => '1')))
21
+ ->addAttributeToSelect('*')
22
+ ->addAttributeToSelect(array('name', 'price', 'small_image'))
23
+ ->setStoreId($storeId)
24
+ ->addStoreFilter($storeId);
25
+
26
+ if(Mage::getStoreConfig('catalogextensions/config2/max_product'))
27
+ {
28
+ $products->setPageSize(Mage::getStoreConfig('catalogextensions/config2/max_product'));
29
+ }
30
+
31
+
32
+ Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($products);
33
+ Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($products);
34
+ Mage::getSingleton('cataloginventory/stock')->addInStockFilterToCollection($products);
35
+
36
+ $this->_productCollection = $products;
37
+
38
+ return $this->_productCollection;
39
+ }
40
+
41
+ function get_prod_count()
42
+ {
43
+ //unset any saved limits
44
+ Mage::getSingleton('catalog/session')->unsLimitPage();
45
+ return (isset($_REQUEST['limit'])) ? intval($_REQUEST['limit']) : 9;
46
+ }// get_prod_count
47
+
48
+ function get_cur_page()
49
+ {
50
+ return (isset($_REQUEST['p'])) ? intval($_REQUEST['p']) : 1;
51
+ }// get_cur_page
52
+
53
+ function get_order()
54
+ {
55
+ return (isset($_REQUEST['order'])) ? ($_REQUEST['order']) : 'ordered_qty';
56
+ }// get_order
57
+
58
+ function get_order_dir()
59
+ {
60
+ return (isset($_REQUEST['dir'])) ? ($_REQUEST['dir']) : 'desc';
61
+ }// get_direction
62
+
63
+ public function getToolbarHtml()
64
+ {
65
+
66
+ }
67
+ }
app/code/local/Tatva/Catalogextensions/Block/Featured/List.php ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ * To change this template, choose Tools | Templates
5
+ * and open the template in the editor.
6
+ */
7
+
8
+ /**
9
+ * Description of List
10
+ *
11
+ * @author om
12
+ */
13
+ class Tatva_Catalogextensions_Block_Featured_List extends Mage_Catalog_Block_Product_List
14
+ {
15
+ protected function _getProductCollection()
16
+ {
17
+ parent::__construct();
18
+ $storeId = Mage::app()->getStore()->getId();
19
+ $products = Mage::getModel('catalog/product')->getCollection()
20
+ ->addAttributeToFilter(array(array('attribute' => 'featured', 'eq' => '1')))
21
+ ->addAttributeToSelect('*')
22
+ ->setStoreId($storeId)
23
+ ->addStoreFilter($storeId)
24
+ ->setPageSize($this->get_prod_count())
25
+ ->addAttributeToSort($this->get_order(), $this->get_order_dir())
26
+ ->setCurPage($this->get_cur_page());
27
+
28
+ Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($products);
29
+ Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($products);
30
+ Mage::getSingleton('cataloginventory/stock')->addInStockFilterToCollection($products);
31
+
32
+ $this->_productCollection = $products;
33
+
34
+ return $this->_productCollection;
35
+ }
36
+
37
+ function get_prod_count()
38
+ {
39
+ //unset any saved limits
40
+ Mage::getSingleton('catalog/session')->unsLimitPage();
41
+ return (isset($_REQUEST['limit'])) ? intval($_REQUEST['limit']) : 9;
42
+ }// get_prod_count
43
+
44
+ function get_cur_page()
45
+ {
46
+ return (isset($_REQUEST['p'])) ? intval($_REQUEST['p']) : 1;
47
+ }// get_cur_page
48
+
49
+ function get_order()
50
+ {
51
+ return (isset($_REQUEST['order'])) ? ($_REQUEST['order']) : 'position';
52
+ }// get_order
53
+
54
+ function get_order_dir()
55
+ {
56
+ return (isset($_REQUEST['dir'])) ? ($_REQUEST['dir']) : 'desc';
57
+ }// get_direction
58
+ }
59
+
60
+ ?>
app/code/local/Tatva/Catalogextensions/Block/Mostviewed/Home/List.php ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ * To change this template, choose Tools | Templates
5
+ * and open the template in the editor.
6
+ */
7
+
8
+ /**
9
+ * Description of List
10
+ *
11
+ * @author om
12
+ */
13
+ class Tatva_Catalogextensions_Block_Mostviewed_Home_List extends Tatva_Catalogextensions_Block_Mostviewed_List
14
+ {
15
+
16
+ protected function _getProductCollection()
17
+ {
18
+ parent::__construct();
19
+ $storeId = Mage::app()->getStore()->getId();
20
+ $products = Mage::getResourceModel('reports/product_collection')
21
+ ->addAttributeToSelect('*')
22
+ ->addAttributeToSelect(array('name', 'price', 'small_image'))
23
+ ->setStoreId($storeId)
24
+ ->addStoreFilter($storeId)
25
+ ->addViewsCount();
26
+
27
+ if(Mage::getStoreConfig('catalogextensions/config3/max_product'))
28
+ {
29
+ $products->setPageSize(Mage::getStoreConfig('catalogextensions/config3/max_product'));
30
+ }
31
+
32
+
33
+ Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($products);
34
+ Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($products);
35
+ Mage::getSingleton('cataloginventory/stock')->addInStockFilterToCollection($products);
36
+
37
+ $this->_productCollection = $products;
38
+
39
+ return $this->_productCollection;
40
+ }
41
+
42
+ function get_prod_count()
43
+ {
44
+ //unset any saved limits
45
+ Mage::getSingleton('catalog/session')->unsLimitPage();
46
+ return (isset($_REQUEST['limit'])) ? intval($_REQUEST['limit']) : 9;
47
+ }// get_prod_count
48
+
49
+ function get_cur_page()
50
+ {
51
+ return (isset($_REQUEST['p'])) ? intval($_REQUEST['p']) : 1;
52
+ }// get_cur_page
53
+
54
+ function get_order()
55
+ {
56
+ return (isset($_REQUEST['order'])) ? ($_REQUEST['order']) : 'views';
57
+ }// get_order
58
+
59
+ function get_order_dir()
60
+ {
61
+ return (isset($_REQUEST['dir'])) ? ($_REQUEST['dir']) : 'desc';
62
+ }// get_direction
63
+
64
+ public function getToolbarHtml()
65
+ {
66
+
67
+ }
68
+ }
app/code/local/Tatva/Catalogextensions/Block/Mostviewed/List.php ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ * To change this template, choose Tools | Templates
5
+ * and open the template in the editor.
6
+ */
7
+
8
+ /**
9
+ * Description of List
10
+ *
11
+ * @author om
12
+ */
13
+ class Tatva_Catalogextensions_Block_Mostviewed_List extends Mage_Catalog_Block_Product_List
14
+ {
15
+ protected function _getProductCollection()
16
+ {
17
+ parent::__construct();
18
+ $storeId = Mage::app()->getStore()->getId();
19
+ $products = Mage::getResourceModel('reports/product_collection')
20
+ ->addAttributeToSelect('*')
21
+ ->setStoreId($storeId)
22
+ ->addStoreFilter($storeId)
23
+ ->addViewsCount()
24
+ ->setPageSize($this->get_prod_count())
25
+ ->addAttributeToSort($this->get_order(), $this->get_order_dir())
26
+ ->setCurPage($this->get_cur_page());
27
+
28
+ Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($products);
29
+ Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($products);
30
+ Mage::getSingleton('cataloginventory/stock')->addInStockFilterToCollection($products);
31
+
32
+ $this->_productCollection = $products;
33
+
34
+ return $this->_productCollection;
35
+ }
36
+
37
+
38
+ function get_prod_count()
39
+ {
40
+ //unset any saved limits
41
+ Mage::getSingleton('catalog/session')->unsLimitPage();
42
+ return (isset($_REQUEST['limit'])) ? intval($_REQUEST['limit']) : 9;
43
+ }// get_prod_count
44
+
45
+ function get_cur_page()
46
+ {
47
+ return (isset($_REQUEST['p'])) ? intval($_REQUEST['p']) : 1;
48
+ }// get_cur_page
49
+
50
+ function get_order()
51
+ {
52
+ return (isset($_REQUEST['order'])) ? ($_REQUEST['order']) : 'views';
53
+ }// get_order
54
+
55
+ function get_order_dir()
56
+ {
57
+ return (isset($_REQUEST['dir'])) ? ($_REQUEST['dir']) : 'desc';
58
+ }// get_direction
59
+ }
60
+
61
+ ?>
app/code/local/Tatva/Catalogextensions/Block/Newproduct/Home/List.php ADDED
@@ -0,0 +1,104 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ * To change this template, choose Tools | Templates
5
+ * and open the template in the editor.
6
+ */
7
+
8
+ /**
9
+ * Description of List
10
+ *
11
+ * @author om
12
+ */
13
+ class Tatva_Catalogextensions_Block_Newproduct_Home_List extends Tatva_Catalogextensions_Block_Newproduct_List
14
+ {
15
+
16
+ protected function _getProductCollection()
17
+ {
18
+ $type = Mage::getStoreConfig('catalogextensions/config4/type');
19
+ if($type == 'Recently Added')
20
+ {
21
+ parent::__construct();
22
+ $storeId = Mage::app()->getStore()->getId();
23
+ $todayDate = Mage::app()->getLocale()->date()->toString(Varien_Date::DATETIME_INTERNAL_FORMAT);
24
+
25
+ $products = Mage::getModel('catalog/product')->getCollection()
26
+ ->addAttributeToSelect('*')
27
+ ->addAttributeToSort("entity_id","DESC")
28
+ ->addAttributeToSelect(array('name', 'price', 'small_image'))
29
+ ->setVisibility(Mage::getSingleton('catalog/product_visibility')->getVisibleInSiteIds());
30
+
31
+ if(Mage::getStoreConfig('catalogextensions/config4/max_product'))
32
+ {
33
+ $products->setPageSize(Mage::getStoreConfig('catalogextensions/config4/max_product'));
34
+ }
35
+
36
+
37
+ Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($products);
38
+ Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($products);
39
+ Mage::getSingleton('cataloginventory/stock')->addInStockFilterToCollection($products);
40
+
41
+ $this->_productCollection = $products;
42
+
43
+ return $this->_productCollection;
44
+ }
45
+ else
46
+ {
47
+ parent::__construct();
48
+ $storeId = Mage::app()->getStore()->getId();
49
+ $todayDate = Mage::app()->getLocale()->date()->toString(Varien_Date::DATETIME_INTERNAL_FORMAT);
50
+
51
+ $products = Mage::getModel('catalog/product')->getCollection()
52
+ ->addAttributeToSelect('*')
53
+ ->addAttributeToSelect(array('name', 'price', 'small_image'))
54
+ ->addStoreFilter($storeId)
55
+ ->addAttributeToFilter('news_from_date', array('date' => true, 'to' => $todayDate))
56
+ ->addAttributeToFilter('news_to_date', array('or'=> array(
57
+ 0 => array('date' => true, 'from' => $todayDate),
58
+ 1 => array('is' => new Zend_Db_Expr('null')))
59
+ ), 'left')
60
+ ->addAttributeToSort('news_from_date', 'desc');
61
+
62
+ if(Mage::getStoreConfig('catalogextensions/config4/max_product'))
63
+ {
64
+ $products->setPageSize(Mage::getStoreConfig('catalogextensions/config4/max_product'));
65
+ }
66
+
67
+
68
+ Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($products);
69
+ Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($products);
70
+ Mage::getSingleton('cataloginventory/stock')->addInStockFilterToCollection($products);
71
+
72
+ $this->_productCollection = $products;
73
+
74
+ return $this->_productCollection;
75
+ }
76
+ }
77
+
78
+ function get_prod_count()
79
+ {
80
+ //unset any saved limits
81
+ Mage::getSingleton('catalog/session')->unsLimitPage();
82
+ return (isset($_REQUEST['limit'])) ? intval($_REQUEST['limit']) : 9;
83
+ }// get_prod_count
84
+
85
+ function get_cur_page()
86
+ {
87
+ return (isset($_REQUEST['p'])) ? intval($_REQUEST['p']) : 1;
88
+ }// get_cur_page
89
+
90
+ function get_order()
91
+ {
92
+ return (isset($_REQUEST['order'])) ? ($_REQUEST['order']) : 'position';
93
+ }// get_order
94
+
95
+ function get_order_dir()
96
+ {
97
+ return (isset($_REQUEST['dir'])) ? ($_REQUEST['dir']) : 'desc';
98
+ }// get_direction
99
+
100
+ public function getToolbarHtml()
101
+ {
102
+
103
+ }
104
+ }
app/code/local/Tatva/Catalogextensions/Block/Newproduct/List.php ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ * To change this template, choose Tools | Templates
5
+ * and open the template in the editor.
6
+ */
7
+
8
+ /**
9
+ * Description of List
10
+ *
11
+ * @author om
12
+ */
13
+ class Tatva_Catalogextensions_Block_Newproduct_List extends Mage_Catalog_Block_Product_List
14
+ {
15
+
16
+ protected function _getProductCollection()
17
+ {
18
+ $type = Mage::getStoreConfig('catalogextensions/config4/type');
19
+ if($type == 'Recently Added')
20
+ {
21
+ parent::__construct();
22
+
23
+ $products = Mage::getModel('catalog/product')->getCollection()
24
+ ->addAttributeToSort("entity_id","DESC")
25
+ ->addAttributeToSelect(array('name', 'price', 'small_image'))
26
+ ->setVisibility(Mage::getSingleton('catalog/product_visibility')->getVisibleInSiteIds())
27
+ ->setPageSize($this->get_prod_count())
28
+ ->addAttributeToSort($this->get_order(), $this->get_order_dir())
29
+ ->setCurPage($this->get_cur_page());
30
+
31
+ Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($products);
32
+ Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($products);
33
+ Mage::getSingleton('cataloginventory/stock')->addInStockFilterToCollection($products);
34
+
35
+ $this->_productCollection = $products;
36
+
37
+ return $this->_productCollection;
38
+ }
39
+ else
40
+ {
41
+ parent::__construct();
42
+ $storeId = Mage::app()->getStore()->getId();
43
+ $todayDate = Mage::app()->getLocale()->date()->toString(Varien_Date::DATETIME_INTERNAL_FORMAT);
44
+
45
+ $products = Mage::getModel('catalog/product')->getCollection()
46
+ ->addAttributeToSelect('*')
47
+ ->addStoreFilter($storeId)
48
+ ->addAttributeToFilter('news_from_date', array('date' => true, 'to' => $todayDate))
49
+ ->addAttributeToFilter('news_to_date', array('or'=> array(
50
+ 0 => array('date' => true, 'from' => $todayDate),
51
+ 1 => array('is' => new Zend_Db_Expr('null')))
52
+ ), 'left')
53
+ ->addAttributeToSort('news_from_date', 'desc')
54
+ ->setPageSize($this->get_prod_count())
55
+ ->addAttributeToSort($this->get_order(), $this->get_order_dir())
56
+ ->setCurPage($this->get_cur_page());
57
+
58
+ Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($products);
59
+ Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($products);
60
+ Mage::getSingleton('cataloginventory/stock')->addInStockFilterToCollection($products);
61
+
62
+ $this->_productCollection = $products;
63
+
64
+ return $this->_productCollection;
65
+ }
66
+ }
67
+
68
+ function get_prod_count()
69
+ {
70
+ //unset any saved limits
71
+ Mage::getSingleton('catalog/session')->unsLimitPage();
72
+ return (isset($_REQUEST['limit'])) ? intval($_REQUEST['limit']) : 9;
73
+ }// get_prod_count
74
+
75
+ function get_cur_page()
76
+ {
77
+ return (isset($_REQUEST['p'])) ? intval($_REQUEST['p']) : 1;
78
+ }// get_cur_page
79
+
80
+ function get_order()
81
+ {
82
+ return (isset($_REQUEST['order'])) ? ($_REQUEST['order']) : 'position';
83
+ }// get_order
84
+
85
+ function get_order_dir()
86
+ {
87
+ return (isset($_REQUEST['dir'])) ? ($_REQUEST['dir']) : 'desc';
88
+ }// get_direction
89
+ }
90
+
91
+ ?>
app/code/local/Tatva/Catalogextensions/Helper/Data.php ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Tatva_Catalogextensions_Helper_Data extends Mage_Core_Helper_Abstract
4
+ {
5
+
6
+ }
app/code/local/Tatva/Catalogextensions/Model/Catalogextensions.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Tatva_Catalogextensions_Model_Catalogextensions extends Mage_Core_Model_Abstract
4
+ {
5
+ public function _construct()
6
+ {
7
+ parent::_construct();
8
+ $this->_init('catalogextensions/catalogextensions');
9
+ }
10
+ }
app/code/local/Tatva/Catalogextensions/Model/Mysql4/Catalogextensions.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Tatva_Catalogextensions_Model_Mysql4_Catalogextensions extends Mage_Core_Model_Mysql4_Abstract
4
+ {
5
+ public function _construct()
6
+ {
7
+ // Note that the catalogextensions_id refers to the key field in your database table.
8
+ $this->_init('catalogextensions/catalogextensions', 'catalogextensions_id');
9
+ }
10
+ }
app/code/local/Tatva/Catalogextensions/Model/Mysql4/Catalogextensions/Collection.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Tatva_Catalogextensions_Model_Mysql4_Catalogextensions_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
4
+ {
5
+ public function _construct()
6
+ {
7
+ parent::_construct();
8
+ $this->_init('catalogextensions/catalogextensions');
9
+ }
10
+ }
app/code/local/Tatva/Catalogextensions/Model/Status.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Tatva_Catalogextensions_Model_Status extends Varien_Object
4
+ {
5
+ const STATUS_ENABLED = 1;
6
+ const STATUS_DISABLED = 2;
7
+
8
+ static public function getOptionArray()
9
+ {
10
+ return array(
11
+ self::STATUS_ENABLED => Mage::helper('catalogextensions')->__('Enabled'),
12
+ self::STATUS_DISABLED => Mage::helper('catalogextensions')->__('Disabled')
13
+ );
14
+ }
15
+ }
app/code/local/Tatva/Catalogextensions/Model/source/type/type.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Tatva_Catalogextensions_Model_Source_type_type
4
+ {
5
+ public function toOptionArray()
6
+ {
7
+ $color = array(
8
+ 'Default News' => Mage::helper('catalogextensions')->__('Default News'),
9
+ 'Recently Added' => Mage::helper('catalogextensions')->__('Recently Added'),
10
+ );
11
+
12
+ /* $styles = array(
13
+ 'trans' => Mage::helper('googlecheckout')->__('Transparent'),
14
+ 'white' => Mage::helper('googlecheckout')->__('White Background'),
15
+ ); */
16
+
17
+ $options = array();
18
+ foreach ($color as $color => $colorLabel) {
19
+
20
+ $options[] = array(
21
+ 'value' => $color ,
22
+ 'label' => $colorLabel
23
+ );
24
+
25
+ }
26
+
27
+ return $options;
28
+ }
29
+ }
30
+ ?>
app/code/local/Tatva/Catalogextensions/controllers/IndexController.php ADDED
@@ -0,0 +1,126 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Tatva_Catalogextensions_IndexController extends Mage_Core_Controller_Front_Action
3
+ {
4
+ public function indexAction()
5
+ {
6
+
7
+ /*
8
+ * Load an object by id
9
+ * Request looking like:
10
+ * http://site.com/catalogextensions?id=15
11
+ * or
12
+ * http://site.com/catalogextensions/id/15
13
+ */
14
+ /*
15
+ $catalogextensions_id = $this->getRequest()->getParam('id');
16
+
17
+ if($catalogextensions_id != null && $catalogextensions_id != '') {
18
+ $catalogextensions = Mage::getModel('catalogextensions/catalogextensions')->load($catalogextensions_id)->getData();
19
+ } else {
20
+ $catalogextensions = null;
21
+ }
22
+ */
23
+
24
+ /*
25
+ * If no param we load a the last created item
26
+ */
27
+ /*
28
+ if($catalogextensions == null) {
29
+ $resource = Mage::getSingleton('core/resource');
30
+ $read= $resource->getConnection('core_read');
31
+ $catalogextensionsTable = $resource->getTableName('catalogextensions');
32
+
33
+ $select = $read->select()
34
+ ->from($catalogextensionsTable,array('catalogextensions_id','title','content','status'))
35
+ ->where('status',1)
36
+ ->order('created_time DESC') ;
37
+
38
+ $catalogextensions = $read->fetchRow($select);
39
+ }
40
+ Mage::register('catalogextensions', $catalogextensions);
41
+ */
42
+
43
+
44
+ $this->loadLayout();
45
+ $this->renderLayout();
46
+ }
47
+ public function bestsellersAction()
48
+ {
49
+
50
+ $url = Mage::getUrl('no-route');
51
+
52
+ $enable = Mage::getStoreConfig('catalogextensions/config1/active');
53
+ if($enable != 1)
54
+ {
55
+ Mage::app()->getFrontController()->getResponse()->setRedirect($url);
56
+ }
57
+ else
58
+ {
59
+ $this->loadLayout();
60
+ $this->getLayout()->getBlock('head')->setTitle('Besesellers');
61
+ $this->renderLayout();
62
+ }
63
+ }
64
+ public function featuredAction()
65
+ {
66
+
67
+ $url = Mage::getUrl('no-route');
68
+
69
+ $enable = Mage::getStoreConfig('catalogextensions/config2/active');
70
+ if($enable != 1)
71
+ {
72
+ Mage::app()->getFrontController()->getResponse()->setRedirect($url);
73
+ }
74
+
75
+ $this->loadLayout();
76
+ $this->getLayout()->getBlock('head')->setTitle('Featured Products');
77
+ $this->renderLayout();
78
+ }
79
+ public function mostviewedAction()
80
+ {
81
+
82
+ $url = Mage::getUrl('no-route');
83
+
84
+ $enable = Mage::getStoreConfig('catalogextensions/config3/active');
85
+ if($enable != 1)
86
+ {
87
+ Mage::app()->getFrontController()->getResponse()->setRedirect($url);
88
+ }
89
+
90
+ $this->loadLayout();
91
+ $this->getLayout()->getBlock('head')->setTitle('Mostviewed products');
92
+ $this->renderLayout();
93
+ }
94
+ public function newproductAction()
95
+ {
96
+
97
+ $url = Mage::getUrl('no-route');
98
+
99
+ $enable = Mage::getStoreConfig('catalogextensions/config4/active');
100
+ if($enable != 1)
101
+ {
102
+ Mage::app()->getFrontController()->getResponse()->setRedirect($url);
103
+ }
104
+
105
+ $this->loadLayout();
106
+ $this->getLayout()->getBlock('head')->setTitle('New products');
107
+ $this->renderLayout();
108
+ }
109
+
110
+ public function allproductAction()
111
+ {
112
+
113
+ $url = Mage::getUrl('no-route');
114
+
115
+ $enable = Mage::getStoreConfig('catalogextensions/config5/active');
116
+ if($enable != 1)
117
+ {
118
+ Mage::app()->getFrontController()->getResponse()->setRedirect($url);
119
+ }
120
+
121
+ $this->loadLayout();
122
+ $this->getLayout()->getBlock('head')->setTitle('All products');
123
+ $this->renderLayout();
124
+ }
125
+
126
+ }
app/code/local/Tatva/Catalogextensions/etc/adminhtml.xml ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <adminhtml>
3
+ <acl>
4
+ <resources>
5
+ <all>
6
+ <title>Allow Everything</title>
7
+ </all>
8
+ <admin>
9
+ <children>
10
+ <system>
11
+ <children>
12
+ <config>
13
+ <children>
14
+ <catalogextensions translate="title" module="catalogextensions">
15
+ <title>Catalogextensions Configuration</title>
16
+ </catalogextensions>
17
+ </children>
18
+ </config>
19
+ </children>
20
+ </system>
21
+ <Tatva_Catalogextensions>
22
+ <title>Catalogextensions Module</title>
23
+ <sort_order>10</sort_order>
24
+ </Tatva_Catalogextensions>
25
+ </children>
26
+ </admin>
27
+ </resources>
28
+ </acl>
29
+ </adminhtml>
app/code/local/Tatva/Catalogextensions/etc/config.xml ADDED
@@ -0,0 +1,147 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Tatva_Catalogextensions>
5
+ <version>0.1.0</version>
6
+ </Tatva_Catalogextensions>
7
+ </modules>
8
+ <frontend>
9
+ <routers>
10
+ <catalogextensions>
11
+ <use>standard</use>
12
+ <args>
13
+ <module>Tatva_Catalogextensions</module>
14
+ <frontName>catalogextensions</frontName>
15
+ </args>
16
+ </catalogextensions>
17
+ </routers>
18
+ <layout>
19
+ <updates>
20
+ <catalogextensions>
21
+ <file>catalogextensions/catalogextensions.xml</file>
22
+ </catalogextensions>
23
+ </updates>
24
+ </layout>
25
+ </frontend>
26
+ <admin>
27
+ <routers>
28
+ <catalogextensions>
29
+ <use>admin</use>
30
+ <args>
31
+ <module>Tatva_Catalogextensions</module>
32
+ <frontName>catalogextensions</frontName>
33
+ </args>
34
+ </catalogextensions>
35
+ </routers>
36
+ </admin>
37
+ <adminhtml>
38
+ <acl>
39
+ <resources>
40
+ <all>
41
+ <title>Allow Everything</title>
42
+ </all>
43
+ <admin>
44
+ <children>
45
+ <system>
46
+ <children>
47
+ <config>
48
+ <children>
49
+ <catalogextensions translate="title" module="catalogextensions">
50
+ <title>Catalogextensions Configuration</title>
51
+ </catalogextensions>
52
+ </children>
53
+ </config>
54
+ </children>
55
+ </system>
56
+ <Tatva_Catalogextensions>
57
+ <title>Catalogextensions Module</title>
58
+ <sort_order>10</sort_order>
59
+ </Tatva_Catalogextensions>
60
+ </children>
61
+ </admin>
62
+ </resources>
63
+ </acl>
64
+ <layout>
65
+ <updates>
66
+ <catalogextensions>
67
+ <file>catalogextensions.xml</file>
68
+ </catalogextensions>
69
+ </updates>
70
+ </layout>
71
+ </adminhtml>
72
+ <global>
73
+ <models>
74
+ <catalogextensions>
75
+ <class>Tatva_Catalogextensions_Model</class>
76
+ <resourceModel>catalogextensions_mysql4</resourceModel>
77
+ </catalogextensions>
78
+ <catalogextensions_mysql4>
79
+ <class>Tatva_Catalogextensions_Model_Mysql4</class>
80
+ <entities>
81
+ <catalogextensions>
82
+ <table>catalogextensions</table>
83
+ </catalogextensions>
84
+ </entities>
85
+ </catalogextensions_mysql4>
86
+ </models>
87
+ <resources>
88
+ <catalogextensions_setup>
89
+ <setup>
90
+ <module>Tatva_Catalogextensions</module>
91
+ </setup>
92
+ <connection>
93
+ <use>core_setup</use>
94
+ </connection>
95
+ </catalogextensions_setup>
96
+ <catalogextensions_write>
97
+ <connection>
98
+ <use>core_write</use>
99
+ </connection>
100
+ </catalogextensions_write>
101
+ <catalogextensions_read>
102
+ <connection>
103
+ <use>core_read</use>
104
+ </connection>
105
+ </catalogextensions_read>
106
+ </resources>
107
+ <blocks>
108
+ <catalogextensions>
109
+ <class>Tatva_Catalogextensions_Block</class>
110
+ </catalogextensions>
111
+ </blocks>
112
+ <helpers>
113
+ <catalogextensions>
114
+ <class>Tatva_Catalogextensions_Helper</class>
115
+ </catalogextensions>
116
+ </helpers>
117
+ </global>
118
+ <default>
119
+ <catalogextensions>
120
+ <config1>
121
+ <active>0</active>
122
+ <max_product>3</max_product>
123
+ <title>Bestseller Products</title>
124
+ </config1>
125
+ <config2>
126
+ <active>0</active>
127
+ <max_product>3</max_product>
128
+ <title>Fetured Products</title>
129
+ </config2>
130
+ <config3>
131
+ <active>0</active>
132
+ <max_product>3</max_product>
133
+ <title>Most Viewed Products</title>
134
+ </config3>
135
+ <config4>
136
+ <active>0</active>
137
+ <max_product>3</max_product>
138
+ <title>New Products</title>
139
+ <type>Recently Added</type>
140
+ </config4>
141
+ <config5>
142
+ <active>0</active>
143
+ <title>All Products</title>
144
+ </config5>
145
+ </catalogextensions>
146
+ </default>
147
+ </config>
app/code/local/Tatva/Catalogextensions/etc/system.xml ADDED
@@ -0,0 +1,203 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <tabs>
4
+ <catalogextensions translate="label" module="catalogextensions">
5
+ <label>Catalog Supporting Extensions</label>
6
+ <sort_order>101</sort_order>
7
+ </catalogextensions>
8
+ </tabs>
9
+ <sections>
10
+ <catalogextensions translate="label" module="catalogextensions">
11
+ <class>separator-top</class>
12
+ <label>Catalog Extensions Configuration</label>
13
+ <tab>catalogextensions</tab>
14
+ <frontend_type>text</frontend_type>
15
+ <sort_order>10</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
+ <config1 translate="label" module="catalogextensions">
21
+ <label>Topsellers Configuration</label>
22
+ <frontend_type>text</frontend_type>
23
+ <sort_order>10</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
+ <active translate="label">
29
+ <label>Enabled</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
+ </active>
37
+ <max_product translate="label" module="catalogextensions">
38
+ <label>Maximum No Of Products To Dispay On Home</label>
39
+ <frontend_type>text</frontend_type>
40
+ <validate>validate-greater-than-zero</validate>
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
+ </max_product>
46
+ <title translate="label" module="catalogextensions">
47
+ <label>Title</label>
48
+ <frontend_type>text</frontend_type>
49
+ <sort_order>30</sort_order>
50
+ <show_in_default>1</show_in_default>
51
+ <show_in_website>1</show_in_website>
52
+ <show_in_store>1</show_in_store>
53
+ </title>
54
+ </fields>
55
+ </config1>
56
+ <config2 translate="label" module="catalogextensions">
57
+ <label>Featur Product Configuration</label>
58
+ <frontend_type>text</frontend_type>
59
+ <sort_order>20</sort_order>
60
+ <show_in_default>1</show_in_default>
61
+ <show_in_website>1</show_in_website>
62
+ <show_in_store>1</show_in_store>
63
+ <fields>
64
+ <active translate="label">
65
+ <label>Enabled</label>
66
+ <frontend_type>select</frontend_type>
67
+ <source_model>adminhtml/system_config_source_yesno</source_model>
68
+ <sort_order>1</sort_order>
69
+ <show_in_default>1</show_in_default>
70
+ <show_in_website>1</show_in_website>
71
+ <show_in_store>1</show_in_store>
72
+ </active>
73
+ <max_product translate="label" module="catalogextensions">
74
+ <label>Maximum No Of Products To Dispay On Home</label>
75
+ <frontend_type>text</frontend_type>
76
+ <validate>validate-greater-than-zero</validate>
77
+ <sort_order>10</sort_order>
78
+ <show_in_default>1</show_in_default>
79
+ <show_in_website>1</show_in_website>
80
+ <show_in_store>1</show_in_store>
81
+ </max_product>
82
+ <title translate="label" module="catalogextensions">
83
+ <label>Title</label>
84
+ <frontend_type>text</frontend_type>
85
+ <sort_order>30</sort_order>
86
+ <show_in_default>1</show_in_default>
87
+ <show_in_website>1</show_in_website>
88
+ <show_in_store>1</show_in_store>
89
+ </title>
90
+ </fields>
91
+ </config2>
92
+ <config3 translate="label" module="catalogextensions">
93
+ <label>Most Viewed Product Configuration</label>
94
+ <frontend_type>text</frontend_type>
95
+ <sort_order>30</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
+ <fields>
100
+ <active translate="label">
101
+ <label>Enabled</label>
102
+ <frontend_type>select</frontend_type>
103
+ <source_model>adminhtml/system_config_source_yesno</source_model>
104
+ <sort_order>1</sort_order>
105
+ <show_in_default>1</show_in_default>
106
+ <show_in_website>1</show_in_website>
107
+ <show_in_store>1</show_in_store>
108
+ </active>
109
+ <max_product translate="label" module="catalogextensions">
110
+ <label>Maximum No Of Products To Dispay On Home</label>
111
+ <frontend_type>text</frontend_type>
112
+ <validate>validate-greater-than-zero</validate>
113
+ <sort_order>10</sort_order>
114
+ <show_in_default>1</show_in_default>
115
+ <show_in_website>1</show_in_website>
116
+ <show_in_store>1</show_in_store>
117
+ </max_product>
118
+ <title translate="label" module="catalogextensions">
119
+ <label>Title</label>
120
+ <frontend_type>text</frontend_type>
121
+ <sort_order>30</sort_order>
122
+ <show_in_default>1</show_in_default>
123
+ <show_in_website>1</show_in_website>
124
+ <show_in_store>1</show_in_store>
125
+ </title>
126
+ </fields>
127
+ </config3>
128
+ <config4 translate="label" module="catalogextensions">
129
+ <label>New Product Configuration</label>
130
+ <frontend_type>text</frontend_type>
131
+ <sort_order>40</sort_order>
132
+ <show_in_default>1</show_in_default>
133
+ <show_in_website>1</show_in_website>
134
+ <show_in_store>1</show_in_store>
135
+ <fields>
136
+ <active translate="label">
137
+ <label>Enabled</label>
138
+ <frontend_type>select</frontend_type>
139
+ <source_model>adminhtml/system_config_source_yesno</source_model>
140
+ <sort_order>1</sort_order>
141
+ <show_in_default>1</show_in_default>
142
+ <show_in_website>1</show_in_website>
143
+ <show_in_store>1</show_in_store>
144
+ </active>
145
+ <max_product translate="label" module="catalogextensions">
146
+ <label>Maximum No Of Products To Dispay On Home</label>
147
+ <frontend_type>text</frontend_type>
148
+ <validate>validate-greater-than-zero</validate>
149
+ <sort_order>10</sort_order>
150
+ <show_in_default>1</show_in_default>
151
+ <show_in_website>1</show_in_website>
152
+ <show_in_store>1</show_in_store>
153
+ </max_product>>
154
+ <title translate="label" module="catalogextensions">
155
+ <label>Title</label>
156
+ <frontend_type>text</frontend_type>
157
+ <sort_order>30</sort_order>
158
+ <show_in_default>1</show_in_default>
159
+ <show_in_website>1</show_in_website>
160
+ <show_in_store>1</show_in_store>
161
+ </title>
162
+ <type translate="label" module="catalogextensions">
163
+ <label>Products Display according To</label>
164
+ <frontend_type>select</frontend_type>
165
+ <source_model>catalogextensions/source_type_type</source_model>
166
+ <sort_order>40</sort_order>
167
+ <show_in_default>1</show_in_default>
168
+ <show_in_website>1</show_in_website>
169
+ <show_in_store>1</show_in_store>
170
+ </type>
171
+ </fields>
172
+ </config4>
173
+ <config5 translate="label" module="catalogextensions">
174
+ <label>All Product Configuration</label>
175
+ <frontend_type>text</frontend_type>
176
+ <sort_order>50</sort_order>
177
+ <show_in_default>1</show_in_default>
178
+ <show_in_website>1</show_in_website>
179
+ <show_in_store>1</show_in_store>
180
+ <fields>
181
+ <active translate="label">
182
+ <label>Enabled</label>
183
+ <frontend_type>select</frontend_type>
184
+ <source_model>adminhtml/system_config_source_yesno</source_model>
185
+ <sort_order>1</sort_order>
186
+ <show_in_default>1</show_in_default>
187
+ <show_in_website>1</show_in_website>
188
+ <show_in_store>1</show_in_store>
189
+ </active>
190
+ <title translate="label" module="catalogextensions">
191
+ <label>Title</label>
192
+ <frontend_type>text</frontend_type>
193
+ <sort_order>30</sort_order>
194
+ <show_in_default>1</show_in_default>
195
+ <show_in_website>1</show_in_website>
196
+ <show_in_store>1</show_in_store>
197
+ </title>
198
+ </fields>
199
+ </config5>
200
+ </groups>
201
+ </catalogextensions>
202
+ </sections>
203
+ </config>
app/code/local/Tatva/Catalogextensions/sql/catalogextensions_setup/mysql4-install-0.1.0.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $installer = $this;
4
+
5
+ $installer->startSetup();
6
+
7
+ $setup = new Mage_Eav_Model_Entity_Setup('core_setup');
8
+ $setup->addAttribute('catalog_product', 'featured', array(
9
+ 'type' => 'int',
10
+ 'backend_type' => 'int',
11
+ 'backend' => '',
12
+ 'frontend' => '',
13
+ 'label' => 'Is Featured',
14
+ 'input' => 'boolean',
15
+ 'frontend_class' => '',
16
+ 'source' => 'eav/entity_attribute_source_boolean',
17
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
18
+ 'visible' => false,
19
+ 'required' => false,
20
+ 'user_defined' => true,
21
+ 'default' => '',
22
+ 'searchable' => false,
23
+ 'filterable' => false,
24
+ 'comparable' => false,
25
+ 'visible_on_front' => false,
26
+ 'unique' => false,
27
+ 'apply_to' => '',
28
+ 'is_configurable' => false
29
+ ));
30
+
31
+ $setup->addAttributeToSet('catalog_product', 'Default', 'General', 'featured');
32
+
33
+ $installer->endSetup();
app/design/frontend/default/default/layout/catalogextensions/catalogextensions.xml ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="0.1.0">
3
+ <default translate="label" module="page">
4
+ <reference name="head">
5
+ <action method="addCss"><stylesheet>css/catalogextensions/catalogextensions.css</stylesheet></action>
6
+ </reference>
7
+ </default>
8
+ <catalogextensions_index_bestsellers>
9
+ <reference name="content">
10
+ <block type="catalogextensions/bestsellers_list" name="bestsellers_list" template="catalog/product/list.phtml" >
11
+ <block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml">
12
+ <block type="page/html_pager" name="product_list_toolbar_pager" />
13
+ </block>
14
+ <action method="setToolbarBlockName"><name>product_list_toolbar</name></action>
15
+ </block>
16
+ </reference>
17
+ </catalogextensions_index_bestsellers>
18
+ <catalogextensions_index_featured>
19
+ <reference name="content">
20
+ <block type="catalogextensions/featured_list" name="featured_list" template="catalog/product/list.phtml" >
21
+ <block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml">
22
+ <block type="page/html_pager" name="product_list_toolbar_pager" />
23
+ </block>
24
+ <action method="setToolbarBlockName"><name>product_list_toolbar</name></action>
25
+ </block>
26
+ </reference>
27
+ </catalogextensions_index_featured>
28
+ <catalogextensions_index_mostviewed>
29
+ <reference name="content">
30
+ <block type="catalogextensions/mostviewed_list" name="mostviewed_list" template="catalog/product/list.phtml" >
31
+ <block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml">
32
+ <block type="page/html_pager" name="product_list_toolbar_pager" />
33
+ </block>
34
+ <action method="setToolbarBlockName"><name>product_list_toolbar</name></action>
35
+ </block>
36
+ </reference>
37
+ </catalogextensions_index_mostviewed>
38
+ <catalogextensions_index_newproduct>
39
+ <reference name="content">
40
+ <block type="catalogextensions/newproduct_list" name="newproduct_list" template="catalog/product/list.phtml" >
41
+ <block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml">
42
+ <block type="page/html_pager" name="product_list_toolbar_pager" />
43
+ </block>
44
+ <action method="setToolbarBlockName"><name>product_list_toolbar</name></action>
45
+ </block>
46
+ </reference>
47
+ </catalogextensions_index_newproduct>
48
+ <catalogextensions_index_newrecent>
49
+ <reference name="content">
50
+ <block type="catalogextensions/newrecent_list" name="newrecent_list" template="catalogextensions/newrecent.phtml" >
51
+ <block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml">
52
+ <block type="page/html_pager" name="product_list_toolbar_pager" />
53
+ </block>
54
+ <action method="setToolbarBlockName"><name>product_list_toolbar</name></action>
55
+ </block>
56
+ </reference>
57
+ </catalogextensions_index_newrecent>
58
+
59
+ </layout>
app/design/frontend/default/default/template/catalogextensions/home_bestsellers.phtml ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ /**
29
+ * Product list template
30
+ *
31
+ * @see Mage_Catalog_Block_Product_List
32
+ */
33
+ ?>
34
+ <?php
35
+ $store = Mage::app()->getStore();
36
+ $code = $store->getCode();
37
+ $enable = Mage::getStoreConfig('catalogextensions/config1/active',$code);
38
+ ?>
39
+ <?php if($enable == 1) { ?>
40
+ <div class="maintitle">
41
+ <div class="titlemain"><?php echo Mage::getStoreConfig('catalogextensions/config1/title',$code); ?></div>
42
+ <div class="viewall"><a href="<?php echo $this->getUrl('catalogextensions/index/bestsellers'); ?>"><?php echo $this->__('View All') ?></a></div>
43
+ </div>
44
+ <?php echo $this->getLayout()->createBlock('catalogextensions/bestsellers_home_list')->setTemplate('catalog/product/list.phtml')->toHtml(); ?>
45
+ <?php } ?>
46
+
47
+
app/design/frontend/default/default/template/catalogextensions/home_featured.phtml ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ /**
29
+ * Product list template
30
+ *
31
+ * @see Mage_Catalog_Block_Product_List
32
+ */
33
+ ?>
34
+ <?php
35
+ $store = Mage::app()->getStore();
36
+ $code = $store->getCode();
37
+ $enable = Mage::getStoreConfig('catalogextensions/config2/active',$code);
38
+ ?>
39
+ <?php if($enable == 1) { ?>
40
+ <div class="maintitle">
41
+ <div class="titlemain"><?php echo Mage::getStoreConfig('catalogextensions/config2/title',$code); ?></div>
42
+ <div class="viewall"><a href="<?php echo $this->getUrl('catalogextensions/index/featured'); ?>"><?php echo $this->__('View All') ?></a></div>
43
+ </div>
44
+ <?php echo $this->getLayout()->createBlock('catalogextensions/featured_home_list')->setTemplate('catalog/product/list.phtml')->toHtml(); ?>
45
+ <?php } ?>
46
+
47
+
app/design/frontend/default/default/template/catalogextensions/home_mostviewed.phtml ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ /**
29
+ * Product list template
30
+ *
31
+ * @see Mage_Catalog_Block_Product_List
32
+ */
33
+ ?>
34
+ <?php
35
+ $store = Mage::app()->getStore();
36
+ $code = $store->getCode();
37
+ $enable = Mage::getStoreConfig('catalogextensions/config3/active',$code);
38
+ ?>
39
+ <?php if($enable == 1) { ?>
40
+ <div class="maintitle">
41
+ <div class="titlemain"><?php echo Mage::getStoreConfig('catalogextensions/config3/title',$code); ?></div>
42
+ <div class="viewall"><a href="<?php echo $this->getUrl('catalogextensions/index/mostviewed'); ?>"><?php echo $this->__('View All') ?></a></div>
43
+ </div>
44
+ <?php echo $this->getLayout()->createBlock('catalogextensions/mostviewed_home_list')->setTemplate('catalog/product/list.phtml')->toHtml(); ?>
45
+ <?php } ?>
46
+
47
+
app/design/frontend/default/default/template/catalogextensions/home_newproduct.phtml ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ /**
29
+ * Product list template
30
+ *
31
+ * @see Mage_Catalog_Block_Product_List
32
+ */
33
+ ?>
34
+ <?php
35
+ $store = Mage::app()->getStore();
36
+ $code = $store->getCode();
37
+ $enable = Mage::getStoreConfig('catalogextensions/config4/active',$code);
38
+ ?>
39
+ <?php if($enable == 1) { ?>
40
+ <div class="maintitle">
41
+ <div class="titlemain"><?php echo Mage::getStoreConfig('catalogextensions/config4/title',$code); ?></div>
42
+ <div class="viewall"><a href="<?php echo $this->getUrl('catalogextensions/index/newproduct'); ?>"><?php echo $this->__('View All') ?></a></div>
43
+ </div>
44
+ <?php echo $this->getLayout()->createBlock('catalogextensions/newproduct_home_list')->setTemplate('catalog/product/list.phtml')->toHtml(); ?>
45
+ <?php } ?>
46
+
47
+
app/design/frontend/default/default/template/catalogextensions/newrecent.phtml ADDED
@@ -0,0 +1,134 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ /**
29
+ * Product list template
30
+ *
31
+ * @see Mage_Catalog_Block_Product_List
32
+ */
33
+ ?>
34
+ <?php
35
+
36
+ $_productCollection = Mage::getModel("catalog/product")->getCollection()
37
+ ->addAttributeToSort("entity_id","DESC")
38
+ ->setVisibility(Mage::getSingleton('catalog/product_visibility')->getVisibleInSiteIds())
39
+ ->setPageSize(7)
40
+ ->setCurPage(1);
41
+
42
+ $_helper = $this->helper('catalog/output');
43
+ ?>
44
+ <?php if(!$_productCollection->count()): ?>
45
+ <p class="note-msg"><?php echo $this->__('There are no products matching the selection.') ?></p>
46
+ <?php else: ?>
47
+ <div class="category-products">
48
+ <?php echo $this->getToolbarHtml() ?>
49
+ <?php // List mode ?>
50
+ <?php if($this->getMode()!='grid'): ?>
51
+ <?php $_iterator = 0; ?>
52
+ <ol class="products-list" id="products-list">
53
+ <?php foreach ($_productCollection as $_product): ?>
54
+ <li class="item<?php if( ++$_iterator == sizeof($_productCollection) ): ?> last<?php endif; ?>">
55
+ <?php // Product Image ?>
56
+ <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(135); ?>" width="135" height="135" alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" /></a>
57
+ <?php // Product description ?>
58
+ <div class="product-shop">
59
+ <div class="f-fix">
60
+ <?php $_productNameStripped = $this->stripTags($_product->getName(), null, true); ?>
61
+ <h2 class="product-name"><a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $_productNameStripped; ?>"><?php echo $_helper->productAttribute($_product, $_product->getName() , 'name'); ?></a></h2>
62
+ <?php if($_product->getRatingSummary()): ?>
63
+ <?php echo $this->getReviewsSummaryHtml($_product) ?>
64
+ <?php endif; ?>
65
+ <?php echo $this->getPriceHtml($_product, true) ?>
66
+ <?php if($_product->isSaleable()): ?>
67
+ <p><button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>')"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button></p>
68
+ <?php else: ?>
69
+ <p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
70
+ <?php endif; ?>
71
+ <div class="desc std">
72
+ <?php echo $_helper->productAttribute($_product, $_product->getShortDescription(), 'short_description') ?>
73
+ <a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $_productNameStripped ?>" class="link-learn"><?php echo $this->__('Learn More') ?></a>
74
+ </div>
75
+ <ul class="add-to-links">
76
+ <?php if ($this->helper('wishlist')->isAllow()) : ?>
77
+ <li><a href="<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a></li>
78
+ <?php endif; ?>
79
+ <?php if($_compareUrl=$this->getAddToCompareUrl($_product)): ?>
80
+ <li><span class="separator">|</span> <a href="<?php echo $_compareUrl ?>" class="link-compare"><?php echo $this->__('Add to Compare') ?></a></li>
81
+ <?php endif; ?>
82
+ </ul>
83
+ </div>
84
+ </div>
85
+ </li>
86
+ <?php endforeach; ?>
87
+ </ol>
88
+ <script type="text/javascript">decorateList('products-list', 'none-recursive')</script>
89
+
90
+ <?php else: ?>
91
+
92
+ <?php // Grid Mode ?>
93
+
94
+ <?php $_collectionSize = $_productCollection->count() ?>
95
+ <?php $_columnCount = $this->getColumnCount(); ?>
96
+ <?php $i=0; foreach ($_productCollection as $_product): ?>
97
+ <?php if ($i++%$_columnCount==0): ?>
98
+ <ul class="products-grid">
99
+ <?php endif ?>
100
+ <li class="item<?php if(($i-1)%$_columnCount==0): ?> first<?php elseif($i%$_columnCount==0): ?> last<?php endif; ?>">
101
+ <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(135); ?>" width="135" height="135" alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" /></a>
102
+ <h2 class="product-name"><a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($_product->getName(), null, true) ?>"><?php echo $_helper->productAttribute($_product, $_product->getName(), 'name') ?></a></h2>
103
+ <?php if($_product->getRatingSummary()): ?>
104
+ <?php echo $this->getReviewsSummaryHtml($_product, 'short') ?>
105
+ <?php endif; ?>
106
+ <?php echo $this->getPriceHtml($_product, true) ?>
107
+ <div class="actions">
108
+ <?php if($_product->isSaleable()): ?>
109
+ <button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>')"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button>
110
+ <?php else: ?>
111
+ <p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
112
+ <?php endif; ?>
113
+ <ul class="add-to-links">
114
+ <?php if ($this->helper('wishlist')->isAllow()) : ?>
115
+ <li><a href="<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a></li>
116
+ <?php endif; ?>
117
+ <?php if($_compareUrl=$this->getAddToCompareUrl($_product)): ?>
118
+ <li><span class="separator">|</span> <a href="<?php echo $_compareUrl ?>" class="link-compare"><?php echo $this->__('Add to Compare') ?></a></li>
119
+ <?php endif; ?>
120
+ </ul>
121
+ </div>
122
+ </li>
123
+ <?php if ($i%$_columnCount==0 || $i==$_collectionSize): ?>
124
+ </ul>
125
+ <?php endif ?>
126
+ <?php endforeach ?>
127
+ <script type="text/javascript">decorateGeneric($$('ul.products-grid'), ['odd','even','first','last'])</script>
128
+ <?php endif; ?>
129
+
130
+ <div class="toolbar-bottom">
131
+ <?php echo $this->getToolbarHtml() ?>
132
+ </div>
133
+ </div>
134
+ <?php endif; ?>
app/etc/modules/Tatva_Catalogextensions.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Tatva_Catalogextensions>
5
+ <active>true</active>
6
+ <codePool>local</codePool>
7
+ </Tatva_Catalogextensions>
8
+ </modules>
9
+ </config>
package.xml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Etatvasoft_5_In_one_catalog</name>
4
+ <version>1.1.1</version>
5
+ <stability>stable</stability>
6
+ <license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL)</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>Homepage is the main visual part of any website. It's very important to show some meaningful </summary>
10
+ <description>Homepage is the main visual part of any website. It's very important to show some meaningful </description>
11
+ <notes>Homepage is the main visual part of any website. It's very important to show some meaningful </notes>
12
+ <authors><author><name>Etatvasoft</name><user>Etatvasoft</user><email>etatvasoft.magentodevelopment@gmail.com</email></author></authors>
13
+ <date>2013-01-22</date>
14
+ <time>13:02:02</time>
15
+ <contents><target name="magelocal"><dir name="Tatva"><dir name="Catalogextensions"><dir name="Block"><dir name="Allproducts"><file name="List.php" hash="23bb783bec9a95377cf7d7bfeebc82e5"/></dir><dir name="Bestsellers"><dir name="Home"><file name="List.php" hash="2ca6ba90bc5f94b767208e9744f2378d"/></dir><file name="List.php" hash="fd407b80b108662fbf3455551f500fd9"/></dir><file name="Catalogextensions.php" hash="c8db46ed313124e15f4547cd23481805"/><dir name="Featured"><dir name="Home"><file name="List.php" hash="821b6fd6ef9beabddb9c74d1d1da26cd"/></dir><file name="List.php" hash="216bff6d57edeb08ec1fbe113f171b61"/></dir><dir name="Mostviewed"><dir name="Home"><file name="List.php" hash="acae4de506c8c106912fc1bbdedd6be0"/></dir><file name="List.php" hash="0b107893f3ac3b0b41308a2a115bb8fd"/></dir><dir name="Newproduct"><dir name="Home"><file name="List.php" hash="70c924b48b0e44ab31864c8e48e74249"/></dir><file name="List.php" hash="0188e508a974371f9448fb048ccad2e0"/></dir></dir><dir name="Helper"><file name="Data.php" hash="b611bd4cc8fcfbb18474ae0f7abbb92f"/></dir><dir name="Model"><file name="Catalogextensions.php" hash="d13d2010207ce2a98c7aa4d105ab0c89"/><dir name="Mysql4"><dir name="Catalogextensions"><file name="Collection.php" hash="78c860170f8a69d2853dd244d30c3086"/></dir><file name="Catalogextensions.php" hash="19ccf69401d4e2f68c84a99b1fa12e02"/></dir><file name="Status.php" hash="0544078ffbda9356571152f217b4728c"/><dir name="source"><dir name="type"><file name="type.php" hash="ccc69a989935e8f9d6e9101174fc52da"/></dir></dir></dir><dir name="controllers"><file name="IndexController.php" hash="b10d74d4a21ebec92111f44ae9831479"/></dir><dir name="etc"><file name="adminhtml.xml" hash="d049baa4bd9d3ea71f2ea01176344c74"/><file name="config.xml" hash="4870f21dc4264e84799e8b4ff00c87b1"/><file name="system.xml" hash="e32e2dc74f33b70be0f99b96d9cc6379"/></dir><dir name="sql"><dir name="catalogextensions_setup"><file name="mysql4-install-0.1.0.php" hash="da1797c1b3d77ae8a140dfd894f139bb"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><dir name="catalogextensions"><file name="catalogextensions.xml" hash="1140caf53549f4c14b5ff7827a11e581"/></dir></dir><dir name="template"><dir name="catalogextensions"><file name="home_bestsellers.phtml" hash="00b1bee017c65cc07356a701c7106e07"/><file name="home_featured.phtml" hash="e49cbba85123819faf8ff2c74caf5c79"/><file name="home_mostviewed.phtml" hash="f78e5f182364572b476b5ecce2f2b9b4"/><file name="home_newproduct.phtml" hash="153840870c297ca89e6a1c12e73f93be"/><file name="newrecent.phtml" hash="d240f7053fcea8dbda5b51ffd85d0eae"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Tatva_Catalogextensions.xml" hash="e750c8253d16f81be8b9b71ae69d70be"/></dir></target><target name="mageskin"><dir name="frontend"><dir name="default"><dir name="default"><dir name="css"><dir name="catalogextensions"><file name="catalogextensions.css" hash="80504e8af7b1ee6dafcec2c6ce35823d"/></dir></dir><dir name="images"><dir name="catalogextensions"><file name="greyboxbg.gif" hash="0276e336f4103bc5b76aa923490cc556"/><file name="verticledivider.jpg" hash="c43a4c3be49fae4c2b3b2f4081237dbd"/></dir></dir></dir></dir></dir></target></contents>
16
+ <compatible/>
17
+ <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
18
+ </package>
skin/frontend/default/default/css/catalogextensions/catalogextensions.css ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .maintitle {
2
+ background: url("../../images/catalogextensions/greyboxbg.gif") repeat-x scroll center top transparent;
3
+ border-left: 1px solid #DBDBDB;
4
+ border-radius: 5px 5px 0 0;
5
+ border-right: 1px solid #DBDBDB;
6
+ border-top: 1px solid #DBDBDB;
7
+ color: #3A3A3A;
8
+ float: none;
9
+ font-size: 14px;
10
+ height: 29px;
11
+ padding: 6px 10px 0;
12
+ clear: both;
13
+ }
14
+
15
+ .titlemain {
16
+ color: #3A3A3A;
17
+ float: left;
18
+ font-size: 14px;
19
+ font-weight: bold;
20
+ }
21
+
22
+ .viewall {
23
+ float: right;
24
+ }
25
+
26
+ .viewall a {
27
+ color: #5C5C5C;
28
+ font-size: 12px;
29
+ font-weight: bold;
30
+ text-decoration: underline;
31
+ }
32
+
33
+
34
+ .products-grid li.item {
35
+ float: left;
36
+ padding-bottom: 80px;
37
+ padding-left: 10px;
38
+ padding-right: 10px;
39
+ padding-top: 12px;
40
+ width: 138px;
41
+ }
42
+
43
+ /*.std .category-products ul.products-grid, .std .category-products ol.products-grid {
44
+ width: 634px;
45
+ }*/
46
+
47
+ .std .category-products ul, .std .category-products ol {
48
+ list-style-image: none;
49
+ list-style-position: outside;
50
+ list-style-type: none;
51
+ padding: 0px;
52
+ margin: 0px;
53
+ }
54
+
55
+ /*.maintitle {
56
+ width: 634px;
57
+ }*/
skin/frontend/default/default/images/catalogextensions/greyboxbg.gif ADDED
Binary file
skin/frontend/default/default/images/catalogextensions/verticledivider.jpg ADDED
Binary file