Version Notes
Display all product which has product special price with layered navigation filtering.
Download this release
Release Info
Developer | Avik Roy |
Extension | avikonsale001 |
Version | 1.6.0 |
Comparing to | |
See all releases |
Version 1.6.0
- app/code/local/Avik/Specialproduct/Block/Layer/Filter/Attribute.php +9 -0
- app/code/local/Avik/Specialproduct/Block/Layer/Filter/Category.php +10 -0
- app/code/local/Avik/Specialproduct/Block/Layer/Filter/Decimal.php +9 -0
- app/code/local/Avik/Specialproduct/Block/Layer/Filter/Price.php +9 -0
- app/code/local/Avik/Specialproduct/Block/Layer/New.php +53 -0
- app/code/local/Avik/Specialproduct/Block/New.php +34 -0
- app/code/local/Avik/Specialproduct/Helper/Data.php +33 -0
- app/code/local/Avik/Specialproduct/Model/Layer.php +62 -0
- app/code/local/Avik/Specialproduct/Model/Layer/Filter/Attribute.php +12 -0
- app/code/local/Avik/Specialproduct/Model/Layer/Filter/Category.php +69 -0
- app/code/local/Avik/Specialproduct/Model/Layer/Filter/Decimal.php +12 -0
- app/code/local/Avik/Specialproduct/Model/Layer/Filter/Item.php +5 -0
- app/code/local/Avik/Specialproduct/Model/Layer/Filter/Price.php +12 -0
- app/code/local/Avik/Specialproduct/controllers/IndexController.php +29 -0
- app/code/local/Avik/Specialproduct/etc/config.xml +44 -0
- app/design/frontend/base/default/layout/avik/specialproduct.xml +88 -0
- app/design/frontend/base/default/template/avik/navigation/left.phtml +93 -0
- app/design/frontend/base/default/template/avik/specialproduct.phtml +8 -0
- app/etc/modules/Avik_Specialproduct.xml +9 -0
- package.xml +18 -0
app/code/local/Avik/Specialproduct/Block/Layer/Filter/Attribute.php
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Avik_Specialproduct_Block_Layer_Filter_Attribute extends Mage_Catalog_Block_Layer_Filter_Attribute
|
3 |
+
{
|
4 |
+
public function __construct()
|
5 |
+
{
|
6 |
+
parent::__construct();
|
7 |
+
$this->_filterModelName = 'avik_specialproduct/layer_filter_attribute';
|
8 |
+
}
|
9 |
+
}
|
app/code/local/Avik/Specialproduct/Block/Layer/Filter/Category.php
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Avik_Specialproduct_Block_Layer_Filter_Category extends Mage_Catalog_Block_Layer_Filter_Category
|
4 |
+
{
|
5 |
+
public function __construct()
|
6 |
+
{
|
7 |
+
parent::__construct();
|
8 |
+
$this->_filterModelName = 'avik_specialproduct/layer_filter_category';
|
9 |
+
}
|
10 |
+
}
|
app/code/local/Avik/Specialproduct/Block/Layer/Filter/Decimal.php
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Avik_Specialproduct_Block_Layer_Filter_Decimal extends Mage_Catalog_Block_Layer_Filter_Decimal
|
3 |
+
{
|
4 |
+
public function __construct()
|
5 |
+
{
|
6 |
+
parent::__construct();
|
7 |
+
$this->_filterModelName = 'avik_specialproduct/layer_filter_decimal';
|
8 |
+
}
|
9 |
+
}
|
app/code/local/Avik/Specialproduct/Block/Layer/Filter/Price.php
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Avik_Specialproduct_Block_Layer_Filter_Price extends Mage_Catalog_Block_Layer_Filter_Price
|
3 |
+
{
|
4 |
+
public function __construct()
|
5 |
+
{
|
6 |
+
parent::__construct();
|
7 |
+
$this->_filterModelName = 'avik_specialproduct/layer_filter_price';
|
8 |
+
}
|
9 |
+
}
|
app/code/local/Avik/Specialproduct/Block/Layer/New.php
ADDED
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Avik_Specialproduct_Block_Layer_New extends Mage_Catalog_Block_Layer_View
|
3 |
+
{
|
4 |
+
public function getLayer()
|
5 |
+
{
|
6 |
+
|
7 |
+
if (!$this->hasData('_layer')){
|
8 |
+
$layer = Mage::getSingleton('avik_specialproduct/layer');
|
9 |
+
$this->setData('_layer', $layer);
|
10 |
+
}
|
11 |
+
return $this->getData('_layer');
|
12 |
+
}
|
13 |
+
protected function _initBlocks()
|
14 |
+
{
|
15 |
+
parent::_initBlocks();
|
16 |
+
$this->_categoryBlockName = 'avik_specialproduct/layer_filter_category';
|
17 |
+
$this->_attributeFilterBlockName = 'avik_specialproduct/layer_filter_attribute';
|
18 |
+
$this->_priceFilterBlockName = 'avik_specialproduct/layer_filter_price';
|
19 |
+
$this->_decimalFilterBlockName = 'avik_specialproduct/layer_filter_decimal';
|
20 |
+
}
|
21 |
+
protected function _prepareLayout()
|
22 |
+
{
|
23 |
+
$stateBlock = $this->getLayout()->createBlock($this->_stateBlockName)
|
24 |
+
->setLayer($this->getLayer());
|
25 |
+
$this->setChild('layer_state', $stateBlock);
|
26 |
+
|
27 |
+
$categoryBlock = $this->getLayout()->createBlock($this->_categoryBlockName)
|
28 |
+
->setLayer($this->getLayer())
|
29 |
+
->init();
|
30 |
+
$this->setChild('category_filter', $categoryBlock);
|
31 |
+
$filterableAttributes = $this->_getFilterableAttributes();
|
32 |
+
foreach ($filterableAttributes as $attribute) {
|
33 |
+
|
34 |
+
if ($attribute->getAttributeCode() == 'price') {
|
35 |
+
$filterBlockName = $this->_priceFilterBlockName;
|
36 |
+
} elseif ($attribute->getBackendType() == 'decimal') {
|
37 |
+
$filterBlockName = $this->_decimalFilterBlockName;
|
38 |
+
}
|
39 |
+
else {
|
40 |
+
$filterBlockName = $this->_attributeFilterBlockName;
|
41 |
+
}
|
42 |
+
|
43 |
+
$this->setChild($attribute->getAttributeCode() . '_filter',
|
44 |
+
$this->getLayout()->createBlock($filterBlockName)
|
45 |
+
->setLayer($this->getLayer())
|
46 |
+
->setAttributeModel($attribute)
|
47 |
+
->init());
|
48 |
+
}
|
49 |
+
|
50 |
+
$this->getLayer()->apply();
|
51 |
+
return $this;
|
52 |
+
}
|
53 |
+
}
|
app/code/local/Avik/Specialproduct/Block/New.php
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Avik_Specialproduct_Block_New extends Mage_Catalog_Block_Product_List
|
3 |
+
{
|
4 |
+
public function __construct()
|
5 |
+
{
|
6 |
+
$this->addData(array(
|
7 |
+
'cache_lifetime' => 3600,
|
8 |
+
'cache_tags' => array(Mage_Core_Model_Store::CACHE_TAG, Mage_Cms_Model_Block::CACHE_TAG)
|
9 |
+
));
|
10 |
+
parent::__construct();
|
11 |
+
}
|
12 |
+
public function getModuleName()
|
13 |
+
{
|
14 |
+
return 'Mage_Catalog';
|
15 |
+
}
|
16 |
+
protected function _getProductCollection()
|
17 |
+
{
|
18 |
+
if (is_null($this->_productCollection)) {
|
19 |
+
$this->_productCollection = $this->getLayer()->getProductCollection();
|
20 |
+
}
|
21 |
+
$this->_productCollection->getSelect();
|
22 |
+
|
23 |
+
return $this->_productCollection;
|
24 |
+
}
|
25 |
+
public function getLayer()
|
26 |
+
{
|
27 |
+
$layer = Mage::registry('current_layer');
|
28 |
+
if ($layer) {
|
29 |
+
|
30 |
+
return $layer;
|
31 |
+
}
|
32 |
+
return Mage::getSingleton('avik_specialproduct/layer');
|
33 |
+
}
|
34 |
+
}
|
app/code/local/Avik/Specialproduct/Helper/Data.php
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Avik_Specialproduct_Helper_Data extends Mage_Core_Helper_Abstract
|
3 |
+
{
|
4 |
+
|
5 |
+
public function getOnSaleUrl()
|
6 |
+
{
|
7 |
+
$url = Mage::getUrl('', array(
|
8 |
+
'_current' => true,
|
9 |
+
'_use_rewrite' => true,
|
10 |
+
'_query' => array(
|
11 |
+
'sale' => 1,
|
12 |
+
'p' => NULL
|
13 |
+
)
|
14 |
+
));
|
15 |
+
|
16 |
+
return $url;
|
17 |
+
}
|
18 |
+
|
19 |
+
public function getNotOnSaleUrl()
|
20 |
+
{
|
21 |
+
$url = Mage::getUrl('', array(
|
22 |
+
'_current' => true,
|
23 |
+
'_use_rewrite' => true,
|
24 |
+
'_query' => array(
|
25 |
+
'sale' => NULL,
|
26 |
+
'p' => NULL
|
27 |
+
)
|
28 |
+
));
|
29 |
+
|
30 |
+
return $url;
|
31 |
+
}
|
32 |
+
|
33 |
+
}
|
app/code/local/Avik/Specialproduct/Model/Layer.php
ADDED
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Avik_Specialproduct_Model_Layer extends Mage_Catalog_Model_Layer
|
3 |
+
{
|
4 |
+
public function getStateKey()
|
5 |
+
{
|
6 |
+
if ($this->_stateKey === null) {
|
7 |
+
$this->_stateKey = 'STORE_'.Mage::app()->getStore()->getId()
|
8 |
+
. '_NEW_PRODUCTS_'
|
9 |
+
. '_CUSTGROUP_' . Mage::getSingleton('customer/session')->getCustomerGroupId();
|
10 |
+
}
|
11 |
+
|
12 |
+
return $this->_stateKey;
|
13 |
+
}
|
14 |
+
|
15 |
+
public function getStateTags(array $additionalTags = array())
|
16 |
+
{
|
17 |
+
$additionalTags = array_merge($additionalTags, array('special_products'));
|
18 |
+
return $additionalTags;
|
19 |
+
}
|
20 |
+
|
21 |
+
public function getProductCollection()
|
22 |
+
{
|
23 |
+
|
24 |
+
if (isset($this->_productCollections['special_products'])) {
|
25 |
+
|
26 |
+
$collection = $this->_productCollections['special_products'];
|
27 |
+
} else {
|
28 |
+
|
29 |
+
$collection = $this->_getCollection();
|
30 |
+
$this->prepareProductCollection($collection);
|
31 |
+
$this->_productCollections['special_products'] = $collection;
|
32 |
+
}
|
33 |
+
|
34 |
+
return $collection;
|
35 |
+
}
|
36 |
+
public function prepareProductCollection($collection)
|
37 |
+
{
|
38 |
+
|
39 |
+
$collection
|
40 |
+
->addAttributeToSelect(Mage::getSingleton('catalog/config')->getProductAttributes())
|
41 |
+
->addMinimalPrice()
|
42 |
+
->addFinalPrice()
|
43 |
+
->addTaxPercents()
|
44 |
+
->addUrlRewrite();
|
45 |
+
|
46 |
+
Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($collection);
|
47 |
+
Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($collection);
|
48 |
+
return $this;
|
49 |
+
}
|
50 |
+
|
51 |
+
protected function _getCollection()
|
52 |
+
{
|
53 |
+
$collection = Mage::getModel('catalog/product')->getCollection()->addAttributeToSelect('*')->addStoreFilter();
|
54 |
+
|
55 |
+
$collection->getSelect()->where('price_index.final_price < price_index.price');
|
56 |
+
|
57 |
+
|
58 |
+
return $collection;
|
59 |
+
}
|
60 |
+
|
61 |
+
|
62 |
+
}
|
app/code/local/Avik/Specialproduct/Model/Layer/Filter/Attribute.php
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Avik_Specialproduct_Model_Layer_Filter_Attribute extends Mage_Catalog_Model_Layer_Filter_Attribute
|
3 |
+
{
|
4 |
+
protected function _createItem($label, $value, $count = 0)
|
5 |
+
{
|
6 |
+
return Mage::getModel('avik_specialproduct/layer_filter_item')
|
7 |
+
->setFilter($this)
|
8 |
+
->setLabel($label)
|
9 |
+
->setValue($value)
|
10 |
+
->setCount($count);
|
11 |
+
}
|
12 |
+
}
|
app/code/local/Avik/Specialproduct/Model/Layer/Filter/Category.php
ADDED
@@ -0,0 +1,69 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Avik_Specialproduct_Model_Layer_Filter_Category extends Mage_Catalog_Model_Layer_Filter_Category
|
4 |
+
{
|
5 |
+
protected function _getItemsData(){
|
6 |
+
|
7 |
+
|
8 |
+
$key = $this->getLayer()->getStateKey().'_SUBCATEGORIES';
|
9 |
+
$data = $this->getLayer()->getAggregator()->getCacheData($key);
|
10 |
+
|
11 |
+
if ($data === null) {
|
12 |
+
$categoty = $this->getCategory();
|
13 |
+
$categories = $categoty->getChildrenCategories();
|
14 |
+
|
15 |
+
$this->getLayer()->getProductCollection()
|
16 |
+
->addCountToCategories($categories);
|
17 |
+
|
18 |
+
$data = array();
|
19 |
+
foreach ($categories as $category) {
|
20 |
+
if ($category->getIsActive() && $category->getProductCount()) {
|
21 |
+
$urlKey = $category->getUrlKey();
|
22 |
+
if (empty($urlKey)) {
|
23 |
+
$urlKey = $category->getId();
|
24 |
+
}
|
25 |
+
|
26 |
+
$data[] = array(
|
27 |
+
'label' => Mage::helper('core')->htmlEscape($category->getName()),
|
28 |
+
'value' => $urlKey,
|
29 |
+
'count' => $category->getProductCount(),
|
30 |
+
);
|
31 |
+
}
|
32 |
+
}
|
33 |
+
$tags = $this->getLayer()->getStateTags();
|
34 |
+
$this->getLayer()->getAggregator()->saveCacheData($data, $key, $tags);
|
35 |
+
}
|
36 |
+
return $data;
|
37 |
+
}
|
38 |
+
|
39 |
+
public function apply(Zend_Controller_Request_Abstract $request, $filterBlock){
|
40 |
+
|
41 |
+
$filter = $request->getParam($this->getRequestVar());
|
42 |
+
if (!$filter) {
|
43 |
+
return $this;
|
44 |
+
}
|
45 |
+
|
46 |
+
$this->_appliedCategory = Mage::getModel('catalog/category')
|
47 |
+
->setStoreId(Mage::app()->getStore()->getId())
|
48 |
+
->loadByAttribute('url_key', $filter);
|
49 |
+
|
50 |
+
if (! ($this->_appliedCategory instanceof Mage_Catalog_Model_Category)) {
|
51 |
+
return parent::apply($request, $filterBlock);
|
52 |
+
}
|
53 |
+
|
54 |
+
$this->_categoryId = $this->_appliedCategory->getId();
|
55 |
+
Mage::register('current_category_filter', $this->getCategory(), true);
|
56 |
+
|
57 |
+
if ($this->_isValidCategory($this->_appliedCategory)) {
|
58 |
+
$this->getLayer()->getProductCollection()
|
59 |
+
->addCategoryFilter($this->_appliedCategory);
|
60 |
+
|
61 |
+
$this->getLayer()->getState()->addFilter(
|
62 |
+
$this->_createItem($this->_appliedCategory->getName(), $filter)
|
63 |
+
);
|
64 |
+
}
|
65 |
+
|
66 |
+
return $this;
|
67 |
+
}
|
68 |
+
|
69 |
+
}
|
app/code/local/Avik/Specialproduct/Model/Layer/Filter/Decimal.php
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Avik_Specialproduct_Model_Layer_Filter_Decimal extends Mage_Catalog_Model_Layer_Filter_Attribute
|
3 |
+
{
|
4 |
+
protected function _createItem($label, $value, $count = 0)
|
5 |
+
{
|
6 |
+
return Mage::getModel('avik_specialproduct/layer_filter_item')
|
7 |
+
->setFilter($this)
|
8 |
+
->setLabel($label)
|
9 |
+
->setValue($value)
|
10 |
+
->setCount($count);
|
11 |
+
}
|
12 |
+
}
|
app/code/local/Avik/Specialproduct/Model/Layer/Filter/Item.php
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Avik_Specialproduct_Model_Layer_Filter_Item extends Mage_Catalog_Model_Layer_Filter_Item
|
3 |
+
{
|
4 |
+
|
5 |
+
}
|
app/code/local/Avik/Specialproduct/Model/Layer/Filter/Price.php
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Avik_Specialproduct_Model_Layer_Filter_Price extends Mage_Catalog_Model_Layer_Filter_Price
|
3 |
+
{
|
4 |
+
protected function _createItem($label, $value, $count = 0)
|
5 |
+
{
|
6 |
+
return Mage::getModel('avik_specialproduct/layer_filter_item')
|
7 |
+
->setFilter($this)
|
8 |
+
->setLabel($label)
|
9 |
+
->setValue($value)
|
10 |
+
->setCount($count);
|
11 |
+
}
|
12 |
+
}
|
app/code/local/Avik/Specialproduct/controllers/IndexController.php
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Avik_Specialproduct_IndexController extends Mage_Core_Controller_Front_Action{
|
3 |
+
|
4 |
+
protected function _initAction() {
|
5 |
+
$this->loadLayout();
|
6 |
+
$this->getLayout()->getBlock("content")->setTitle($this->__("Special Offers"));
|
7 |
+
$breadcrumbs = $this->getLayout()->getBlock("breadcrumbs");
|
8 |
+
|
9 |
+
$breadcrumbs->addCrumb("home", array(
|
10 |
+
"label" => $this->__("Home"),
|
11 |
+
"title" => $this->__("Home"),
|
12 |
+
"link" => Mage::getBaseUrl()
|
13 |
+
));
|
14 |
+
|
15 |
+
$breadcrumbs->addCrumb("special-offers", array(
|
16 |
+
"label" => $this->__("Special Offers"),
|
17 |
+
"title" => $this->__("Special Offers")
|
18 |
+
));
|
19 |
+
|
20 |
+
return $this;
|
21 |
+
}
|
22 |
+
public function indexAction(){
|
23 |
+
|
24 |
+
$this->_initAction();
|
25 |
+
$this->renderLayout();
|
26 |
+
}
|
27 |
+
|
28 |
+
|
29 |
+
}
|
app/code/local/Avik/Specialproduct/etc/config.xml
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Avik_Specialproduct>
|
5 |
+
<version>1.6.0</version>
|
6 |
+
</Avik_Specialproduct>
|
7 |
+
</modules>
|
8 |
+
<global>
|
9 |
+
<models>
|
10 |
+
<avik_specialproduct>
|
11 |
+
<class>Avik_Specialproduct_Model</class>
|
12 |
+
</avik_specialproduct>
|
13 |
+
</models>
|
14 |
+
<blocks>
|
15 |
+
<avik_specialproduct>
|
16 |
+
<class>Avik_Specialproduct_Block</class>
|
17 |
+
</avik_specialproduct>
|
18 |
+
</blocks>
|
19 |
+
<helpers>
|
20 |
+
<avik_specialproduct>
|
21 |
+
<class>Avik_Specialproduct_Helper</class>
|
22 |
+
</avik_specialproduct>
|
23 |
+
</helpers>
|
24 |
+
|
25 |
+
</global>
|
26 |
+
<frontend>
|
27 |
+
<routers>
|
28 |
+
<specialproduct>
|
29 |
+
<use>standard</use>
|
30 |
+
<args>
|
31 |
+
<module>Avik_Specialproduct</module>
|
32 |
+
<frontName>special-offers</frontName>
|
33 |
+
</args>
|
34 |
+
</specialproduct>
|
35 |
+
</routers>
|
36 |
+
<layout>
|
37 |
+
<updates>
|
38 |
+
<specialproduct>
|
39 |
+
<file>avik/specialproduct.xml</file>
|
40 |
+
</specialproduct>
|
41 |
+
</updates>
|
42 |
+
</layout>
|
43 |
+
</frontend>
|
44 |
+
</config>
|
app/design/frontend/base/default/layout/avik/specialproduct.xml
ADDED
@@ -0,0 +1,88 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
|
3 |
+
|
4 |
+
|
5 |
+
<layout version="0.1.0">
|
6 |
+
|
7 |
+
<default translate="label">
|
8 |
+
|
9 |
+
<reference name="head">
|
10 |
+
|
11 |
+
<action method="addItem"><type>skin_css</type><name>sm/shopby/css/loader-style.css</name></action>
|
12 |
+
|
13 |
+
</reference>
|
14 |
+
|
15 |
+
<reference name="before_body_end">
|
16 |
+
|
17 |
+
<block type="core/template" template="sm/shopby/footermask/loading.phtml" name="shopby_loading" after="-"></block>
|
18 |
+
|
19 |
+
</reference>
|
20 |
+
|
21 |
+
</default>
|
22 |
+
|
23 |
+
<specialproduct_index_index>
|
24 |
+
|
25 |
+
<reference name="head">
|
26 |
+
<action method="setTitle" translate="title" module="customer"><title>Special Offers</title></action>
|
27 |
+
</reference>
|
28 |
+
|
29 |
+
<reference name="root">
|
30 |
+
|
31 |
+
<action method="setTemplate">
|
32 |
+
|
33 |
+
<template>page/2columns-left.phtml</template>
|
34 |
+
|
35 |
+
</action>
|
36 |
+
|
37 |
+
</reference>
|
38 |
+
|
39 |
+
<reference name="left">
|
40 |
+
|
41 |
+
<block type="avik_specialproduct/layer_new" name="catalog.leftnav" before="-" template="avik/navigation/left.phtml" />
|
42 |
+
|
43 |
+
</reference>
|
44 |
+
|
45 |
+
<reference name="content">
|
46 |
+
|
47 |
+
<block type="core/template" name="new_products_container" as="new_products_container" template="avik/specialproduct.phtml">
|
48 |
+
<action method="setCacheLifetime">
|
49 |
+
<lifetime>3600</lifetime> <!-- Cache Lifetime of 1 hour -->
|
50 |
+
</action>
|
51 |
+
|
52 |
+
<action method="setTitle" translate="title" module="avik_specialproduct">
|
53 |
+
|
54 |
+
<title>Promoted Items</title>
|
55 |
+
|
56 |
+
</action>
|
57 |
+
|
58 |
+
<block type="avik_specialproduct/new" name="new_product" as="new_products" template="catalog/product/list.phtml">
|
59 |
+
|
60 |
+
<block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml">
|
61 |
+
|
62 |
+
<block type="page/html_pager" name="product_list_toolbar_pager"/>
|
63 |
+
|
64 |
+
</block>
|
65 |
+
|
66 |
+
<action method="addColumnCountLayoutDepend"><layout>empty</layout><count>6</count></action>
|
67 |
+
|
68 |
+
<action method="addColumnCountLayoutDepend"><layout>one_column</layout><count>5</count></action>
|
69 |
+
|
70 |
+
<action method="addColumnCountLayoutDepend"><layout>two_columns_left</layout><count>4</count></action>
|
71 |
+
|
72 |
+
<action method="addColumnCountLayoutDepend"><layout>two_columns_right</layout><count>4</count></action>
|
73 |
+
|
74 |
+
<action method="addColumnCountLayoutDepend"><layout>three_columns</layout><count>3</count></action>
|
75 |
+
|
76 |
+
<action method="setToolbarBlockName"><name>product_list_toolbar</name></action>
|
77 |
+
|
78 |
+
</block>
|
79 |
+
|
80 |
+
</block>
|
81 |
+
|
82 |
+
</reference>
|
83 |
+
|
84 |
+
|
85 |
+
|
86 |
+
</specialproduct_index_index>
|
87 |
+
|
88 |
+
</layout>
|
app/design/frontend/base/default/template/avik/navigation/left.phtml
ADDED
@@ -0,0 +1,93 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*------------------------------------------------------------------------
|
4 |
+
|
5 |
+
# SM Shop By - Version 1.0
|
6 |
+
|
7 |
+
# Copyright (c) 2014 YouTech Company. All Rights Reserved.
|
8 |
+
|
9 |
+
# @license - Copyrighted Commercial Software
|
10 |
+
|
11 |
+
# Author: YouTech Company
|
12 |
+
|
13 |
+
# Websites: http://www.magentech.com
|
14 |
+
|
15 |
+
-------------------------------------------------------------------------*/?>
|
16 |
+
<?php $pager = isset($pager) ? $pager : ''?>
|
17 |
+
<?php $_currentMode = $mode = $this->getLayout()->createBlock('catalog/product_list_toolbar')->setChild('product_list_toolbar_pager', $pager)->getCurrentMode();?>
|
18 |
+
|
19 |
+
<?php if ($this->canShowBlock()): ?>
|
20 |
+
|
21 |
+
<div id="layered-navigation">
|
22 |
+
|
23 |
+
<div class="block block-layered-nav">
|
24 |
+
|
25 |
+
<div class="block-title">
|
26 |
+
|
27 |
+
<strong><span><?php echo $this->__('Shop By') ?></span></strong>
|
28 |
+
|
29 |
+
</div>
|
30 |
+
|
31 |
+
<?php if($this->getStateHtml() && $this->getLayer()->getState()->getFilters()) { ?>
|
32 |
+
|
33 |
+
<div class="currently-wrap">
|
34 |
+
|
35 |
+
<?php echo $this->getStateHtml() ?>
|
36 |
+
|
37 |
+
<?php if ($this->getLayer()->getState()->getFilters()): ?>
|
38 |
+
<div class="actions"><a class="button" onclick="getFilterAjaxRemoveall('<?php echo $this->getClearUrl()?>','<?php echo $_currentMode?>');" href="javascript:;"><?php echo $this->__('Clear All') ?></a></div>
|
39 |
+
|
40 |
+
<?php endif; ?>
|
41 |
+
|
42 |
+
</div>
|
43 |
+
|
44 |
+
<?php } ?>
|
45 |
+
|
46 |
+
<div class="block-content">
|
47 |
+
|
48 |
+
|
49 |
+
|
50 |
+
<?php if ($this->canShowOptions()): ?>
|
51 |
+
|
52 |
+
<!--<p class="block-subtitle"><?php echo $this->__('Shopping Options') ?></p>-->
|
53 |
+
|
54 |
+
<dl id="narrow-by-list">
|
55 |
+
|
56 |
+
<?php $_filters = $this->getFilters() ?>
|
57 |
+
|
58 |
+
<?php foreach ($_filters as $_filter): ?>
|
59 |
+
|
60 |
+
<?php if ($_filter->getItemsCount()): ?>
|
61 |
+
|
62 |
+
<dt class="<?php echo $this->__($_filter->getName()) ?>"><?php echo $this->__($_filter->getName()) ?></dt>
|
63 |
+
|
64 |
+
<dd><?php echo $_filter->getHtml() ?></dd>
|
65 |
+
|
66 |
+
<?php endif; ?>
|
67 |
+
|
68 |
+
<?php endforeach; ?>
|
69 |
+
|
70 |
+
</dl>
|
71 |
+
|
72 |
+
<script type="text/javascript">decorateDataList('narrow-by-list')</script>
|
73 |
+
|
74 |
+
<?php endif; ?>
|
75 |
+
|
76 |
+
|
77 |
+
|
78 |
+
<?php /*if ($this->getLayer()->getState()->getFilters()): ?>
|
79 |
+
|
80 |
+
<div class="actions"><a class="button" href="<?php echo $this->getClearUrl() ?>"><?php echo $this->__('Clear All') ?></a></div>
|
81 |
+
|
82 |
+
<?php endif;*/ ?>
|
83 |
+
|
84 |
+
|
85 |
+
|
86 |
+
</div>
|
87 |
+
|
88 |
+
</div>
|
89 |
+
|
90 |
+
</div>
|
91 |
+
|
92 |
+
<?php endif; ?>
|
93 |
+
|
app/design/frontend/base/default/template/avik/specialproduct.phtml
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php if ($this->getTitle()) : ?>
|
2 |
+
<div class="page-title category-title">
|
3 |
+
<h1><?php echo $this->getTitle() ?></h1>
|
4 |
+
</div>
|
5 |
+
|
6 |
+
<?php endif;?>
|
7 |
+
<?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
|
8 |
+
<?php echo $this->getChildHtml();?>
|
app/etc/modules/Avik_Specialproduct.xml
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Avik_Specialproduct>
|
5 |
+
<active>true</active>
|
6 |
+
<codePool>local</codePool>
|
7 |
+
</Avik_Specialproduct>
|
8 |
+
</modules>
|
9 |
+
</config>
|
package.xml
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<package>
|
3 |
+
<name>avikonsale001</name>
|
4 |
+
<version>1.6.0</version>
|
5 |
+
<stability>stable</stability>
|
6 |
+
<license>OSL</license>
|
7 |
+
<channel>community</channel>
|
8 |
+
<extends/>
|
9 |
+
<summary>Onsale product listing with layered navigation </summary>
|
10 |
+
<description>Display all product which has product special price with layered navigation filtering. </description>
|
11 |
+
<notes>Display all product which has product special price with layered navigation filtering. </notes>
|
12 |
+
<authors><author><name>Avik Roy</name><user>avik_roy</user><email>royavik88@gmail.com</email></author></authors>
|
13 |
+
<date>2016-09-14</date>
|
14 |
+
<time>05:55:13</time>
|
15 |
+
<contents><target name="magelocal"><dir name="Avik"><dir name="Specialproduct"><dir name="Block"><dir name="Layer"><dir name="Filter"><file name="Attribute.php" hash="946d58d8bb9f08ba73bc36fba8a01527"/><file name="Category.php" hash="aeccddd3f28e916e67305454730957c0"/><file name="Decimal.php" hash="8f2ba4aab2f300a9fbe280f0e91cc0a0"/><file name="Price.php" hash="993ae73b643126322cccf1b7ea68503f"/></dir><file name="New.php" hash="511e4afcfde34b0ddcf67e7be3bdd089"/></dir><file name="New.php" hash="31f44994ecc896a33025666581a323e2"/></dir><dir name="Helper"><file name="Data.php" hash="eaf02c14b63cf99ac83f8625622e15dd"/></dir><dir name="Model"><dir name="Layer"><dir name="Filter"><file name="Attribute.php" hash="e913b961518c6a76f75ede2df092f704"/><file name="Category.php" hash="868adf0ca3cad2b8206431e34efb20d4"/><file name="Decimal.php" hash="3c5d64f5ef7279d44bc4ebcb580ae196"/><file name="Item.php" hash="4a603b854bce1fb4185553454ff99379"/><file name="Price.php" hash="5ca3279a29480c2b876dcf61c5da7629"/></dir></dir><file name="Layer.php" hash="027cf8f0b2900e4ec68fe0ffd4703547"/></dir><dir name="controllers"><file name="IndexController.php" hash="9ddf36a398a48c2f0932adabf4184380"/></dir><dir name="etc"><file name="config.xml" hash="e2269a714c16d21019e12afe8fe73d3b"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Avik_Specialproduct.xml" hash="85e75a9a488912521cb62aa93c260727"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><dir name="avik"><file name="specialproduct.xml" hash="3dd0e36e62d58df0b53967e6f5760a3a"/></dir></dir><dir name="template"><dir name="avik"><dir name="navigation"><file name="left.phtml" hash="298749cbaddcbb72184bd13fc9d67d81"/></dir><file name="specialproduct.phtml" hash="5c36536bdc266894ded8192412328770"/></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>
|