Kulmage_Advance_Lists_Mode - Version 1.0.0

Version Notes

New Release

Download this release

Release Info

Developer Kuldipsinh
Extension Kulmage_Advance_Lists_Mode
Version 1.0.0
Comparing to
See all releases


Version 1.0.0

app/code/local/Kulmage/Textlist/Block/Product/List/Toolbar.php ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Product list toolbar
4
+ *
5
+ * @category Kulmage
6
+ * @package Kulmage_Textlist
7
+ * @author Kulmage
8
+ */
9
+ class Kulmage_Textlist_Block_Product_List_Toolbar extends Mage_Catalog_Block_Product_List_Toolbar
10
+ {
11
+ protected $_availableOrder = array();
12
+
13
+ /**
14
+ * List of available view types
15
+ *
16
+ * @var string
17
+ */
18
+ protected $_availableMode = array();
19
+
20
+ /**
21
+ * Default Order field
22
+ *
23
+ * @var string
24
+ */
25
+ protected $_orderField = null;
26
+
27
+
28
+ protected function _getConfig()
29
+ {
30
+ return Mage::getSingleton('catalog/config');
31
+ }
32
+
33
+ /**
34
+ * Init Toolbar
35
+ *
36
+ */
37
+ protected function _construct()
38
+ {
39
+ parent::_construct();
40
+ $this->_orderField = Mage::getStoreConfig(
41
+ Mage_Catalog_Model_Config::XML_PATH_LIST_DEFAULT_SORT_BY
42
+ );
43
+
44
+ $this->_availableOrder = $this->_getConfig()->getAttributeUsedForSortByArray();
45
+
46
+ switch (Mage::getStoreConfig('catalog/frontend/list_mode')) {
47
+ case 'grid':
48
+ $this->_availableMode = array('grid' => $this->__('Grid'));
49
+ break;
50
+
51
+ case 'list':
52
+ $this->_availableMode = array('list' => $this->__('List'));
53
+ break;
54
+
55
+ case 'textlist-list-grid':
56
+ $this->_availableMode = array('grid' => $this->__('Grid'), 'list' => $this->__('List'),'text-list' => $this->__('Text List'));
57
+ break;
58
+
59
+ case 'grid-list':
60
+ $this->_availableMode = array('grid' => $this->__('Grid'), 'list' => $this->__('List'));
61
+ break;
62
+
63
+ case 'list-grid':
64
+ $this->_availableMode = array('list' => $this->__('List'), 'grid' => $this->__('Grid'));
65
+ break;
66
+ }
67
+ $this->setTemplate('catalog/product/list/toolbar.phtml');
68
+ }
69
+ }
app/code/local/Kulmage/Textlist/Helper/Data.php ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Kulmage_Textlist_Helper_Data extends Mage_Core_Helper_Abstract
4
+ {
5
+
6
+ }
app/code/local/Kulmage/Textlist/Model/System/Config/Source/Model.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Kulmage_Textlist_Model_System_Config_Source_Model
3
+ {
4
+ public function toOptionArray()
5
+ {
6
+
7
+ return array(
8
+ //array('value'=>'', 'label'=>''),
9
+ array('value'=>'grid', 'label'=>Mage::helper('adminhtml')->__('Grid Only')),
10
+ array('value'=>'list', 'label'=>Mage::helper('adminhtml')->__('List Only')),
11
+ array('value'=>'grid-list', 'label'=>Mage::helper('adminhtml')->__('Grid (default) / List')),
12
+ array('value'=>'list-grid', 'label'=>Mage::helper('adminhtml')->__('List (default) / Grid')),
13
+ array('value'=>'textlist-list-grid', 'label'=>Mage::helper('adminhtml')->__('List (default) / Grid / Text List')),
14
+ );
15
+ }
16
+ }
app/code/local/Kulmage/Textlist/etc/config.xml ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * @category Kulmage
5
+ * @package Kulmage_Textlist
6
+ * @author ModuleCreator
7
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
8
+ */
9
+ -->
10
+ <config>
11
+ <modules>
12
+ <Kulmage_Textlist>
13
+ <version>0.1.0</version>
14
+ </Kulmage_Textlist>
15
+ </modules>
16
+ <frontend>
17
+ <layout>
18
+ <updates>
19
+ <textlist>
20
+ <file>textlist.xml</file>
21
+ </textlist>
22
+ </updates>
23
+ </layout>
24
+ </frontend>
25
+ <global>
26
+ <models>
27
+ <textlist>
28
+ <class>Kulmage_Textlist_Model</class>
29
+ <resourceModel>textlist_mysql4</resourceModel>
30
+ </textlist>
31
+ <textlist_mysql4>
32
+ <class>Kulmage_Textlist_Model_Mysql4</class>
33
+ <entities>
34
+ <textlist>
35
+ <table>textlist</table>
36
+ </textlist>
37
+ </entities>
38
+ </textlist_mysql4>
39
+ </models>
40
+ <blocks>
41
+ <catalog>
42
+ <rewrite>
43
+ <product_list_toolbar>Kulmage_Textlist_Block_Product_List_Toolbar</product_list_toolbar>
44
+ </rewrite>
45
+ </catalog>
46
+ </blocks>
47
+ <helpers>
48
+ <textlist>
49
+ <class>Kulmage_Textlist_Helper</class>
50
+ </textlist>
51
+ </helpers>
52
+ </global>
53
+ </config>
app/code/local/Kulmage/Textlist/etc/system.xml ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <sections>
4
+ <catalog>
5
+ <groups>
6
+ <frontend>
7
+ <label>Frontend</label>
8
+ <frontend_type>text</frontend_type>
9
+ <sort_order>100</sort_order>
10
+ <show_in_default>1</show_in_default>
11
+ <show_in_website>1</show_in_website>
12
+ <show_in_store>1</show_in_store>
13
+ <fields>
14
+ <list_mode translate="label">
15
+ <label>List Mode</label>
16
+ <frontend_type>select</frontend_type>
17
+ <source_model>textlist/system_config_source_model</source_model>
18
+ <sort_order>1</sort_order>
19
+ <show_in_default>1</show_in_default>
20
+ <show_in_website>1</show_in_website>
21
+ <show_in_store>1</show_in_store>
22
+ </list_mode>
23
+ </fields>
24
+ </frontend>
25
+ </groups>
26
+ </catalog>
27
+ </sections>
28
+ </config>
app/design/frontend/default/default/layout/textlist.xml ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="0.1.0">
3
+ <default>
4
+ </default>
5
+ <catalog_category_default>
6
+ <reference name="product_list">
7
+ <action method="setTemplate">
8
+ <template>textlist/catalog/product/textlist.phtml</template>
9
+ </action>
10
+ </reference>
11
+ </catalog_category_default>
12
+ <catalog_category_layered>
13
+ <reference name="product_list">
14
+ <action method="setTemplate">
15
+ <template>textlist/catalog/product/textlist.phtml</template>
16
+ </action>
17
+ </reference>
18
+ </catalog_category_layered>
19
+ </layout>
app/design/frontend/default/default/template/textlist/catalog/product/textlist.phtml ADDED
@@ -0,0 +1,146 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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) 2013 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
+ $_productCollection=$this->getLoadedProductCollection();
36
+ $_helper = $this->helper('catalog/output');
37
+ ?>
38
+ <?php if(!$_productCollection->count()): ?>
39
+ <p class="note-msg"><?php echo $this->__('There are no products matching the selection.') ?></p>
40
+ <?php else: ?>
41
+ <div class="category-products">
42
+ <?php echo $this->getToolbarHtml() ?>
43
+
44
+ <?php if($this->getMode() == 'list'): ?>
45
+ <?php echo 'List mode'; ?>
46
+ <?php $_iterator = 0; ?>
47
+ <ol class="products-list" id="products-list">
48
+ <?php foreach ($_productCollection as $_product): ?>
49
+ <li class="item<?php if( ++$_iterator == sizeof($_productCollection) ): ?> last<?php endif; ?>">
50
+ <?php // Product Image ?>
51
+ <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>
52
+ <?php // Product description ?>
53
+ <div class="product-shop">
54
+ <div class="f-fix">
55
+ <?php $_productNameStripped = $this->stripTags($_product->getName(), null, true); ?>
56
+ <h2 class="product-name"><a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $_productNameStripped; ?>"><?php echo $_helper->productAttribute($_product, $_product->getName() , 'name'); ?></a></h2>
57
+ <?php if($_product->getRatingSummary()): ?>
58
+ <?php echo $this->getReviewsSummaryHtml($_product) ?>
59
+ <?php endif; ?>
60
+ <?php echo $this->getPriceHtml($_product, true) ?>
61
+ <?php if($_product->isSaleable()): ?>
62
+ <p><button type="button" title="<?php echo $this->__('Add toasxs Cart') ?>" class="button btn-cart" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>')"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button></p>
63
+ <?php else: ?>
64
+ <p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
65
+ <?php endif; ?>
66
+ <div class="desc std">
67
+ <?php echo $_helper->productAttribute($_product, $_product->getShortDescription(), 'short_description') ?>
68
+ <a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $_productNameStripped ?>" class="link-learn"><?php echo $this->__('Learn More') ?></a>
69
+ </div>
70
+ <ul class="add-to-links">
71
+ <?php if ($this->helper('wishlist')->isAllow()) : ?>
72
+ <li><a href="<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a></li>
73
+ <?php endif; ?>
74
+ <?php if($_compareUrl=$this->getAddToCompareUrl($_product)): ?>
75
+ <li><span class="separator">|</span> <a href="<?php echo $_compareUrl ?>" class="link-compare"><?php echo $this->__('Add to Compare') ?></a></li>
76
+ <?php endif; ?>
77
+ </ul>
78
+ </div>
79
+ </div>
80
+ </li>
81
+ <?php endforeach; ?>
82
+ </ol>
83
+ <script type="text/javascript">decorateList('products-list', 'none-recursive')</script>
84
+
85
+ <?php elseif($this->getMode() == 'grid'): ?>
86
+
87
+ <?php echo 'Grid Mode'; ?>
88
+
89
+ <?php $_collectionSize = $_productCollection->count() ?>
90
+ <?php $_columnCount = $this->getColumnCount(); ?>
91
+ <?php $i=0; foreach ($_productCollection as $_product): ?>
92
+ <?php if ($i++%$_columnCount==0): ?>
93
+ <ul class="products-grid">
94
+ <?php endif ?>
95
+ <li class="item<?php if(($i-1)%$_columnCount==0): ?> first<?php elseif($i%$_columnCount==0): ?> last<?php endif; ?>">
96
+ <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>
97
+ <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>
98
+ <?php if($_product->getRatingSummary()): ?>
99
+ <?php echo $this->getReviewsSummaryHtml($_product, 'short') ?>
100
+ <?php endif; ?>
101
+ <?php echo $this->getPriceHtml($_product, true) ?>
102
+ <div class="actions">
103
+ <?php if($_product->isSaleable()): ?>
104
+ <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>
105
+ <?php else: ?>
106
+ <p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
107
+ <?php endif; ?>
108
+ <ul class="add-to-links">
109
+ <?php if ($this->helper('wishlist')->isAllow()) : ?>
110
+ <li><a href="<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a></li>
111
+ <?php endif; ?>
112
+ <?php if($_compareUrl=$this->getAddToCompareUrl($_product)): ?>
113
+ <li><span class="separator">|</span> <a href="<?php echo $_compareUrl ?>" class="link-compare"><?php echo $this->__('Add to Compare') ?></a></li>
114
+ <?php endif; ?>
115
+ </ul>
116
+ </div>
117
+ </li>
118
+ <?php if ($i%$_columnCount==0 || $i==$_collectionSize): ?>
119
+ </ul>
120
+ <?php endif ?>
121
+ <?php endforeach ?>
122
+ <script type="text/javascript">decorateGeneric($$('ul.products-grid'), ['odd','even','first','last'])</script>
123
+ <?php elseif($this->getMode() == 'text-list'): ?>
124
+
125
+ <?php // Text list Mode ?>
126
+
127
+ <?php $_collectionSize = $_productCollection->count() ?>
128
+ <?php $_columnCount = $this->getColumnCount(); ?>
129
+ <?php $i=0; foreach ($_productCollection as $_product): ?>
130
+ <?php if ($i++%$_columnCount==0): ?>
131
+ <ul class="products-grid">
132
+ <?php endif ?>
133
+ <li class="item<?php if(($i-1)%$_columnCount==0): ?> first<?php elseif($i%$_columnCount==0): ?> last<?php endif; ?>">
134
+ <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>
135
+ </li>
136
+ <?php if ($i%$_columnCount==0 || $i==$_collectionSize): ?>
137
+ </ul>
138
+ <?php endif ?>
139
+ <?php endforeach ?>
140
+ <script type="text/javascript">decorateGeneric($$('ul.products-grid'), ['odd','even','first','last'])</script>
141
+ <?php endif; ?>
142
+ <div class="toolbar-bottom">
143
+ <?php echo $this->getToolbarHtml() ?>
144
+ </div>
145
+ </div>
146
+ <?php endif; ?>
app/etc/modules/Kulmage_Textlist.xml ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * @category Kulmage
5
+ * @package Kulmage_Textlist
6
+ * @author ModuleCreator
7
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
8
+ */
9
+ -->
10
+ <config>
11
+ <modules>
12
+ <Kulmage_Textlist>
13
+ <active>true</active>
14
+ <codePool>local</codePool>
15
+ </Kulmage_Textlist>
16
+ </modules>
17
+ </config>
package.xml ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Kulmage_Advance_Lists_Mode</name>
4
+ <version>1.0.0</version>
5
+ <stability>stable</stability>
6
+ <license uri="http://opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>This extension allow user to set one more list mode , and which contain only text data.</summary>
10
+ <description>This extension allow user to set one more list mode , and which contain only text data.&#xD;
11
+ &#xD;
12
+ This will show on product list page as third mode type.&#xD;
13
+ &#xD;
14
+ This type will show only text contest , other than images.&#xD;
15
+ &#xD;
16
+ we will shortly provide new version with admin control to hide/show images . add to cart , other links and product name&#xD;
17
+ </description>
18
+ <notes>New Release</notes>
19
+ <authors><author><name>Kuldipsinh</name><user>kuldip</user><email>er.kuldipsinh@gmail.com</email></author></authors>
20
+ <date>2013-12-31</date>
21
+ <time>14:39:04</time>
22
+ <contents><target name="mageetc"><dir name="modules"><file name="Kulmage_Textlist.xml" hash="6dc787c4d4c461276d4c5d3548b7134c"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="textlist.xml" hash="55dd9d6826983fb53e810379c28af68a"/></dir><dir name="template"><dir name="textlist"><dir><dir name="catalog"><dir name="product"><file name="textlist.phtml" hash="21ca3d8cbb01cc19c1ddabe34acdbaac"/></dir></dir></dir></dir></dir></dir></dir></dir></target><target name="magelocal"><dir name="Kulmage"><dir name="Textlist"><dir name="Block"><dir name="Product"><dir name="List"><file name="Toolbar.php" hash="afbb30dbd766e0b76dc77e8b87d98d5f"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="4868c9ac31e0fed2ebb8d216d6a8439f"/></dir><dir name="Model"><dir name="System"><dir name="Config"><dir name="Source"><file name="Model.php" hash="9de3e06d164b997303774eae26bda4a2"/></dir></dir></dir></dir><dir name="etc"><file name="config.xml" hash="240b72bd622e4e81c764bc2e23d99688"/><file name="system.xml" hash="8b057a01c9c0a422356e41bb040d706b"/></dir></dir></dir></target></contents>
23
+ <compatible/>
24
+ <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
25
+ </package>