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.7 |
Comparing to | |
See all releases |
Code changes from version 1.1.6 to 1.1.7
- app/code/local/Tatva/Catalogextensions/Block/Bestsellers/Home/List.php +21 -7
- app/code/local/Tatva/Catalogextensions/Block/Bestsellers/List.php +12 -1
- app/code/local/Tatva/Catalogextensions/Block/Lastordered/Home/List.php +86 -0
- app/code/local/Tatva/Catalogextensions/Block/Lastordered/List.php +82 -0
- app/code/local/Tatva/Catalogextensions/Block/Mostviewed/Home/List.php +18 -7
- app/code/local/Tatva/Catalogextensions/Block/Mostviewed/List.php +11 -1
- app/code/local/Tatva/Catalogextensions/Block/lastordered/Home/List.php +0 -74
- app/code/local/Tatva/Catalogextensions/Block/lastordered/List.php +0 -69
- app/code/local/Tatva/Catalogextensions/controllers/IndexController.php +2 -1
- app/code/local/Tatva/Catalogextensions/etc/system.xml +5 -5
- app/design/frontend/default/default/template/catalogextensions/home_lastordered.phtml +3 -3
- package.xml +4 -4
app/code/local/Tatva/Catalogextensions/Block/Bestsellers/Home/List.php
CHANGED
@@ -12,23 +12,37 @@
|
|
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 |
-
|
28 |
{
|
29 |
-
$products->setPageSize(Mage::getStoreConfig('catalogextensions/
|
30 |
}
|
31 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
|
33 |
Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($products);
|
34 |
Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($products);
|
@@ -38,7 +52,7 @@ class Tatva_Catalogextensions_Block_Bestsellers_Home_List extends Tatva_Cataloge
|
|
38 |
|
39 |
return $this->_productCollection;
|
40 |
}
|
41 |
-
|
42 |
function get_prod_count()
|
43 |
{
|
44 |
//unset any saved limits
|
@@ -63,6 +77,6 @@ class Tatva_Catalogextensions_Block_Bestsellers_Home_List extends Tatva_Cataloge
|
|
63 |
|
64 |
public function getToolbarHtml()
|
65 |
{
|
66 |
-
|
67 |
}
|
68 |
}
|
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 |
->addAttributeToSelect('*')
|
22 |
+
->addOrderedQty()
|
23 |
->setStoreId($storeId)
|
24 |
->addStoreFilter($storeId)
|
25 |
+
->setOrder('ordered_qty', 'desc')
|
26 |
+
->setPageSize($this->get_prod_count())
|
27 |
+
->setOrder($this->get_order(), $this->get_order_dir())
|
28 |
+
->setCurPage($this->get_cur_page());
|
29 |
|
30 |
+
if(Mage::getStoreConfig('catalogextensions/config1/max_product'))
|
31 |
{
|
32 |
+
$products->setPageSize(Mage::getStoreConfig('catalogextensions/config2/max_product'));
|
33 |
}
|
34 |
|
35 |
+
$productFlatData = Mage::getStoreConfig('catalog/frontend/flat_catalog_product');
|
36 |
+
if($productFlatData == "1")
|
37 |
+
{
|
38 |
+
$products->getSelect()->joinLeft(
|
39 |
+
array('flat' => 'catalog_product_flat_1'),
|
40 |
+
"(e.entity_id = flat.entity_id ) ",
|
41 |
+
array(
|
42 |
+
'flat.name AS name','flat.image AS small_image','flat.price AS price','flat.minimal_price as minimal_price','flat.special_price as special_price','flat.special_from_date AS special_from_date','flat.special_to_date AS special_to_date'
|
43 |
+
)
|
44 |
+
);
|
45 |
+
}
|
46 |
|
47 |
Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($products);
|
48 |
Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($products);
|
52 |
|
53 |
return $this->_productCollection;
|
54 |
}
|
55 |
+
|
56 |
function get_prod_count()
|
57 |
{
|
58 |
//unset any saved limits
|
77 |
|
78 |
public function getToolbarHtml()
|
79 |
{
|
80 |
+
|
81 |
}
|
82 |
}
|
app/code/local/Tatva/Catalogextensions/Block/Bestsellers/List.php
CHANGED
@@ -17,14 +17,25 @@ class Tatva_Catalogextensions_Block_Bestsellers_List extends Mage_Catalog_Block_
|
|
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);
|
17 |
parent::__construct();
|
18 |
$storeId = Mage::app()->getStore()->getId();
|
19 |
$products = Mage::getResourceModel('reports/product_collection')
|
|
|
20 |
->addAttributeToSelect('*')
|
21 |
+
->addOrderedQty()
|
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 |
+
$productFlatData = Mage::getStoreConfig('catalog/frontend/flat_catalog_product');
|
29 |
+
if($productFlatData == "1")
|
30 |
+
{
|
31 |
+
$products->getSelect()->joinLeft(
|
32 |
+
array('flat' => 'catalog_product_flat_1'),
|
33 |
+
"(e.entity_id = flat.entity_id ) ",
|
34 |
+
array(
|
35 |
+
'flat.name AS name','flat.image AS small_image','flat.price AS price','flat.minimal_price as minimal_price','flat.special_price as special_price','flat.special_from_date AS special_from_date','flat.special_to_date AS special_to_date'
|
36 |
+
)
|
37 |
+
);
|
38 |
+
}
|
39 |
|
40 |
Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($products);
|
41 |
Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($products);
|
app/code/local/Tatva/Catalogextensions/Block/Lastordered/Home/List.php
ADDED
@@ -0,0 +1,86 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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_Lastordered_Home_List extends Tatva_Catalogextensions_Block_Lastordered_List
|
14 |
+
{
|
15 |
+
|
16 |
+
protected function _getProductCollection()
|
17 |
+
{
|
18 |
+
parent::__construct();
|
19 |
+
|
20 |
+
$storeId = Mage::app()->getStore()->getId();
|
21 |
+
$itemsCollection = Mage::getResourceModel('sales/order_item_collection')
|
22 |
+
->join('order', 'order_id=entity_id')
|
23 |
+
->addFieldToFilter('main_table.store_id', array('eq'=>$storeId))
|
24 |
+
->setOrder('main_table.created_at','desc')
|
25 |
+
->setPageSize(12);
|
26 |
+
|
27 |
+
$itemsCollection->getSelect()->group(`main_table`.'product_id');
|
28 |
+
|
29 |
+
$prod = array();
|
30 |
+
if(sizeof($itemsCollection)>0)
|
31 |
+
{
|
32 |
+
foreach ($itemsCollection as $item) {
|
33 |
+
//$product = Mage::getModel('catalog/product')->load($item->getProductId());
|
34 |
+
$prod[] = $item->getProductId();
|
35 |
+
}
|
36 |
+
}
|
37 |
+
|
38 |
+
$products = Mage::getModel('catalog/product')->getCollection()
|
39 |
+
->addAttributeToSelect('*')
|
40 |
+
->addAttributeToSelect(array('name', 'price', 'small_image'))
|
41 |
+
->setStoreId($storeId)
|
42 |
+
->addStoreFilter($storeId);
|
43 |
+
|
44 |
+
|
45 |
+
$products->getSelect()->where('e.entity_id IN(?)',$prod );
|
46 |
+
|
47 |
+
if(Mage::getStoreConfig('catalogextensions/config7/max_product'))
|
48 |
+
{
|
49 |
+
$products->setPageSize(Mage::getStoreConfig('catalogextensions/config7/max_product'));
|
50 |
+
}
|
51 |
+
|
52 |
+
Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($products);
|
53 |
+
Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($products);
|
54 |
+
|
55 |
+
$this->_productCollection = $products;
|
56 |
+
|
57 |
+
return $this->_productCollection;
|
58 |
+
}
|
59 |
+
|
60 |
+
function get_prod_count()
|
61 |
+
{
|
62 |
+
//unset any saved limits
|
63 |
+
Mage::getSingleton('catalog/session')->unsLimitPage();
|
64 |
+
return (isset($_REQUEST['limit'])) ? intval($_REQUEST['limit']) : 9;
|
65 |
+
}// get_prod_count
|
66 |
+
|
67 |
+
function get_cur_page()
|
68 |
+
{
|
69 |
+
return (isset($_REQUEST['p'])) ? intval($_REQUEST['p']) : 1;
|
70 |
+
}// get_cur_page
|
71 |
+
|
72 |
+
function get_order()
|
73 |
+
{
|
74 |
+
return (isset($_REQUEST['order'])) ? ($_REQUEST['order']) : 'item_id';
|
75 |
+
}// get_order
|
76 |
+
|
77 |
+
function get_order_dir()
|
78 |
+
{
|
79 |
+
return (isset($_REQUEST['dir'])) ? ($_REQUEST['dir']) : 'desc';
|
80 |
+
}// get_direction
|
81 |
+
|
82 |
+
public function getToolbarHtml()
|
83 |
+
{
|
84 |
+
|
85 |
+
}
|
86 |
+
}
|
app/code/local/Tatva/Catalogextensions/Block/Lastordered/List.php
ADDED
@@ -0,0 +1,82 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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_Lastordered_List extends Mage_Catalog_Block_Product_List
|
14 |
+
{
|
15 |
+
protected function _getProductCollection()
|
16 |
+
{
|
17 |
+
parent::__construct();
|
18 |
+
|
19 |
+
$storeId = Mage::app()->getStore()->getId();
|
20 |
+
$itemsCollection = Mage::getResourceModel('sales/order_item_collection')
|
21 |
+
->join('order', 'order_id=entity_id')
|
22 |
+
->addFieldToFilter('main_table.store_id', array('eq'=>$storeId))
|
23 |
+
->setOrder('main_table.created_at','desc');
|
24 |
+
$itemsCollection->getSelect()->group(`main_table`.'product_id');
|
25 |
+
|
26 |
+
$prod = array();
|
27 |
+
if(sizeof($itemsCollection)>0)
|
28 |
+
{
|
29 |
+
foreach ($itemsCollection as $item) {
|
30 |
+
//$product = Mage::getModel('catalog/product')->load($item->getProductId());
|
31 |
+
$prod[] = $item->getProductId();
|
32 |
+
}
|
33 |
+
}
|
34 |
+
|
35 |
+
$products = Mage::getModel('catalog/product')->getCollection()
|
36 |
+
->addAttributeToSelect('*')
|
37 |
+
->addAttributeToSelect(array('name', 'price', 'small_image'))
|
38 |
+
->setStoreId($storeId)
|
39 |
+
->addStoreFilter($storeId)
|
40 |
+
->setPageSize($this->get_prod_count())
|
41 |
+
->setOrder($this->get_order(), $this->get_order_dir())
|
42 |
+
->setCurPage($this->get_cur_page());
|
43 |
+
|
44 |
+
|
45 |
+
$products->getSelect()->where('e.entity_id IN(?)',$prod );
|
46 |
+
|
47 |
+
|
48 |
+
$products->setPageSize($this->get_prod_count())->setCurPage($this->get_cur_page());
|
49 |
+
|
50 |
+
Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($products);
|
51 |
+
Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($products);
|
52 |
+
//echo $products->getSelect();exit;
|
53 |
+
$this->_productCollection = $products;
|
54 |
+
|
55 |
+
return $this->_productCollection;
|
56 |
+
}
|
57 |
+
|
58 |
+
function get_prod_count()
|
59 |
+
{
|
60 |
+
//unset any saved limits
|
61 |
+
Mage::getSingleton('catalog/session')->unsLimitPage();
|
62 |
+
return (isset($_REQUEST['limit'])) ? intval($_REQUEST['limit']) : 9;
|
63 |
+
|
64 |
+
}// get_prod_count
|
65 |
+
|
66 |
+
function get_cur_page()
|
67 |
+
{
|
68 |
+
return (isset($_REQUEST['p'])) ? intval($_REQUEST['p']) : 1;
|
69 |
+
}// get_cur_page
|
70 |
+
|
71 |
+
function get_order()
|
72 |
+
{
|
73 |
+
return (isset($_REQUEST['order'])) ? ($_REQUEST['order']) : 'item_id';
|
74 |
+
}// get_order
|
75 |
+
|
76 |
+
function get_order_dir()
|
77 |
+
{
|
78 |
+
return (isset($_REQUEST['dir'])) ? ($_REQUEST['dir']) : 'desc';
|
79 |
+
}// get_direction
|
80 |
+
}
|
81 |
+
|
82 |
+
?>
|
app/code/local/Tatva/Catalogextensions/Block/Mostviewed/Home/List.php
CHANGED
@@ -15,19 +15,30 @@ class Tatva_Catalogextensions_Block_Mostviewed_Home_List extends Tatva_Catalogex
|
|
15 |
|
16 |
protected function _getProductCollection()
|
17 |
{
|
18 |
-
|
19 |
$storeId = Mage::app()->getStore()->getId();
|
20 |
-
|
21 |
-
|
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);
|
@@ -36,7 +47,7 @@ class Tatva_Catalogextensions_Block_Mostviewed_Home_List extends Tatva_Catalogex
|
|
36 |
|
37 |
$this->_productCollection = $products;
|
38 |
|
39 |
-
|
40 |
}
|
41 |
|
42 |
function get_prod_count()
|
@@ -63,6 +74,6 @@ class Tatva_Catalogextensions_Block_Mostviewed_Home_List extends Tatva_Catalogex
|
|
63 |
|
64 |
public function getToolbarHtml()
|
65 |
{
|
66 |
-
|
67 |
}
|
68 |
}
|
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 |
+
if(Mage::getStoreConfig('catalogextensions/config3/max_product'))
|
|
|
27 |
{
|
28 |
$products->setPageSize(Mage::getStoreConfig('catalogextensions/config3/max_product'));
|
29 |
}
|
30 |
+
$productFlatData = Mage::getStoreConfig('catalog/frontend/flat_catalog_product');
|
31 |
+
if($productFlatData == "1")
|
32 |
+
{
|
33 |
+
$products->getSelect()->joinLeft(
|
34 |
+
array('flat' => 'catalog_product_flat_1'),
|
35 |
+
"(e.entity_id = flat.entity_id ) ",
|
36 |
+
array(
|
37 |
+
'flat.name AS name','flat.image AS small_image','flat.price AS price','flat.minimal_price as minimal_price','flat.special_price as special_price','flat.special_from_date AS special_from_date','flat.special_to_date AS special_to_date'
|
38 |
+
)
|
39 |
+
);
|
40 |
+
}
|
41 |
+
|
42 |
|
43 |
|
44 |
Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($products);
|
47 |
|
48 |
$this->_productCollection = $products;
|
49 |
|
50 |
+
return $this->_productCollection;
|
51 |
}
|
52 |
|
53 |
function get_prod_count()
|
74 |
|
75 |
public function getToolbarHtml()
|
76 |
{
|
77 |
+
|
78 |
}
|
79 |
}
|
app/code/local/Tatva/Catalogextensions/Block/Mostviewed/List.php
CHANGED
@@ -24,7 +24,17 @@ class Tatva_Catalogextensions_Block_Mostviewed_List extends Mage_Catalog_Block_P
|
|
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);
|
24 |
->setPageSize($this->get_prod_count())
|
25 |
->addAttributeToSort($this->get_order(), $this->get_order_dir())
|
26 |
->setCurPage($this->get_cur_page());
|
27 |
+
$productFlatData = Mage::getStoreConfig('catalog/frontend/flat_catalog_product');
|
28 |
+
if($productFlatData == "1")
|
29 |
+
{
|
30 |
+
$products->getSelect()->joinLeft(
|
31 |
+
array('flat' => 'catalog_product_flat_1'),
|
32 |
+
"(e.entity_id = flat.entity_id ) ",
|
33 |
+
array(
|
34 |
+
'flat.name AS name','flat.image AS small_image','flat.price AS price','flat.minimal_price as minimal_price','flat.special_price as special_price','flat.special_from_date AS special_from_date','flat.special_to_date AS special_to_date'
|
35 |
+
)
|
36 |
+
);
|
37 |
+
}
|
38 |
Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($products);
|
39 |
Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($products);
|
40 |
Mage::getSingleton('cataloginventory/stock')->addInStockFilterToCollection($products);
|
app/code/local/Tatva/Catalogextensions/Block/lastordered/Home/List.php
DELETED
@@ -1,74 +0,0 @@
|
|
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_Lastordered_Home_List extends Tatva_Catalogextensions_Block_Promotional_List
|
14 |
-
{
|
15 |
-
|
16 |
-
protected function _getProductCollection()
|
17 |
-
{
|
18 |
-
parent::__construct();
|
19 |
-
$storeId = Mage::app()->getStore()->getId();
|
20 |
-
$resource = Mage::getSingleton('core/resource');
|
21 |
-
$read = Mage::getSingleton('core/resource')->getConnection('core_read');
|
22 |
-
$orderItemTable = $resource->getTableName('sales/order_item');
|
23 |
-
$demotb = $read->select()->from(array('coi'=>$orderItemTable),array('product_id','item_id'))->group('product_id');
|
24 |
-
$products = Mage::getModel('catalog/product')->getCollection()
|
25 |
-
->setStoreId($storeId)
|
26 |
-
->addStoreFilter($storeId)
|
27 |
-
->addAttributeToSelect(array('name', 'price', 'small_image'));
|
28 |
-
|
29 |
-
|
30 |
-
Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($products);
|
31 |
-
Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($products);
|
32 |
-
|
33 |
-
$products->getSelect()
|
34 |
-
->join(array('coi'=>$orderItemTable),'e.entity_id=coi.product_id',array('item_id'))
|
35 |
-
->order($this->get_order().' '.$this->get_order_dir());
|
36 |
-
|
37 |
-
|
38 |
-
if(Mage::getStoreConfig('catalogextensions/config8/max_product'))
|
39 |
-
{
|
40 |
-
$products->setPageSize(Mage::getStoreConfig('catalogextensions/config8/max_product'));
|
41 |
-
}
|
42 |
-
|
43 |
-
$this->_productCollection = $products;
|
44 |
-
|
45 |
-
return $this->_productCollection;
|
46 |
-
}
|
47 |
-
|
48 |
-
function get_prod_count()
|
49 |
-
{
|
50 |
-
//unset any saved limits
|
51 |
-
Mage::getSingleton('catalog/session')->unsLimitPage();
|
52 |
-
return (isset($_REQUEST['limit'])) ? intval($_REQUEST['limit']) : 9;
|
53 |
-
}// get_prod_count
|
54 |
-
|
55 |
-
function get_cur_page()
|
56 |
-
{
|
57 |
-
return (isset($_REQUEST['p'])) ? intval($_REQUEST['p']) : 1;
|
58 |
-
}// get_cur_page
|
59 |
-
|
60 |
-
function get_order()
|
61 |
-
{
|
62 |
-
return (isset($_REQUEST['order'])) ? ($_REQUEST['order']) : 'item_id';
|
63 |
-
}// get_order
|
64 |
-
|
65 |
-
function get_order_dir()
|
66 |
-
{
|
67 |
-
return (isset($_REQUEST['dir'])) ? ($_REQUEST['dir']) : 'desc';
|
68 |
-
}// get_direction
|
69 |
-
|
70 |
-
public function getToolbarHtml()
|
71 |
-
{
|
72 |
-
|
73 |
-
}
|
74 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/local/Tatva/Catalogextensions/Block/lastordered/List.php
DELETED
@@ -1,69 +0,0 @@
|
|
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_Lastordered_List extends Mage_Catalog_Block_Product_List
|
14 |
-
{
|
15 |
-
protected function _getProductCollection()
|
16 |
-
{
|
17 |
-
parent::__construct();
|
18 |
-
$storeId = Mage::app()->getStore()->getId();
|
19 |
-
$resource = Mage::getSingleton('core/resource');
|
20 |
-
$read = Mage::getSingleton('core/resource')->getConnection('core_read');
|
21 |
-
|
22 |
-
$orderItemTable = $resource->getTableName('sales/order_item');
|
23 |
-
$demotb = $read->select()->from(array('coi'=>$orderItemTable),array('product_id','item_id'))->group('product_id');
|
24 |
-
$products = Mage::getModel('catalog/product')->getCollection()
|
25 |
-
->setStoreId($storeId)
|
26 |
-
->addStoreFilter($storeId)
|
27 |
-
->addAttributeToSelect(array('name', 'price', 'small_image'));
|
28 |
-
|
29 |
-
|
30 |
-
Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($products);
|
31 |
-
Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($products);
|
32 |
-
|
33 |
-
$products->getSelect()
|
34 |
-
->join(array('coid'=>$demotb),'e.entity_id=coid.product_id',array('item_id'))
|
35 |
-
->order($this->get_order().' '.$this->get_order_dir());
|
36 |
-
|
37 |
-
|
38 |
-
$products->setPageSize($this->get_prod_count())->setCurPage($this->get_cur_page());
|
39 |
-
|
40 |
-
$this->_productCollection = $products;
|
41 |
-
|
42 |
-
return $this->_productCollection;
|
43 |
-
}
|
44 |
-
|
45 |
-
function get_prod_count()
|
46 |
-
{
|
47 |
-
//unset any saved limits
|
48 |
-
Mage::getSingleton('catalog/session')->unsLimitPage();
|
49 |
-
return (isset($_REQUEST['limit'])) ? intval($_REQUEST['limit']) : 9;
|
50 |
-
|
51 |
-
}// get_prod_count
|
52 |
-
|
53 |
-
function get_cur_page()
|
54 |
-
{
|
55 |
-
return (isset($_REQUEST['p'])) ? intval($_REQUEST['p']) : 1;
|
56 |
-
}// get_cur_page
|
57 |
-
|
58 |
-
function get_order()
|
59 |
-
{
|
60 |
-
return (isset($_REQUEST['order'])) ? ($_REQUEST['order']) : 'item_id';
|
61 |
-
}// get_order
|
62 |
-
|
63 |
-
function get_order_dir()
|
64 |
-
{
|
65 |
-
return (isset($_REQUEST['dir'])) ? ($_REQUEST['dir']) : 'desc';
|
66 |
-
}// get_direction
|
67 |
-
}
|
68 |
-
|
69 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/local/Tatva/Catalogextensions/controllers/IndexController.php
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
<?php
|
|
|
2 |
class Tatva_Catalogextensions_IndexController extends Mage_Core_Controller_Front_Action
|
3 |
{
|
4 |
public function indexAction()
|
@@ -144,7 +145,7 @@ class Tatva_Catalogextensions_IndexController extends Mage_Core_Controller_Front
|
|
144 |
|
145 |
$url = Mage::getUrl('no-route');
|
146 |
|
147 |
-
$enable = Mage::getStoreConfig('catalogextensions/
|
148 |
if($enable != 1)
|
149 |
{
|
150 |
Mage::app()->getFrontController()->getResponse()->setRedirect($url);
|
1 |
<?php
|
2 |
+
|
3 |
class Tatva_Catalogextensions_IndexController extends Mage_Core_Controller_Front_Action
|
4 |
{
|
5 |
public function indexAction()
|
145 |
|
146 |
$url = Mage::getUrl('no-route');
|
147 |
|
148 |
+
$enable = Mage::getStoreConfig('catalogextensions/config7/active');
|
149 |
if($enable != 1)
|
150 |
{
|
151 |
Mage::app()->getFrontController()->getResponse()->setRedirect($url);
|
app/code/local/Tatva/Catalogextensions/etc/system.xml
CHANGED
@@ -1,18 +1,18 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<config>
|
3 |
<tabs>
|
4 |
-
<
|
5 |
-
<label>
|
6 |
<sort_order>101</sort_order>
|
7 |
-
</
|
8 |
</tabs>
|
9 |
<sections>
|
10 |
<catalogextensions translate="label" module="catalogextensions">
|
11 |
<class>separator-top</class>
|
12 |
<label>Catalog Extensions Configuration</label>
|
13 |
-
<tab>
|
14 |
<frontend_type>text</frontend_type>
|
15 |
-
<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>
|
1 |
<?xml version="1.0"?>
|
2 |
<config>
|
3 |
<tabs>
|
4 |
+
<tatva translate="label" module="catalogextensions">
|
5 |
+
<label>Tatvasoft</label>
|
6 |
<sort_order>101</sort_order>
|
7 |
+
</tatva>
|
8 |
</tabs>
|
9 |
<sections>
|
10 |
<catalogextensions translate="label" module="catalogextensions">
|
11 |
<class>separator-top</class>
|
12 |
<label>Catalog Extensions Configuration</label>
|
13 |
+
<tab>tatva</tab>
|
14 |
<frontend_type>text</frontend_type>
|
15 |
+
<sort_order>20</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>
|
app/design/frontend/default/default/template/catalogextensions/home_lastordered.phtml
CHANGED
@@ -31,14 +31,14 @@
|
|
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/
|
38 |
?>
|
39 |
<?php if($enable == 1) { ?>
|
40 |
<div class="maintitle">
|
41 |
-
<div class="titlemain"><?php echo Mage::getStoreConfig('catalogextensions/
|
42 |
<div class="viewall"><a href="<?php echo $this->getUrl('catalogextensions/index/recentlyordered'); ?>"><?php echo $this->__('View All') ?></a></div>
|
43 |
</div>
|
44 |
<?php echo $this->getLayout()->createBlock('catalogextensions/lastordered_home_list')->setTemplate('catalog/product/list.phtml')->toHtml(); ?>
|
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/config7/active',$code);
|
38 |
?>
|
39 |
<?php if($enable == 1) { ?>
|
40 |
<div class="maintitle">
|
41 |
+
<div class="titlemain"><?php echo Mage::getStoreConfig('catalogextensions/config7/title',$code); ?></div>
|
42 |
<div class="viewall"><a href="<?php echo $this->getUrl('catalogextensions/index/recentlyordered'); ?>"><?php echo $this->__('View All') ?></a></div>
|
43 |
</div>
|
44 |
<?php echo $this->getLayout()->createBlock('catalogextensions/lastordered_home_list')->setTemplate('catalog/product/list.phtml')->toHtml(); ?>
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Etatvasoft_5_In_one_catalog</name>
|
4 |
-
<version>1.1.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL)</license>
|
7 |
<channel>community</channel>
|
@@ -10,9 +10,9 @@
|
|
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-
|
14 |
-
<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="
|
16 |
<compatible/>
|
17 |
<dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
|
18 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Etatvasoft_5_In_one_catalog</name>
|
4 |
+
<version>1.1.7</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>
|
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-10-08</date>
|
14 |
+
<time>07:46:44</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="f36ace39970c38c26fa91169b62d3569"/></dir><file name="List.php" hash="e02db79e2a8cf0c0af38fc9f46b6da94"/></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="Lastordered"><dir name="Home"><file name="List.php" hash="f4a0389616c720fdcb202e042db2578a"/></dir><file name="List.php" hash="b7db3b72ac98b1b829fd3583bf0fc953"/></dir><dir name="Mostviewed"><dir name="Home"><file name="List.php" hash="f90919166784cff6261f0aa0b171d793"/></dir><file name="List.php" hash="0a98585a71ef439261dfd1248bd39f84"/></dir><dir name="Newproduct"><dir name="Home"><file name="List.php" hash="3fb45a68a9634e88de44a729caca32da"/></dir><file name="List.php" hash="9585d810fcf72d9df1157510900e6219"/></dir><dir name="Promotional"><dir name="Home"><file name="List.php" hash="60824f9318b57f2ee2cd50f0133b1461"/></dir><file name="List.php" hash="cc021c39e82f12208c86f9f6ac4b043d"/></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><dir name="controllers"><file name="IndexController.php" hash="160ca8b9e3dfdbd979e6bac4f78153ea"/></dir><dir name="etc"><file name="adminhtml.xml" hash="d049baa4bd9d3ea71f2ea01176344c74"/><file name="config.xml" hash="8f1a67cb30208b1fd87c0d56c9a4cc19"/><file name="system.xml" hash="2cd615bdaf08a2868ff07c37cd7915ad"/></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="af78cc2f1ddea55a1daca3afe1d089d5"/></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_lastordered.phtml" hash="06768230f0f3d062f9d02c318726dcda"/><file name="home_mostviewed.phtml" hash="f78e5f182364572b476b5ecce2f2b9b4"/><file name="home_newproduct.phtml" hash="153840870c297ca89e6a1c12e73f93be"/><file name="home_promotional.phtml" hash="17c1fffa356e073cd722ef7ac8c37814"/></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="Thumbs.db" hash="455a6ee36501c4dcba5966b8ad185216"/><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>
|