strapp_multitab_product_view - Version 1.0.0

Version Notes

A lot of products have a lot of information that needs to be displayed for e.g. a smart phone would have information about the features, battery, OS, processor, maintenance, etc. And each of these would have a lot of details. For a good user experience, having this information in tabs would be very helpful.Magento doesn't provide information to be displayed as tabs by default, in the product description page. With the Multi tab extension, you can very easily have any number of tabs for your product.

Download this release

Release Info

Developer StrApp
Extension strapp_multitab_product_view
Version 1.0.0
Comparing to
See all releases


Version 1.0.0

app/code/local/Strapp/Multitab/etc/adminhtml.xml ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
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> <multitab translate="title" module="strapp_multitab">
14
+ <title>Strapp Multitab</title>
15
+ <sort_order>1</sort_order>
16
+ </multitab>
17
+ </children>
18
+ </config>
19
+ </children>
20
+ </system>
21
+ </children>
22
+ </admin>
23
+ </resources>
24
+ </acl>
25
+ </config>
app/code/local/Strapp/Multitab/etc/adminhtml.xml~ ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
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> <multitab translate="title" module="strapp_multitab">
14
+ <title>Strapp Multitab</title>
15
+ <sort_order>1</sort_order>
16
+ </multitab>
17
+ </children>
18
+ </config>
19
+ </children>
20
+ </system>
21
+ </children>
22
+ </admin>
23
+ </resources>
24
+ </acl>
25
+ </config>
app/code/local/Strapp/Multitab/etc/config.xml ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Strapp_Multitab>
5
+ <version>1.0.0</version>
6
+ </Strapp_Multitab>
7
+ </modules>
8
+ <frontend>
9
+ <routers>
10
+ <multitab>
11
+ <use>standard</use>
12
+ <args>
13
+ <module>Strapp_Multitab</module>
14
+ <frontName>multitab</frontName>
15
+ </args>
16
+ </multitab>
17
+ </routers>
18
+ <layout>
19
+ <updates>
20
+ <strapp_multitab module="strapp_multitab">
21
+ <file>strapp_multitabdisplay.xml</file>
22
+ </strapp_multitab>
23
+ </updates>
24
+ </layout>
25
+ </frontend>
26
+ <global>
27
+ <models>
28
+ <strapp_multitab>
29
+ <class>Strapp_Multitab_Model</class>
30
+ </strapp_multitab>
31
+ </models>
32
+ <blocks>
33
+ <strapp_multitab>
34
+ <class>Strapp_Multitab_Block</class>
35
+ </strapp_multitab>
36
+ </blocks>
37
+ <helpers>
38
+ <strapp_multitab>
39
+ <class>Strapp_Multitab_Helper</class>
40
+ </strapp_multitab>
41
+ </helpers>
42
+ </global>
43
+ <default>
44
+ <multitab>
45
+ <additionalinfo>
46
+ <enable>1</enable>
47
+ </additionalinfo>
48
+ </multitab>
49
+ </default>
50
+ </config>
app/code/local/Strapp/Multitab/etc/config.xml~ ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Strapp_Multitab>
5
+ <version>1.0.0</version>
6
+ </Strapp_Multitab>
7
+ </modules>
8
+ <frontend>
9
+ <routers>
10
+ <multitab>
11
+ <use>standard</use>
12
+ <args>
13
+ <module>Strapp_Multitab</module>
14
+ <frontName>multitab</frontName>
15
+ </args>
16
+ </multitab>
17
+ </routers>
18
+ <layout>
19
+ <updates>
20
+ <strapp_multitab module="strapp_multitab">
21
+ <file>strapp_multitabdisplay.xml</file>
22
+ </strapp_multitab>
23
+ </updates>
24
+ </layout>
25
+ </frontend>
26
+ <global>
27
+ <models>
28
+ <strapp_multitab>
29
+ <class>Strapp_Multitab_Model</class>
30
+ </strapp_multitab>
31
+ </models>
32
+ <blocks>
33
+ <strapp_multitab>
34
+ <class>Strapp_Multitab_Block</class>
35
+ </strapp_multitab>
36
+ </blocks>
37
+ <helpers>
38
+ <strapp_multitab>
39
+ <class>Strapp_Multitab_Helper</class>
40
+ </strapp_multitab>
41
+ </helpers>
42
+ </global>
43
+ <default>
44
+ <multitab>
45
+ <additionalinfo>
46
+ <enable>1</enable>
47
+ </additionalinfo>
48
+ </multitab>
49
+ </default>
50
+ </config>
app/code/local/Strapp/Multitab/etc/system.xml ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <tabs>
4
+ <strapp translate="label">
5
+ <label>Strapp Extensions</label>
6
+ <sort_order>151</sort_order>
7
+ </strapp>
8
+ </tabs>
9
+ <sections>
10
+ <multitab translate="label">
11
+ <label>Multitab Additional Info</label>
12
+ <tab>strapp</tab>
13
+ <frontend_type>text</frontend_type>
14
+ <sort_order>201</sort_order>
15
+ <show_in_default>1</show_in_default>
16
+ <show_in_website>1</show_in_website>
17
+ <show_in_store>1</show_in_store>
18
+ <groups>
19
+ <additionalinfo>
20
+ <label>Product View Page</label>
21
+ <frontend_type>text</frontend_type>
22
+ <sort_order>10</sort_order>
23
+ <show_in_default>1</show_in_default>
24
+ <show_in_website>1</show_in_website>
25
+ <show_in_store>1</show_in_store>
26
+ <fields>
27
+ <enable translate="label">
28
+ <label>Enable/Disable</label>
29
+ <comment>If disabled, additional info not display in tab format</comment>
30
+ <frontend_type>select</frontend_type>
31
+ <source_model>adminhtml/system_config_source_enabledisable</source_model>
32
+ <sort_order>0</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
+ </enable>
37
+ </fields>
38
+ </additionalinfo>
39
+ </groups>
40
+ </multitab>
41
+ </sections>
42
+ </config>
43
+
44
+
app/code/local/Strapp/Multitab/etc/system.xml~ ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <tabs>
4
+ <strapp translate="label">
5
+ <label>Strapp Extensions</label>
6
+ <sort_order>151</sort_order>
7
+ </strapp>
8
+ </tabs>
9
+ <sections>
10
+ <multitab translate="label">
11
+ <label>Multitab Additional Info</label>
12
+ <tab>strapp</tab>
13
+ <frontend_type>text</frontend_type>
14
+ <sort_order>201</sort_order>
15
+ <show_in_default>1</show_in_default>
16
+ <show_in_website>1</show_in_website>
17
+ <show_in_store>1</show_in_store>
18
+ <groups>
19
+ <additionalinfo>
20
+ <label>Product View Page</label>
21
+ <frontend_type>text</frontend_type>
22
+ <sort_order>10</sort_order>
23
+ <show_in_default>1</show_in_default>
24
+ <show_in_website>1</show_in_website>
25
+ <show_in_store>1</show_in_store>
26
+ <fields>
27
+ <enable translate="label">
28
+ <label>Enable/Disable</label>
29
+ <comment>If disabled, additional info not display in tab format</comment>
30
+ <frontend_type>select</frontend_type>
31
+ <source_model>adminhtml/system_config_source_enabledisable</source_model>
32
+ <sort_order>0</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
+ </enable>
37
+ </fields>
38
+ </additionalinfo>
39
+ </groups>
40
+ </multitab>
41
+ </sections>
42
+ </config>
43
+
44
+
app/design/frontend/default/default/layout/strapp_multitabdisplay.xml ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="0.1.0">
3
+ <catalog_product_view>
4
+ <action method="setTemplate" block="product.info.tabs" ifconfig="multitab/additionalinfo/enable">
5
+ <template>strapp/multitab/product/view/tabs.phtml</template>
6
+ </action>
7
+ </catalog_product_view>
8
+ </layout>
app/design/frontend/default/default/template/strapp/attributescontent.phtml~ ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $_helper = $this->helper('catalog/output');
3
+ $_product = $this->getProduct()
4
+ ?>
5
+ <?php
6
+ $attributes_by_groups = array();
7
+ $group_names = array();
8
+ $group_ids = array();
9
+
10
+ $attributes = $_product->getAttributes();
11
+ $attribute_set = Mage::getModel('eav/entity_attribute_set')->load( $_product->getAttributeSetId() );
12
+ $attribute_set_Id = $attribute_set->getAttributeSetId();
13
+ $attribute_set_Name = $attribute_set->getAttributeSetName();
14
+
15
+ foreach ($attributes as $attribute)
16
+ {
17
+ if ($attribute->getIsVisibleOnFront() && $attribute->getIsUserDefined()) {
18
+ $group_id = $attribute->getData('attribute_set_info/' . $_product->getAttributeSetId() . '/group_id');
19
+
20
+ if (!in_array($group_id, $group_ids))
21
+ {
22
+ array_push($group_ids, $group_id);
23
+ }
24
+
25
+ if ( !isset($group_names[$group_id]) )
26
+ {
27
+ $group_model = Mage::getModel('eav/entity_attribute_group');
28
+ $group_model->load($group_id);
29
+
30
+ $group_names[$group_id] = $group_model->getAttributeGroupName();
31
+ }
32
+ }
33
+ }
34
+ ?>
35
+ <?php if($_additional = $this->getAdditionalData()): ?>
36
+ <?php foreach ($group_ids as $group_id): ?>
37
+
38
+ <?php
39
+ $group_name = $group_names[$group_id];
40
+ $exclAttr_Arr = array();
41
+ foreach ($attributes as $attribute)
42
+ {
43
+ if (!(($attribute->getAttributeGroupId()) == $group_id))
44
+ {
45
+ array_push($exclAttr_Arr, ($attribute->getAttributeCode()));
46
+ }
47
+ }
48
+ ?>
49
+ <div class="product-tabs-content" id="product_tabs_<?php echo $group_name;?>_contents">
50
+ <?php $_additional = $this->getAdditionalData($exclAttr_Arr);?>
51
+
52
+ <table cellspacing="0" class="data-table" id="product-attribute-specs-table">
53
+
54
+ <?php foreach ($_additional as $_data): ?>
55
+ <tr>
56
+ <td class="label"><?php echo $this->htmlEscape($this->__($_data['label'])) ?></td>
57
+ <td class="data"><?php echo $_helper->productAttribute($_product, $_data['value'], $_data['code']) ?></td>
58
+ </tr>
59
+
60
+ <?php endforeach; ?>
61
+
62
+ </table>
63
+
64
+ <script type="text/javascript\">decorateTable(’product-attribute-specs-table’)</script>
65
+ </div>
66
+ <?php endforeach; ?>
67
+ <?php endif;?>
68
+
app/design/frontend/default/default/template/strapp/attributesheader.phtml~ ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $_helper = $this->helper('catalog/output');
3
+ $_product = $this->getProduct()
4
+ ?>
5
+ <?php
6
+ $attributes_by_groups = array();
7
+ $group_names = array();
8
+ $group_ids = array();
9
+
10
+ $attributes = $_product->getAttributes();
11
+ $attribute_set = Mage::getModel('eav/entity_attribute_set')->load( $_product->getAttributeSetId() );
12
+ $attribute_set_Id = $attribute_set->getAttributeSetId();
13
+ $attribute_set_Name = $attribute_set->getAttributeSetName();
14
+
15
+ foreach ($attributes as $attribute)
16
+ {
17
+ if ($attribute->getIsVisibleOnFront() && $attribute->getIsUserDefined()) {
18
+ $group_id = $attribute->getData('attribute_set_info/' . $_product->getAttributeSetId() . '/group_id');
19
+
20
+ if (!in_array($group_id, $group_ids))
21
+ {
22
+ array_push($group_ids, $group_id);
23
+ }
24
+
25
+ if ( !isset($group_names[$group_id]) )
26
+ {
27
+ $group_model = Mage::getModel('eav/entity_attribute_group');
28
+ $group_model->load($group_id);
29
+
30
+ $group_names[$group_id] = $group_model->getAttributeGroupName();
31
+ }
32
+ }
33
+ }
34
+ ?>
35
+ <?php if($_additional = $this->getAdditionalData()): ?>
36
+ <?php foreach ($group_ids as $group_id): ?>
37
+ <?php $group_name = $group_names[$group_id];?>
38
+ <li id="product_tabs_<?php echo $group_name?>">
39
+ <a href="#"><?php echo $group_name?></a>
40
+ </li>
41
+ <?php endforeach; ?>
42
+ <?php endif;?>
app/design/frontend/default/default/template/strapp/multitab/list.phtml~ ADDED
@@ -0,0 +1,220 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Strapp Multitabcompare Module
4
+ *
5
+ * @category Strapp
6
+ * @package Strapp_Multitabcompare
7
+ */
8
+ ?>
9
+ <div class="page-title title-buttons">
10
+ <h1><?php echo $this->__('Compare Products') ?></h1>
11
+ <a href="#" onclick="window.print(); return false;" class="link-print"><?php echo $this->__('Print This Page') ?></a>
12
+ </div>
13
+ <?php $_totalItems=$this->getItems()->getSize(); ?>
14
+ <?php
15
+ $itemsArray =array();
16
+ foreach($this->getItems() as $_item):
17
+ $attributeSetId = Mage::getModel('catalog/product')->loadByAttribute('sku',$_item->getSku())->getAttributeSetId();
18
+ $itemsArray[$attributeSetId][] = $_item;
19
+ endforeach;
20
+ ?>
21
+ <?php
22
+ foreach($itemsArray as $key => $items): ?>
23
+ <?php $_total = count($items); ?>
24
+ <?php if($_total): ?>
25
+ <table class="data-table compare-table" id="product_comparison<?php echo $key; ?>">
26
+ <?php $_i=0 ?>
27
+ <?php foreach($items as $_item): ?>
28
+ <?php if($_i++%10==0): ?>
29
+ <col width="1" />
30
+ <?php endif; ?>
31
+ <col width="<?php echo floor(100/$_total); ?>%" />
32
+ <?php endforeach; ?>
33
+ <?php if ($_total>1): ?>
34
+ <thead>
35
+ <tr>
36
+ <?php $_i=0 ?>
37
+ <?php foreach($items as $_item): ?>
38
+ <?php if($_i++%10==0): ?>
39
+ <th>&nbsp;</th>
40
+ <?php endif; ?>
41
+ <td class="a-right"><a href="#" class="btn-remove" onclick="removeItem('<?php echo $this->helper('catalog/product_compare')->getRemoveUrl($_item) ?>');" title="<?php echo $this->__('Remove This Item') ?>"><?php echo $this->__('Remove This Item') ?></a></td>
42
+ <?php endforeach; ?>
43
+ </tr>
44
+ </thead>
45
+ <?php endif ?>
46
+ <tbody>
47
+ <tr class="product-shop-row">
48
+ <?php $_i=0 ?>
49
+ <?php foreach($items as $_item): ?>
50
+ <?php if($_i++%10==0): ?>
51
+ <th>&nbsp;</th>
52
+ <?php endif; ?>
53
+ <td>
54
+ <a class="product-image" href="#" onclick="setPLocation('<?php echo $this->getProductUrl($_item) ?>', true)" title="<?php echo $this->stripTags($_item->getName(), null, true) ?>"><img src="<?php echo $this->helper('catalog/image')->init($_item, 'small_image')->resize(125, 125); ?>" width="125" height="125" alt="<?php echo $this->stripTags($_item->getName(), null, true) ?>" /></a>
55
+ <h2 class="product-name"><a href="#" onclick="setPLocation('<?php echo $this->getProductUrl($_item) ?>', true)" title="<?php echo $this->stripTags($_item->getName(), null, true) ?>"><?php echo $this->helper('catalog/output')->productAttribute($_item, $_item->getName(), 'name') ?></a></h2>
56
+ <?php echo $this->getReviewsSummaryHtml($_item, 'short') ?>
57
+ <?php echo $this->getPriceHtml($_item, true, '-compare-list-top') ?>
58
+ <?php if($_item->isSaleable()): ?>
59
+ <p><button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="setPLocation('<?php echo $this->helper('catalog/product_compare')->getAddToCartUrl($_item) ?>', true)"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button></p>
60
+ <?php else: ?>
61
+ <p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
62
+ <?php endif; ?>
63
+ <?php if ($this->helper('wishlist')->isAllow()) : ?>
64
+ <ul class="add-to-links">
65
+ <li><a href="<?php echo $this->getAddToWishlistUrl($_item) ?>" class="link-wishlist" onclick="setPLocation(this.href, true)"><?php echo $this->__('Add to Wishlist') ?></a></li>
66
+ </ul>
67
+ <?php endif; ?>
68
+ </td>
69
+ <?php endforeach; ?>
70
+ </tr>
71
+ </tbody>
72
+ <tbody>
73
+ <?php foreach ($this->getAttributes() as $_attribute): ?>
74
+ <tr>
75
+ <?php $_i=0 ?>
76
+ <?php foreach($items as $_item): ?>
77
+ <?php if($_i++%10==0): ?>
78
+ <th><span class="nobr"><?php echo $_attribute->getStoreLabel() ?></span></th>
79
+ <?php endif; ?>
80
+ <td>
81
+ <?php switch ($_attribute->getAttributeCode())
82
+ {
83
+ case "price": ?>
84
+ <?php echo $this->getPriceHtml($_item, true, '-compare-list-' . $_attribute->getCode()) ?>
85
+ <?php break;
86
+ case "small_image": ?>
87
+ <img src="<?php echo $this->helper('catalog/image')->init($_item, 'small_image')->resize(125, 125); ?>" width="125" height="125" alt="<?php echo $this->htmlEscape($_item->getName()) ?>" title="<?php echo $this->htmlEscape($_item->getName()) ?>" />
88
+ <?php break;
89
+ case "date":
90
+ echo substr($this->getProductAttributeValue($_item, $_attribute),0,10);
91
+ break;
92
+ default: ?>
93
+ <div class="std">
94
+ <?php echo $this->helper('catalog/output')->productAttribute($_item, $this->getProductAttributeValue($_item, $_attribute), $_attribute->getAttributeCode()) ?>
95
+ </div>
96
+ <?php break;
97
+ } ?>
98
+ </td>
99
+ <?php endforeach; ?>
100
+ </tr>
101
+ <?php endforeach; ?>
102
+ </tbody>
103
+ <tbody>
104
+ <?php $_referproduct = Mage::getModel('catalog/product')->loadByAttribute('sku',reset($items)->getSku()); ?>
105
+ <?php
106
+ $attributes_by_groups = array();
107
+ $group_names = array();
108
+ $group_ids = array();
109
+ $attributes = $_referproduct->getAttributes();
110
+ $attribute_set = Mage::getModel('eav/entity_attribute_set')->load( $_referproduct->getAttributeSetId() );
111
+ $attribute_set_Id = $attribute_set->getAttributeSetId();
112
+ $attribute_set_Name = $attribute_set->getAttributeSetName();
113
+ foreach ($attributes as $attribute)
114
+ {
115
+ if ($attribute->getIsVisibleOnFront() && $attribute->getIsUserDefined())
116
+ {
117
+ $group_id = $attribute->getData('attribute_set_info/' . $_referproduct->getAttributeSetId() . '/group_id');
118
+
119
+ if (!in_array($group_id, $group_ids))
120
+ {
121
+ array_push($group_ids, $group_id);
122
+ }
123
+
124
+ if ( !isset($group_names[$group_id]) )
125
+ {
126
+ $group_model = Mage::getModel('eav/entity_attribute_group');
127
+ $group_model->load($group_id);
128
+
129
+ $group_names[$group_id] = $group_model->getAttributeGroupName();
130
+ }
131
+ }
132
+ }
133
+ ?>
134
+ <?php foreach ($group_ids as $group_id): ?>
135
+ <?php
136
+ $group_name = $group_names[$group_id];
137
+ ?>
138
+ <tr>
139
+ <th><?php echo $group_name;?></th>
140
+ <?php foreach($items as $_item): ?>
141
+ <?php $_product =Mage::getModel('catalog/product')->loadByAttribute('sku',$_item->getSku())?>
142
+ <td>
143
+ <?php $attributesCollection = Mage::getResourceModel('catalog/product_attribute_collection');
144
+ $attributesCollection->setAttributeGroupFilter($group_id);
145
+ foreach ($attributesCollection as $attribute)
146
+ {?>
147
+ <p>
148
+ <b><?php echo $attribute->getFrontendLabel();?>:
149
+ </b>
150
+ <?php
151
+ echo
152
+ $attribute->getFrontend()->getValue($_product);
153
+ ?>
154
+ </p>
155
+ <?php
156
+ }
157
+ ?>
158
+ </td>
159
+
160
+ <?php endforeach; ?>
161
+ </tr>
162
+ <?php endforeach; ?>
163
+ </tbody>
164
+ <tbody>
165
+ <tr class="add-to-row">
166
+ <?php $_i=0 ?>
167
+ <?php foreach($items as $_item): ?>
168
+ <?php if($_i++%10==0): ?>
169
+ <th>&nbsp;</th>
170
+ <?php endif; ?>
171
+ <td>
172
+ <?php echo $this->getPriceHtml($_item, true, '-compare-list-bottom') ?>
173
+ <?php if($_item->isSaleable()): ?>
174
+ <p><button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="setPLocation('<?php echo $this->helper('catalog/product_compare')->getAddToCartUrl($_item) ?>', true)"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button></p>
175
+ <?php else: ?>
176
+ <p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
177
+ <?php endif; ?>
178
+ <?php if ($this->helper('wishlist')->isAllow()) : ?>
179
+ <ul class="add-to-links">
180
+ <li><a href="<?php echo $this->getAddToWishlistUrl($_item);?>" class="link-wishlist" onclick="setPLocation(this.href, true)"><?php echo $this->__('Add to Wishlist') ?></a></li>
181
+ </ul>
182
+ <?php endif; ?>
183
+ </td>
184
+ <?php endforeach; ?>
185
+ </tr>
186
+ </tbody>
187
+ </table>
188
+ <script type="text/javascript">
189
+ decorateTable('product_comparison<?php echo $key; ?>');
190
+ </script>
191
+ <br />
192
+ <?php endif; ?>
193
+ <?php endforeach;?>
194
+ <div class="buttons-set">
195
+ <button type="button" title="<?php echo $this->__('Close Window') ?>" class="button" onclick="window.close();"><span><span><?php echo $this->__('Close Window') ?></span></span></button>
196
+ <span class="please-wait" id="compare-list-please-wait" style="display:none;">
197
+ <img src="<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif') ?>" alt="<?php echo $this->__('Please wait...') ?>" title="<?php echo $this->__('Please wait...') ?>" class="v-middle" /> <?php echo $this->__('Please wait...') ?>
198
+ </span>
199
+ </div>
200
+ <script type="text/javascript">
201
+ decorateTable('product_comparison');
202
+
203
+ /**
204
+ * Send remove item request, after that reload windows
205
+ */
206
+ function removeItem(url)
207
+ {
208
+ new Ajax.Request(url, {
209
+ parameters: {isAjax: 1, method: 'POST'},
210
+ onLoading: function(){$('compare-list-please-wait').show();},
211
+ onSuccess: function(transport) {
212
+ $('compare-list-please-wait').hide();
213
+ window.location.reload();
214
+ window.opener.location.reload();
215
+ }
216
+ });
217
+ }
218
+ </script>
219
+
220
+
app/design/frontend/default/default/template/strapp/multitab/product/view/attributescontent.phtml ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Strapp Multitab Module
4
+ *
5
+ * @category Strapp
6
+ * @package Strapp_Multitab
7
+ */
8
+ ?>
9
+ <?php
10
+ $_helper = $this->helper('catalog/output');
11
+ $_product = $this->getProduct()
12
+ ?>
13
+ <?php
14
+ $group_names = array();
15
+ $group_ids = array();
16
+
17
+ $attributes = $_product->getAttributes();
18
+ $attribute_set = Mage::getModel('eav/entity_attribute_set')->load( $_product->getAttributeSetId() );
19
+ $attribute_set_Id = $attribute_set->getAttributeSetId();
20
+ $attribute_set_Name = $attribute_set->getAttributeSetName();
21
+
22
+ foreach ($attributes as $attribute)
23
+ {
24
+ if ($attribute->getIsVisibleOnFront() && $attribute->getIsUserDefined()) {
25
+ $group_id = $attribute->getData('attribute_set_info/' . $_product->getAttributeSetId() . '/group_id');
26
+
27
+ if (!in_array($group_id, $group_ids))
28
+ {
29
+ array_push($group_ids, $group_id);
30
+ }
31
+
32
+ if ( !isset($group_names[$group_id]) )
33
+ {
34
+ $group_model = Mage::getModel('eav/entity_attribute_group');
35
+ $group_model->load($group_id);
36
+
37
+ $group_names[$group_id] = $group_model->getAttributeGroupName();
38
+ }
39
+ }
40
+ }
41
+ ?>
42
+ <?php if($_additional = $this->getAdditionalData()): ?>
43
+ <?php foreach ($group_ids as $group_id): ?>
44
+
45
+ <?php
46
+ $group_name = $group_names[$group_id];
47
+ $exclAttr_Arr = array();
48
+ foreach ($attributes as $attribute)
49
+ {
50
+ if (!(($attribute->getAttributeGroupId()) == $group_id))
51
+ {
52
+ array_push($exclAttr_Arr, ($attribute->getAttributeCode()));
53
+ }
54
+ }
55
+ ?>
56
+ <div class="product-tabs-content" id="product_tabs_<?php echo $group_name;?>_contents">
57
+ <?php $_additional = $this->getAdditionalData($exclAttr_Arr);?>
58
+
59
+ <table cellspacing="0" class="data-table" id="product-attribute-specs-table">
60
+
61
+ <?php foreach ($_additional as $_data): ?>
62
+ <tr>
63
+ <td class="label"><?php echo $this->htmlEscape($this->__($_data['label'])) ?></td>
64
+ <td class="data"><?php echo $_helper->productAttribute($_product, $_data['value'], $_data['code']) ?></td>
65
+ </tr>
66
+
67
+ <?php endforeach; ?>
68
+
69
+ </table>
70
+
71
+ <script type="text/javascript\">decorateTable(’product-attribute-specs-table’)</script>
72
+ </div>
73
+ <?php endforeach; ?>
74
+ <?php endif;?>
75
+
app/design/frontend/default/default/template/strapp/multitab/product/view/attributescontent.phtml~ ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Strapp Multitab Module
4
+ *
5
+ * @category Strapp
6
+ * @package Strapp_Multitab
7
+ */
8
+ ?>
9
+ <?php
10
+ $_helper = $this->helper('catalog/output');
11
+ $_product = $this->getProduct()
12
+ ?>
13
+ <?php
14
+ $group_names = array();
15
+ $group_ids = array();
16
+
17
+ $attributes = $_product->getAttributes();
18
+ $attribute_set = Mage::getModel('eav/entity_attribute_set')->load( $_product->getAttributeSetId() );
19
+ $attribute_set_Id = $attribute_set->getAttributeSetId();
20
+ $attribute_set_Name = $attribute_set->getAttributeSetName();
21
+
22
+ foreach ($attributes as $attribute)
23
+ {
24
+ if ($attribute->getIsVisibleOnFront() && $attribute->getIsUserDefined()) {
25
+ $group_id = $attribute->getData('attribute_set_info/' . $_product->getAttributeSetId() . '/group_id');
26
+
27
+ if (!in_array($group_id, $group_ids))
28
+ {
29
+ array_push($group_ids, $group_id);
30
+ }
31
+
32
+ if ( !isset($group_names[$group_id]) )
33
+ {
34
+ $group_model = Mage::getModel('eav/entity_attribute_group');
35
+ $group_model->load($group_id);
36
+
37
+ $group_names[$group_id] = $group_model->getAttributeGroupName();
38
+ }
39
+ }
40
+ }
41
+ ?>
42
+ <?php if($_additional = $this->getAdditionalData()): ?>
43
+ <?php foreach ($group_ids as $group_id): ?>
44
+
45
+ <?php
46
+ $group_name = $group_names[$group_id];
47
+ $exclAttr_Arr = array();
48
+ foreach ($attributes as $attribute)
49
+ {
50
+ if (!(($attribute->getAttributeGroupId()) == $group_id))
51
+ {
52
+ array_push($exclAttr_Arr, ($attribute->getAttributeCode()));
53
+ }
54
+ }
55
+ ?>
56
+ <div class="product-tabs-content" id="product_tabs_<?php echo $group_name;?>_contents">
57
+ <?php $_additional = $this->getAdditionalData($exclAttr_Arr);?>
58
+
59
+ <table cellspacing="0" class="data-table" id="product-attribute-specs-table">
60
+
61
+ <?php foreach ($_additional as $_data): ?>
62
+ <tr>
63
+ <td class="label"><?php echo $this->htmlEscape($this->__($_data['label'])) ?></td>
64
+ <td class="data"><?php echo $_helper->productAttribute($_product, $_data['value'], $_data['code']) ?></td>
65
+ </tr>
66
+
67
+ <?php endforeach; ?>
68
+
69
+ </table>
70
+
71
+ <script type="text/javascript\">decorateTable(’product-attribute-specs-table’)</script>
72
+ </div>
73
+ <?php endforeach; ?>
74
+ <?php endif;?>
75
+
app/design/frontend/default/default/template/strapp/multitab/product/view/attributesheader.phtml ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Strapp Multitab Module
4
+ *
5
+ * @category Strapp
6
+ * @package Strapp_Multitab
7
+ */
8
+ ?>
9
+ <?php
10
+ $_helper = $this->helper('catalog/output');
11
+ $_product = $this->getProduct()
12
+ ?>
13
+ <?php
14
+ $group_names = array();
15
+ $group_ids = array();
16
+
17
+ $attributes = $_product->getAttributes();
18
+ $attribute_set = Mage::getModel('eav/entity_attribute_set')->load( $_product->getAttributeSetId() );
19
+ $attribute_set_Id = $attribute_set->getAttributeSetId();
20
+ $attribute_set_Name = $attribute_set->getAttributeSetName();
21
+
22
+ foreach ($attributes as $attribute)
23
+ {
24
+ if ($attribute->getIsVisibleOnFront() && $attribute->getIsUserDefined()) {
25
+ $group_id = $attribute->getData('attribute_set_info/' . $_product->getAttributeSetId() . '/group_id');
26
+
27
+ if (!in_array($group_id, $group_ids))
28
+ {
29
+ array_push($group_ids, $group_id);
30
+ }
31
+
32
+ if ( !isset($group_names[$group_id]) )
33
+ {
34
+ $group_model = Mage::getModel('eav/entity_attribute_group');
35
+ $group_model->load($group_id);
36
+
37
+ $group_names[$group_id] = $group_model->getAttributeGroupName();
38
+ }
39
+ }
40
+ }
41
+ ?>
42
+ <?php if($_additional = $this->getAdditionalData()): ?>
43
+ <?php foreach ($group_ids as $group_id): ?>
44
+ <?php $group_name = $group_names[$group_id];?>
45
+ <li id="product_tabs_<?php echo $group_name?>">
46
+ <a href="#"><?php echo $group_name?></a>
47
+ </li>
48
+ <?php endforeach; ?>
49
+ <?php endif;?>
app/design/frontend/default/default/template/strapp/multitab/product/view/attributesheader.phtml~ ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Strapp Multitab Module
4
+ *
5
+ * @category Strapp
6
+ * @package Strapp_Multitab
7
+ */
8
+ ?>
9
+ <?php
10
+ $_helper = $this->helper('catalog/output');
11
+ $_product = $this->getProduct()
12
+ ?>
13
+ <?php
14
+ $group_names = array();
15
+ $group_ids = array();
16
+
17
+ $attributes = $_product->getAttributes();
18
+ $attribute_set = Mage::getModel('eav/entity_attribute_set')->load( $_product->getAttributeSetId() );
19
+ $attribute_set_Id = $attribute_set->getAttributeSetId();
20
+ $attribute_set_Name = $attribute_set->getAttributeSetName();
21
+
22
+ foreach ($attributes as $attribute)
23
+ {
24
+ if ($attribute->getIsVisibleOnFront() && $attribute->getIsUserDefined()) {
25
+ $group_id = $attribute->getData('attribute_set_info/' . $_product->getAttributeSetId() . '/group_id');
26
+
27
+ if (!in_array($group_id, $group_ids))
28
+ {
29
+ array_push($group_ids, $group_id);
30
+ }
31
+
32
+ if ( !isset($group_names[$group_id]) )
33
+ {
34
+ $group_model = Mage::getModel('eav/entity_attribute_group');
35
+ $group_model->load($group_id);
36
+
37
+ $group_names[$group_id] = $group_model->getAttributeGroupName();
38
+ }
39
+ }
40
+ }
41
+ ?>
42
+ <?php if($_additional = $this->getAdditionalData()): ?>
43
+ <?php foreach ($group_ids as $group_id): ?>
44
+ <?php $group_name = $group_names[$group_id];?>
45
+ <li id="product_tabs_<?php echo $group_name?>">
46
+ <a href="#"><?php echo $group_name?></a>
47
+ </li>
48
+ <?php endforeach; ?>
49
+ <?php endif;?>
app/design/frontend/default/default/template/strapp/multitab/product/view/tabs.phtml ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Strapp Multitab Module
4
+ *
5
+ * @category Strapp
6
+ * @package Strapp_Multitab
7
+ */
8
+ ?>
9
+ <?php
10
+ $_helper = $this->helper('catalog/output');
11
+ $_product= Mage::registry('current_product');
12
+ ?>
13
+ <ul class="product-tabs">
14
+ <li id="product_tabs_description" class="active first">
15
+ <a href="#">Description</a></li>
16
+ </li>
17
+ <?php echo $this->getLayout()->createBlock('catalog/product_view_attributes')->setTemplate('strapp/multitab/product/view/attributesheader.phtml')->toHtml(); ?>
18
+ <li id="product_tabs_product.tags" class="last">
19
+ <a href="#">Product Tags</a>
20
+ </li>
21
+ </ul>
22
+ <div class="product-tabs-content" id="product_tabs_description_contents">
23
+ <div class="std"><?php echo $_product->getDescription(); ?></div>
24
+ </div>
25
+ <?php echo $this->getLayout()->createBlock('catalog/product_view_attributes')->setTemplate('strapp/multitab/product/view/attributescontent.phtml')->toHtml(); ?>
26
+ <div class="product-tabs-content" id="product_tabs_product.tags_contents">
27
+ <?php echo $this->getLayout()->createBlock('tag/product_list')->setTemplate('tag/list.phtml')->toHtml(); ?>
28
+ </div>
29
+ <script type="text/javascript">
30
+ //<![CDATA[
31
+ Varien.Tabs = Class.create();
32
+ Varien.Tabs.prototype = {
33
+ initialize: function(selector) {
34
+ var self=this;
35
+ $$(selector+' a').each(this.initTab.bind(this));
36
+ },
37
+
38
+ initTab: function(el) {
39
+ el.href = 'javascript:void(0)';
40
+ if ($(el.parentNode).hasClassName('active')) {
41
+ this.showContent(el);
42
+ }
43
+ el.observe('click', this.showContent.bind(this, el));
44
+ },
45
+
46
+ showContent: function(a) {
47
+ var li = $(a.parentNode), ul = $(li.parentNode);
48
+ ul.select('li', 'ol').each(function(el){
49
+ var contents = $(el.id+'_contents');
50
+ if (el==li) {
51
+ el.addClassName('active');
52
+ contents.show();
53
+ } else {
54
+ el.removeClassName('active');
55
+ contents.hide();
56
+ }
57
+ });
58
+ }
59
+ }
60
+ new Varien.Tabs('.product-tabs');
61
+ //]]>
62
+ </script>
app/design/frontend/default/default/template/strapp/multitab/product/view/tabs.phtml~ ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $_helper = $this->helper('catalog/output');
3
+ $_product= Mage::registry('current_product');
4
+ ?>
5
+ <ul class="product-tabs">
6
+ <li id="product_tabs_description" class="active first">
7
+ <a href="#">Description</a></li>
8
+ </li>
9
+ <?php echo $this->getLayout()->createBlock('catalog/product_view_attributes')->setTemplate('strapp/multitab/product/view/attributesheader.phtml')->toHtml(); ?>
10
+ <li id="product_tabs_product.tags" class="last">
11
+ <a href="#">Product Tags</a>
12
+ </li>
13
+ </ul>
14
+ <div class="product-tabs-content" id="product_tabs_description_contents">
15
+ <div class="std"><?php echo $_product->getDescription(); ?></div>
16
+ </div>
17
+ <?php echo $this->getLayout()->createBlock('catalog/product_view_attributes')->setTemplate('strapp/multitab/product/view/attributescontent.phtml')->toHtml(); ?>
18
+ <div class="product-tabs-content" id="product_tabs_product.tags_contents">
19
+ <?php echo $this->getLayout()->createBlock('tag/product_list')->setTemplate('tag/list.phtml')->toHtml(); ?>
20
+ </div>
21
+ <script type="text/javascript">
22
+ //<![CDATA[
23
+ Varien.Tabs = Class.create();
24
+ Varien.Tabs.prototype = {
25
+ initialize: function(selector) {
26
+ var self=this;
27
+ $$(selector+' a').each(this.initTab.bind(this));
28
+ },
29
+
30
+ initTab: function(el) {
31
+ el.href = 'javascript:void(0)';
32
+ if ($(el.parentNode).hasClassName('active')) {
33
+ this.showContent(el);
34
+ }
35
+ el.observe('click', this.showContent.bind(this, el));
36
+ },
37
+
38
+ showContent: function(a) {
39
+ var li = $(a.parentNode), ul = $(li.parentNode);
40
+ ul.select('li', 'ol').each(function(el){
41
+ var contents = $(el.id+'_contents');
42
+ if (el==li) {
43
+ el.addClassName('active');
44
+ contents.show();
45
+ } else {
46
+ el.removeClassName('active');
47
+ contents.hide();
48
+ }
49
+ });
50
+ }
51
+ }
52
+ new Varien.Tabs('.product-tabs');
53
+ //]]>
54
+ </script>
app/etc/modules/Strapp_Multitab.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Strapp_Multitab>
5
+ <active>true</active>
6
+ <codePool>local</codePool>
7
+ </Strapp_Multitab>
8
+ </modules>
9
+ </config>
package.xml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>strapp_multitab_product_view</name>
4
+ <version>1.0.0</version>
5
+ <stability>stable</stability>
6
+ <license uri="http://opensource.org/licenses/osl-3.0.php">OSL</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>StrApp Multitab Product View Community Module</summary>
10
+ <description>A lot of products have a lot of information that needs to be displayed for e.g. a smart phone would have information about the features, battery, OS, processor, maintenance, etc. And each of these would have a lot of details. For a good user experience, having this information in tabs would be very helpful.Magento doesn't provide information to be displayed as tabs by default, in the product description page. With the Multi tab extension, you can very easily have any number of tabs for your product.</description>
11
+ <notes>A lot of products have a lot of information that needs to be displayed for e.g. a smart phone would have information about the features, battery, OS, processor, maintenance, etc. And each of these would have a lot of details. For a good user experience, having this information in tabs would be very helpful.Magento doesn't provide information to be displayed as tabs by default, in the product description page. With the Multi tab extension, you can very easily have any number of tabs for your product.</notes>
12
+ <authors><author><name>StrApp</name><user>strviv</user><email>strappvivek@gmail.com</email></author></authors>
13
+ <date>2013-12-19</date>
14
+ <time>09:46:23</time>
15
+ <contents><target name="magelocal"><dir name="Strapp"><dir name="Multitab"><dir name="etc"><file name="adminhtml.xml" hash="70169be8e9c2b26abafea29a89d7a572"/><file name="adminhtml.xml~" hash="70169be8e9c2b26abafea29a89d7a572"/><file name="config.xml" hash="df558a9004473652dd5b0a8800fbc168"/><file name="config.xml~" hash="df558a9004473652dd5b0a8800fbc168"/><file name="system.xml" hash="22586cd46cd6c363dcac0ad770ae4681"/><file name="system.xml~" hash="22586cd46cd6c363dcac0ad770ae4681"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="strapp_multitabdisplay.xml" hash="5800455c2e78eaea3474fc0b6c6637f0"/></dir><dir name="template"><dir name="strapp"><file name="attributescontent.phtml~" hash="fd5aab3805f047fa3b0ae484af9e33a3"/><file name="attributesheader.phtml~" hash="5b258c4bce613c4bae2af30de86957e0"/><dir name="multitab"><file name="list.phtml~" hash="4173f87b07c8b168aa48f9910c77962b"/><dir name="product"><dir name="view"><file name="attributescontent.phtml" hash="02fc6dcd9c04140730e5ad4683b856a2"/><file name="attributescontent.phtml~" hash="02fc6dcd9c04140730e5ad4683b856a2"/><file name="attributesheader.phtml" hash="3208ad536a247a27cdb2ae821d252c24"/><file name="attributesheader.phtml~" hash="3208ad536a247a27cdb2ae821d252c24"/><file name="tabs.phtml" hash="00de5325eea91ac70cca582327820a3f"/><file name="tabs.phtml~" hash="ff89e902ff40206613df226cea3b462e"/></dir></dir></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Strapp_Multitab.xml" hash="c90c6162d4830da765df915f753dd2c6"/></dir></target></contents>
16
+ <compatible/>
17
+ <dependencies><required><php><min>5.2.0</min><max>5.5.6</max></php></required></dependencies>
18
+ </package>