Version Notes
stable release
Download this release
Release Info
Developer | Magento Core Team |
Extension | ET_AdvancedCompare |
Version | 1.0.5 |
Comparing to | |
See all releases |
Code changes from version 1.0.3 to 1.0.5
- app/code/community/ET/AdvancedCompare/{Block/List.php → Model/Observer.php} +47 -42
- app/code/community/ET/AdvancedCompare/Model/Resource/Eav/Mysql4/Product/Compare/Item/Collection.php +1 -0
- app/code/community/ET/AdvancedCompare/etc/config.xml +203 -198
- app/design/frontend/base/default/template/et_advancedcompare/list.phtml +279 -0
- app/design/frontend/base/default/template/et_advancedcompare/list_15x_custom.phtml +280 -0
- package.xml +4 -4
app/code/community/ET/AdvancedCompare/{Block/List.php → Model/Observer.php}
RENAMED
@@ -1,42 +1,47 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* NOTICE OF LICENSE
|
4 |
-
*
|
5 |
-
* You may not sell, sub-license, rent or lease
|
6 |
-
* any portion of the Software or Documentation to anyone.
|
7 |
-
*
|
8 |
-
* DISCLAIMER
|
9 |
-
*
|
10 |
-
* Do not edit or add to this file if you wish to upgrade to newer
|
11 |
-
* versions in the future.
|
12 |
-
*
|
13 |
-
* @category ET
|
14 |
-
* @package ET_AdvancedCompare
|
15 |
-
* @copyright Copyright (c) 2012 ET Web Solutions (http://etwebsolutions.com)
|
16 |
-
* @contacts support@etwebsolutions.com
|
17 |
-
* @license http://shop.etwebsolutions.com/etws-license-free-v1/ ETWS Free License (EFL1)
|
18 |
-
*/
|
19 |
-
|
20 |
-
class
|
21 |
-
{
|
22 |
-
public function
|
23 |
-
{
|
24 |
-
$replacetemplate = Mage::getStoreConfig('advancedcompare/popup/replacetemplate');
|
25 |
-
|
26 |
-
if ($replacetemplate) {
|
27 |
-
$version = substr(Mage::getVersion(), 0, 3);
|
28 |
-
|
29 |
-
switch ($version) {
|
30 |
-
case '1.3':
|
31 |
-
$template = 'et_advancedcompare/list_13x.phtml';
|
32 |
-
break;
|
33 |
-
|
34 |
-
default:
|
35 |
-
$template = 'et_advancedcompare/list_15x.phtml';
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* NOTICE OF LICENSE
|
4 |
+
*
|
5 |
+
* You may not sell, sub-license, rent or lease
|
6 |
+
* any portion of the Software or Documentation to anyone.
|
7 |
+
*
|
8 |
+
* DISCLAIMER
|
9 |
+
*
|
10 |
+
* Do not edit or add to this file if you wish to upgrade to newer
|
11 |
+
* versions in the future.
|
12 |
+
*
|
13 |
+
* @category ET
|
14 |
+
* @package ET_AdvancedCompare
|
15 |
+
* @copyright Copyright (c) 2012 ET Web Solutions (http://etwebsolutions.com)
|
16 |
+
* @contacts support@etwebsolutions.com
|
17 |
+
* @license http://shop.etwebsolutions.com/etws-license-free-v1/ ETWS Free License (EFL1)
|
18 |
+
*/
|
19 |
+
|
20 |
+
class ET_AdvancedCompare_Model_Observer
|
21 |
+
{
|
22 |
+
public function replaceCompareBlockTemplate($observer)
|
23 |
+
{
|
24 |
+
$replacetemplate = Mage::getStoreConfig('advancedcompare/popup/replacetemplate');
|
25 |
+
|
26 |
+
if ($replacetemplate) {
|
27 |
+
$version = substr(Mage::getVersion(), 0, 3);
|
28 |
+
|
29 |
+
switch ($version) {
|
30 |
+
case '1.3':
|
31 |
+
$template = 'et_advancedcompare/list_13x.phtml';
|
32 |
+
break;
|
33 |
+
|
34 |
+
default:
|
35 |
+
$template = 'et_advancedcompare/list_15x.phtml';
|
36 |
+
}
|
37 |
+
|
38 |
+
/* @var $layout Mage_Core_Model_Layout */
|
39 |
+
$layout = $observer->getEvent()->getLayout();
|
40 |
+
$block = $layout->getBlock('catalog.compare.list');
|
41 |
+
|
42 |
+
if (is_object($block)) {
|
43 |
+
$block->setTemplate($template);
|
44 |
+
}
|
45 |
+
}
|
46 |
+
}
|
47 |
+
}
|
app/code/community/ET/AdvancedCompare/Model/Resource/Eav/Mysql4/Product/Compare/Item/Collection.php
CHANGED
@@ -49,6 +49,7 @@ class ET_AdvancedCompare_Model_Resource_Eav_Mysql4_Product_Compare_Item_Collecti
|
|
49 |
case '1.6':
|
50 |
case '1.7':
|
51 |
case '1.8':
|
|
|
52 |
$returnValue = $this->getComparableAttributes14x();
|
53 |
break;
|
54 |
|
49 |
case '1.6':
|
50 |
case '1.7':
|
51 |
case '1.8':
|
52 |
+
case '1.9':
|
53 |
$returnValue = $this->getComparableAttributes14x();
|
54 |
break;
|
55 |
|
app/code/community/ET/AdvancedCompare/etc/config.xml
CHANGED
@@ -1,198 +1,203 @@
|
|
1 |
-
<?xml version="1.0"?>
|
2 |
-
<!--
|
3 |
-
/**
|
4 |
-
* NOTICE OF LICENSE
|
5 |
-
*
|
6 |
-
* You may not sell, sub-license, rent or lease
|
7 |
-
* any portion of the Software or Documentation to anyone.
|
8 |
-
*
|
9 |
-
* DISCLAIMER
|
10 |
-
*
|
11 |
-
* Do not edit or add to this file if you wish to upgrade to newer
|
12 |
-
* versions in the future.
|
13 |
-
*
|
14 |
-
* @category ET
|
15 |
-
* @package ET_AdvancedCompare
|
16 |
-
* @copyright Copyright (c) 2012 ET Web Solutions (http://etwebsolutions.com)
|
17 |
-
* @contacts support@etwebsolutions.com
|
18 |
-
* @license http://shop.etwebsolutions.com/etws-license-free-v1/ ETWS Free License (EFL1)
|
19 |
-
*/
|
20 |
-
-->
|
21 |
-
<config>
|
22 |
-
<modules>
|
23 |
-
<ET_AdvancedCompare>
|
24 |
-
<name>ET Advanced Compare</name>
|
25 |
-
<version>1.0.
|
26 |
-
<descr>
|
27 |
-
<ru_RU><![CDATA[Реализует работу сравнения без перезагрузки (технология Ajax), улучшает наглядность результатов, а также позволяет отключить функцию сравнения вообще.]]>
|
28 |
-
</ru_RU>
|
29 |
-
<en_US><![CDATA[Extension allows to add products to compare without page reloading (AJAX), improves visualization of results and allows to switch compare off on your website.]]>
|
30 |
-
</en_US>
|
31 |
-
</descr>
|
32 |
-
<permanentlink>
|
33 |
-
<ru_RU>http://shop.etwebsolutions.com/rus/et-advancedcompare.html</ru_RU>
|
34 |
-
<en_US>http://shop.etwebsolutions.com/eng/et-advancedcompare.html</en_US>
|
35 |
-
</permanentlink>
|
36 |
-
<license>
|
37 |
-
<ru_RU><![CDATA[ETWS Свободная лицензия (EFL1)]]></ru_RU>
|
38 |
-
<en_US><![CDATA[ETWS Free License (EFL1)]]></en_US>
|
39 |
-
</license>
|
40 |
-
<licenselink>
|
41 |
-
<ru_RU>http://shop.etwebsolutions.com/rus/etws-license-free-v1</ru_RU>
|
42 |
-
<en_US>http://shop.etwebsolutions.com/eng/etws-license-free-v1</en_US>
|
43 |
-
</licenselink>
|
44 |
-
<redminelink>http://support.etwebsolutions.com/projects/et-advancedcompare/roadmap</redminelink>
|
45 |
-
<ourserviceslink>
|
46 |
-
<ru_RU>http://shop.etwebsolutions.com/rus/our-services</ru_RU>
|
47 |
-
<en_US>http://shop.etwebsolutions.com/eng/our-services</en_US>
|
48 |
-
</ourserviceslink>
|
49 |
-
</ET_AdvancedCompare>
|
50 |
-
</modules>
|
51 |
-
|
52 |
-
<global>
|
53 |
-
<rewrite>
|
54 |
-
<advancedcompare_index>
|
55 |
-
<from><![CDATA[#^/catalog/product_compare/#]]></from>
|
56 |
-
<to>/advancedcompare/index/</to>
|
57 |
-
</advancedcompare_index>
|
58 |
-
</rewrite>
|
59 |
-
|
60 |
-
<helpers>
|
61 |
-
<advancedcompare>
|
62 |
-
<class>ET_AdvancedCompare_Helper</class>
|
63 |
-
</advancedcompare>
|
64 |
-
<catalog>
|
65 |
-
<rewrite>
|
66 |
-
<product_compare>ET_AdvancedCompare_Helper_Data</product_compare>
|
67 |
-
</rewrite>
|
68 |
-
</catalog>
|
69 |
-
</helpers>
|
70 |
-
|
71 |
-
<blocks>
|
72 |
-
<advancedcompare>
|
73 |
-
<class>ET_AdvancedCompare_Block</class>
|
74 |
-
</advancedcompare>
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
</
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
<connection>
|
101 |
-
<use>
|
102 |
-
</connection>
|
103 |
-
</
|
104 |
-
<
|
105 |
-
<connection>
|
106 |
-
<use>
|
107 |
-
</connection>
|
108 |
-
</
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
<
|
133 |
-
<
|
134 |
-
</
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
</
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* NOTICE OF LICENSE
|
5 |
+
*
|
6 |
+
* You may not sell, sub-license, rent or lease
|
7 |
+
* any portion of the Software or Documentation to anyone.
|
8 |
+
*
|
9 |
+
* DISCLAIMER
|
10 |
+
*
|
11 |
+
* Do not edit or add to this file if you wish to upgrade to newer
|
12 |
+
* versions in the future.
|
13 |
+
*
|
14 |
+
* @category ET
|
15 |
+
* @package ET_AdvancedCompare
|
16 |
+
* @copyright Copyright (c) 2012 ET Web Solutions (http://etwebsolutions.com)
|
17 |
+
* @contacts support@etwebsolutions.com
|
18 |
+
* @license http://shop.etwebsolutions.com/etws-license-free-v1/ ETWS Free License (EFL1)
|
19 |
+
*/
|
20 |
+
-->
|
21 |
+
<config>
|
22 |
+
<modules>
|
23 |
+
<ET_AdvancedCompare>
|
24 |
+
<name>ET Advanced Compare</name>
|
25 |
+
<version>1.0.5</version>
|
26 |
+
<descr>
|
27 |
+
<ru_RU><![CDATA[Реализует работу сравнения без перезагрузки (технология Ajax), улучшает наглядность результатов, а также позволяет отключить функцию сравнения вообще.]]>
|
28 |
+
</ru_RU>
|
29 |
+
<en_US><![CDATA[Extension allows to add products to compare without page reloading (AJAX), improves visualization of results and allows to switch compare off on your website.]]>
|
30 |
+
</en_US>
|
31 |
+
</descr>
|
32 |
+
<permanentlink>
|
33 |
+
<ru_RU>http://shop.etwebsolutions.com/rus/et-advancedcompare.html</ru_RU>
|
34 |
+
<en_US>http://shop.etwebsolutions.com/eng/et-advancedcompare.html</en_US>
|
35 |
+
</permanentlink>
|
36 |
+
<license>
|
37 |
+
<ru_RU><![CDATA[ETWS Свободная лицензия (EFL1)]]></ru_RU>
|
38 |
+
<en_US><![CDATA[ETWS Free License (EFL1)]]></en_US>
|
39 |
+
</license>
|
40 |
+
<licenselink>
|
41 |
+
<ru_RU>http://shop.etwebsolutions.com/rus/etws-license-free-v1</ru_RU>
|
42 |
+
<en_US>http://shop.etwebsolutions.com/eng/etws-license-free-v1</en_US>
|
43 |
+
</licenselink>
|
44 |
+
<redminelink>http://support.etwebsolutions.com/projects/et-advancedcompare/roadmap</redminelink>
|
45 |
+
<ourserviceslink>
|
46 |
+
<ru_RU>http://shop.etwebsolutions.com/rus/our-services</ru_RU>
|
47 |
+
<en_US>http://shop.etwebsolutions.com/eng/our-services</en_US>
|
48 |
+
</ourserviceslink>
|
49 |
+
</ET_AdvancedCompare>
|
50 |
+
</modules>
|
51 |
+
|
52 |
+
<global>
|
53 |
+
<rewrite>
|
54 |
+
<advancedcompare_index>
|
55 |
+
<from><![CDATA[#^/catalog/product_compare/#]]></from>
|
56 |
+
<to>/advancedcompare/index/</to>
|
57 |
+
</advancedcompare_index>
|
58 |
+
</rewrite>
|
59 |
+
|
60 |
+
<helpers>
|
61 |
+
<advancedcompare>
|
62 |
+
<class>ET_AdvancedCompare_Helper</class>
|
63 |
+
</advancedcompare>
|
64 |
+
<catalog>
|
65 |
+
<rewrite>
|
66 |
+
<product_compare>ET_AdvancedCompare_Helper_Data</product_compare>
|
67 |
+
</rewrite>
|
68 |
+
</catalog>
|
69 |
+
</helpers>
|
70 |
+
|
71 |
+
<blocks>
|
72 |
+
<advancedcompare>
|
73 |
+
<class>ET_AdvancedCompare_Block</class>
|
74 |
+
</advancedcompare>
|
75 |
+
</blocks>
|
76 |
+
|
77 |
+
|
78 |
+
<models>
|
79 |
+
<advancedcompare>
|
80 |
+
<class>ET_AdvancedCompare_Model</class>
|
81 |
+
</advancedcompare>
|
82 |
+
<catalog_resource_eav_mysql4>
|
83 |
+
<rewrite>
|
84 |
+
<product_compare_item_collection>ET_AdvancedCompare_Model_Resource_Eav_Mysql4_Product_Compare_Item_Collection</product_compare_item_collection>
|
85 |
+
</rewrite>
|
86 |
+
</catalog_resource_eav_mysql4>
|
87 |
+
</models>
|
88 |
+
|
89 |
+
<resources>
|
90 |
+
<advancedcompare_setup>
|
91 |
+
<setup>
|
92 |
+
<module>ET_AdvancedCompare</module>
|
93 |
+
<class>Mage_Catalog_Model_Resource_Eav_Mysql4_Setup</class>
|
94 |
+
</setup>
|
95 |
+
<connection>
|
96 |
+
<use>core_setup</use>
|
97 |
+
</connection>
|
98 |
+
</advancedcompare_setup>
|
99 |
+
<advancedcompare_write>
|
100 |
+
<connection>
|
101 |
+
<use>core_write</use>
|
102 |
+
</connection>
|
103 |
+
</advancedcompare_write>
|
104 |
+
<advancedcompare_read>
|
105 |
+
<connection>
|
106 |
+
<use>core_read</use>
|
107 |
+
</connection>
|
108 |
+
</advancedcompare_read>
|
109 |
+
</resources>
|
110 |
+
<events>
|
111 |
+
<controller_action_layout_generate_blocks_after>
|
112 |
+
<observers>
|
113 |
+
<replace_compare_template>
|
114 |
+
<class>advancedcompare/observer</class>
|
115 |
+
<method>replaceCompareBlockTemplate</method>
|
116 |
+
</replace_compare_template>
|
117 |
+
</observers>
|
118 |
+
</controller_action_layout_generate_blocks_after>
|
119 |
+
</events>
|
120 |
+
</global>
|
121 |
+
|
122 |
+
<default>
|
123 |
+
<advancedcompare>
|
124 |
+
<general>
|
125 |
+
<removecompare>0</removecompare>
|
126 |
+
<removelink>1</removelink>
|
127 |
+
</general>
|
128 |
+
<noreload>
|
129 |
+
<enablenorealod>1</enablenorealod>
|
130 |
+
</noreload>
|
131 |
+
<limits>
|
132 |
+
<enable_compare_limits>0</enable_compare_limits>
|
133 |
+
<compare_limits>10</compare_limits>
|
134 |
+
</limits>
|
135 |
+
<popup>
|
136 |
+
<replacetemplate>0</replacetemplate>
|
137 |
+
<showlabelafter>3</showlabelafter>
|
138 |
+
<sortattributes>0</sortattributes>
|
139 |
+
</popup>
|
140 |
+
</advancedcompare>
|
141 |
+
</default>
|
142 |
+
|
143 |
+
<frontend>
|
144 |
+
<layout>
|
145 |
+
<updates>
|
146 |
+
<advancedcompare>
|
147 |
+
<file>et_advancedcompare.xml</file>
|
148 |
+
</advancedcompare>
|
149 |
+
</updates>
|
150 |
+
</layout>
|
151 |
+
<routers>
|
152 |
+
<advancedcompare>
|
153 |
+
<use>standard</use>
|
154 |
+
<args>
|
155 |
+
<module>ET_AdvancedCompare</module>
|
156 |
+
<frontName>advancedcompare</frontName>
|
157 |
+
</args>
|
158 |
+
</advancedcompare>
|
159 |
+
</routers>
|
160 |
+
<translate>
|
161 |
+
<modules>
|
162 |
+
<ET_AdvancedCompare>
|
163 |
+
<files>
|
164 |
+
<default>ET_AdvancedCompare.csv</default>
|
165 |
+
</files>
|
166 |
+
</ET_AdvancedCompare>
|
167 |
+
</modules>
|
168 |
+
</translate>
|
169 |
+
</frontend>
|
170 |
+
|
171 |
+
<adminhtml>
|
172 |
+
<acl>
|
173 |
+
<resources>
|
174 |
+
<admin>
|
175 |
+
<children>
|
176 |
+
<system>
|
177 |
+
<children>
|
178 |
+
<config>
|
179 |
+
<children>
|
180 |
+
<advancedcompare translate="title" module="advancedcompare">
|
181 |
+
<title>ET Advanced Compare Section</title>
|
182 |
+
<sort_order>400</sort_order>
|
183 |
+
</advancedcompare>
|
184 |
+
</children>
|
185 |
+
</config>
|
186 |
+
</children>
|
187 |
+
</system>
|
188 |
+
</children>
|
189 |
+
</admin>
|
190 |
+
</resources>
|
191 |
+
</acl>
|
192 |
+
<translate>
|
193 |
+
<modules>
|
194 |
+
<ET_AdvancedCompare>
|
195 |
+
<files>
|
196 |
+
<default>ET_AdvancedCompare.csv</default>
|
197 |
+
</files>
|
198 |
+
</ET_AdvancedCompare>
|
199 |
+
</modules>
|
200 |
+
</translate>
|
201 |
+
</adminhtml>
|
202 |
+
|
203 |
+
</config>
|
app/design/frontend/base/default/template/et_advancedcompare/list.phtml
ADDED
@@ -0,0 +1,279 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* NOTICE OF LICENSE
|
4 |
+
*
|
5 |
+
* You may not sell, sub-license, rent or lease
|
6 |
+
* any portion of the Software or Documentation to anyone.
|
7 |
+
*
|
8 |
+
* DISCLAIMER
|
9 |
+
*
|
10 |
+
* Do not edit or add to this file if you wish to upgrade to newer
|
11 |
+
* versions in the future.
|
12 |
+
*
|
13 |
+
* @category ET
|
14 |
+
* @package ET_AdvancedCompare
|
15 |
+
* @copyright Copyright (c) 2012 ET Web Solutions (http://etwebsolutions.com)
|
16 |
+
* @contacts support@etwebsolutions.com
|
17 |
+
* @license http://shop.etwebsolutions.com/etws-license-free-v1/ ETWS Free License (EFL1)
|
18 |
+
*/
|
19 |
+
|
20 |
+
/* @var $this Mage_Catalog_Block_Product_Compare_List */
|
21 |
+
|
22 |
+
/* Completely removes attributes with some values if all products have this values*/
|
23 |
+
|
24 |
+
//$show_labels_after = (int)Mage::getStoreConfig('advancedcompare/popup/showlabelafter');
|
25 |
+
$show_labels_after = 3;
|
26 |
+
if ($show_labels_after < 1) {
|
27 |
+
$show_labels_after = 3;
|
28 |
+
}
|
29 |
+
|
30 |
+
$checkbox_label = $this->__('Show similar rows');
|
31 |
+
$skipempty = true;
|
32 |
+
$removeAttributes = true;
|
33 |
+
$attributesToRemove = array('No', 'N/A', '—');
|
34 |
+
|
35 |
+
$rows = array();
|
36 |
+
foreach ($this->getAttributes() as $_attribute) {
|
37 |
+
$row_data = array();
|
38 |
+
$row_data['have_different_values'] = true;
|
39 |
+
$row_data['have_normal_values'] = false; // Normal = values not from $attributesToRemove array
|
40 |
+
$row_data['skip_empty_row'] = false;
|
41 |
+
$row_data['html'] = '';
|
42 |
+
$row_data['remove'] = false;
|
43 |
+
|
44 |
+
$first_value = '';
|
45 |
+
$first_value_set = false;
|
46 |
+
|
47 |
+
$_i = 0;
|
48 |
+
|
49 |
+
foreach($this->getItems() as $_item) {
|
50 |
+
if($_i++%$show_labels_after==0) {
|
51 |
+
$row_data['html'] .= '<th><span class="nobr">'.$_attribute->getStoreLabel().'</span></th>';
|
52 |
+
}
|
53 |
+
$row_data['html'] .= '<td>';
|
54 |
+
switch ($_attribute->getAttributeCode()) {
|
55 |
+
case "price":
|
56 |
+
$row_data['html'] .= $this->getPriceHtml($_item, true, '-compare-list-' . $_attribute->getCode());
|
57 |
+
break;
|
58 |
+
case "small_image":
|
59 |
+
$row_data['html'] .= '<img src="'.$this->helper('catalog/image')->init($_item, 'small_image')->resize(125, 125).'" width="125" height="125" alt="'.$this->htmlEscape($_item->getName()).'" title="'.$this->htmlEscape($_item->getName()).'" />';
|
60 |
+
break;
|
61 |
+
case "date":
|
62 |
+
$row_data['html'] .= substr($this->getProductAttributeValue($_item, $_attribute),0,10);
|
63 |
+
break;
|
64 |
+
default:
|
65 |
+
$value = $this->helper('catalog/output')->productAttribute($_item, $this->getProductAttributeValue($_item, $_attribute), $_attribute->getCode());
|
66 |
+
$row_data['html'] .= $value;
|
67 |
+
|
68 |
+
if (!$first_value_set) {
|
69 |
+
$first_value_set = true;
|
70 |
+
$first_value = $value;
|
71 |
+
}
|
72 |
+
|
73 |
+
if ($value != $first_value) {
|
74 |
+
$row_data['have_different_values'] = true;
|
75 |
+
$row_data['skip_empty_row'] = false;
|
76 |
+
$row_data['remove'] = false;
|
77 |
+
}
|
78 |
+
|
79 |
+
if (!in_array($value, $attributesToRemove)) {
|
80 |
+
$row_data['have_normal_values'] = true;
|
81 |
+
}
|
82 |
+
|
83 |
+
if (($skipempty) && (!$_item->hasData($_attribute->getAttributeCode()))) {
|
84 |
+
$row_data['skip_empty_row'] = !$row_data['have_different_values'];
|
85 |
+
}
|
86 |
+
|
87 |
+
if (($removeAttributes) && (!$row_data['have_normal_values'])) {
|
88 |
+
$row_data['remove'] = !$row_data['have_normal_values'];
|
89 |
+
}
|
90 |
+
|
91 |
+
break;
|
92 |
+
}
|
93 |
+
$row_data['html'] .= '</td>';
|
94 |
+
}
|
95 |
+
|
96 |
+
if (!$row_data['remove']) {
|
97 |
+
$rows[] = $row_data;
|
98 |
+
}
|
99 |
+
|
100 |
+
}
|
101 |
+
?>
|
102 |
+
|
103 |
+
<style type="text/css">
|
104 |
+
html { overflow-x:auto !important; }
|
105 |
+
.diff td { color:black; }
|
106 |
+
.similar * { color:#838081; }
|
107 |
+
|
108 |
+
.hiddenRow { display:none; }
|
109 |
+
.visibleRow { }
|
110 |
+
|
111 |
+
.topcheckbox { position:absolute; top:55px; left:30px; }
|
112 |
+
.bottomcheckbox { padding-top:10px; }
|
113 |
+
</style>
|
114 |
+
|
115 |
+
|
116 |
+
<!--div class="topcheckbox">
|
117 |
+
<input type="checkbox" id="chb" onclick="toggleSimilarRows(this.checked);"> <label for="chb"><?=$checkbox_label;?></label>
|
118 |
+
</div-->
|
119 |
+
<div class="page-title title-buttons">
|
120 |
+
<h1><?php echo $this->__('Compare Products') ?></h1>
|
121 |
+
<a href="#" onclick="window.print(); return false;" class="link-print"><?php echo $this->__('Print This Page') ?></a>
|
122 |
+
</div>
|
123 |
+
|
124 |
+
<?php $_total=$this->getItems()->getSize() ?>
|
125 |
+
<?php if($_total): ?>
|
126 |
+
<table class="data-table compare-table" id="product_comparison">
|
127 |
+
<?php $_i=0 ?>
|
128 |
+
<?php foreach($this->getItems() as $_item): ?>
|
129 |
+
<?php if($_i++%$show_labels_after==0): ?>
|
130 |
+
<col width="1" />
|
131 |
+
<?php endif; ?>
|
132 |
+
<col width="<?php echo floor(100/$_total); ?>%" />
|
133 |
+
<?php endforeach; ?>
|
134 |
+
<?php if ($_total>2): ?>
|
135 |
+
<thead>
|
136 |
+
<tr>
|
137 |
+
<?php $_i=0 ?>
|
138 |
+
<?php foreach($this->getItems() as $_item): ?>
|
139 |
+
<?php if($_i++%$show_labels_after==0): ?>
|
140 |
+
<th> </th>
|
141 |
+
<?php endif; ?>
|
142 |
+
<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>
|
143 |
+
<?php endforeach; ?>
|
144 |
+
</tr>
|
145 |
+
</thead>
|
146 |
+
<?php endif ?>
|
147 |
+
<tbody>
|
148 |
+
<tr class="product-shop-row">
|
149 |
+
<?php $_i=0 ?>
|
150 |
+
<?php foreach($this->getItems() as $_item): ?>
|
151 |
+
<?php if($_i++%$show_labels_after==0): ?>
|
152 |
+
<th> </th>
|
153 |
+
<?php endif; ?>
|
154 |
+
<td>
|
155 |
+
<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>
|
156 |
+
<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>
|
157 |
+
<?php echo $this->getReviewsSummaryHtml($_item, 'short') ?>
|
158 |
+
<?php echo $this->getPriceHtml($_item, true, '-compare-list-top') ?>
|
159 |
+
<?php if($_item->isSaleable()): ?>
|
160 |
+
<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>
|
161 |
+
<?php else: ?>
|
162 |
+
<p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
|
163 |
+
<?php endif; ?>
|
164 |
+
<?php if ($this->helper('wishlist')->isAllow()) : ?>
|
165 |
+
<ul class="add-to-links">
|
166 |
+
<li><a href="#" class="link-wishlist" onclick="setPLocation('<?php echo $this->getAddToWishlistUrl($_item) ?>', true)"><?php echo $this->__('Add to Wishlist') ?></a></li>
|
167 |
+
</ul>
|
168 |
+
<?php endif; ?>
|
169 |
+
</td>
|
170 |
+
<?php endforeach; ?>
|
171 |
+
</tr>
|
172 |
+
</tbody>
|
173 |
+
|
174 |
+
|
175 |
+
<tbody id="full" class="hiddenRow">
|
176 |
+
<? foreach ($rows as $row) : ?>
|
177 |
+
|
178 |
+
<? if (!$row['skip_empty_row']) :?>
|
179 |
+
<? if ($row['have_different_values']) :?>
|
180 |
+
<tr class="diff">
|
181 |
+
<? else: ?>
|
182 |
+
<tr class="similar">
|
183 |
+
<? endif;?>
|
184 |
+
<?=$row['html'];?>
|
185 |
+
</tr>
|
186 |
+
<? endif;?>
|
187 |
+
|
188 |
+
|
189 |
+
<? endforeach; ?>
|
190 |
+
</tbody>
|
191 |
+
<tbody id="short" class="visibleRow">
|
192 |
+
<? foreach ($rows as $row) : ?>
|
193 |
+
|
194 |
+
<? if (!$row['skip_empty_row']) :?>
|
195 |
+
|
196 |
+
|
197 |
+
<? if ($row['have_different_values']) :?>
|
198 |
+
<tr>
|
199 |
+
<?=$row['html'];?>
|
200 |
+
</tr>
|
201 |
+
<? endif;?>
|
202 |
+
|
203 |
+
<? endif;?>
|
204 |
+
|
205 |
+
|
206 |
+
<? endforeach; ?>
|
207 |
+
</tbody>
|
208 |
+
|
209 |
+
<tbody>
|
210 |
+
<tr class="add-to-row">
|
211 |
+
<?php $_i=0 ?>
|
212 |
+
<?php foreach($this->getItems() as $_item): ?>
|
213 |
+
<?php if($_i++%$show_labels_after==0): ?>
|
214 |
+
<th> </th>
|
215 |
+
<?php endif; ?>
|
216 |
+
<td>
|
217 |
+
<?php echo $this->getPriceHtml($_item, true, '-compare-list-bottom') ?>
|
218 |
+
<?php if($_item->isSaleable()): ?>
|
219 |
+
<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>
|
220 |
+
<?php else: ?>
|
221 |
+
<p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
|
222 |
+
<?php endif; ?>
|
223 |
+
<?php if ($this->helper('wishlist')->isAllow()) : ?>
|
224 |
+
<ul class="add-to-links">
|
225 |
+
<li><a href="#" class="link-wishlist" onclick="setPLocation('<?php echo $this->getAddToWishlistUrl($_item) ?>', true)"><?php echo $this->__('Add to Wishlist') ?></a></li>
|
226 |
+
</ul>
|
227 |
+
<?php endif; ?>
|
228 |
+
</td>
|
229 |
+
<?php endforeach; ?>
|
230 |
+
</tr>
|
231 |
+
</tbody>
|
232 |
+
</table>
|
233 |
+
<!--div class="bottomcheckbox">
|
234 |
+
<input type="checkbox" id="chb2" onclick="toggleSimilarRows(this.checked);"> <label for="chb2"><?=$checkbox_label;?></label>
|
235 |
+
</div-->
|
236 |
+
<div class="buttons-set">
|
237 |
+
<button type="button" title="<?php echo $this->__('Close Window') ?>" class="button" onclick="window.close();"><span><span><?php echo $this->__('Close Window') ?></span></span></button>
|
238 |
+
<span class="please-wait" id="compare-list-please-wait" style="display:none;">
|
239 |
+
<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...') ?>
|
240 |
+
</span>
|
241 |
+
</div>
|
242 |
+
|
243 |
+
|
244 |
+
<script type="text/javascript">
|
245 |
+
decorateTable('product_comparison');
|
246 |
+
|
247 |
+
/**
|
248 |
+
* Send remove item request, after that reload windows
|
249 |
+
*/
|
250 |
+
function removeItem(url)
|
251 |
+
{
|
252 |
+
new Ajax.Request(url, {
|
253 |
+
parameters: {isAjax: 1, method: 'POST'},
|
254 |
+
onLoading: function(){$('compare-list-please-wait').show();},
|
255 |
+
onSuccess: function(transport) {
|
256 |
+
$('compare-list-please-wait').hide();
|
257 |
+
window.location.reload();
|
258 |
+
window.opener.location.reload();
|
259 |
+
}
|
260 |
+
});
|
261 |
+
}
|
262 |
+
|
263 |
+
function toggleSimilarRows(show) {
|
264 |
+
if (show == true) {
|
265 |
+
document.getElementById('full').className = 'visibleRow';
|
266 |
+
document.getElementById('short').className = 'hiddenRow';
|
267 |
+
document.getElementById('chb').checked = true;
|
268 |
+
document.getElementById('chb2').checked = true;
|
269 |
+
} else {
|
270 |
+
document.getElementById('full').className = 'hiddenRow';
|
271 |
+
document.getElementById('short').className = 'visibleRow';
|
272 |
+
document.getElementById('chb').checked = false;
|
273 |
+
document.getElementById('chb2').checked = false;
|
274 |
+
}
|
275 |
+
}
|
276 |
+
</script>
|
277 |
+
<?php else: ?>
|
278 |
+
<script type="text/javascript">window.close();</script>
|
279 |
+
<?php endif; ?>
|
app/design/frontend/base/default/template/et_advancedcompare/list_15x_custom.phtml
ADDED
@@ -0,0 +1,280 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* NOTICE OF LICENSE
|
4 |
+
*
|
5 |
+
* You may not sell, sub-license, rent or lease
|
6 |
+
* any portion of the Software or Documentation to anyone.
|
7 |
+
*
|
8 |
+
* DISCLAIMER
|
9 |
+
*
|
10 |
+
* Do not edit or add to this file if you wish to upgrade to newer
|
11 |
+
* versions in the future.
|
12 |
+
*
|
13 |
+
* @category ET
|
14 |
+
* @package ET_AdvancedCompare
|
15 |
+
* @copyright Copyright (c) 2012 ET Web Solutions (http://etwebsolutions.com)
|
16 |
+
* @contacts support@etwebsolutions.com
|
17 |
+
* @license http://shop.etwebsolutions.com/etws-license-free-v1/ ETWS Free License (EFL1)
|
18 |
+
*/
|
19 |
+
|
20 |
+
/* @var $this Mage_Catalog_Block_Product_Compare_List */
|
21 |
+
|
22 |
+
/* Completely removes attributes with some values if all products have this values*/
|
23 |
+
|
24 |
+
$show_labels_after = (int)Mage::getStoreConfig('advancedcompare/popup/showlabelafter');
|
25 |
+
if ($show_labels_after < 1) {
|
26 |
+
$show_labels_after = 3;
|
27 |
+
}
|
28 |
+
|
29 |
+
$checkbox_label = Mage::helper('advancedcompare')->__('Show similar rows');
|
30 |
+
$skipempty = false;
|
31 |
+
$removeAttributes = true;
|
32 |
+
$attributesToRemove = array('No', 'N/A');
|
33 |
+
|
34 |
+
$rows = array();
|
35 |
+
foreach ($this->getAttributes() as $_attribute) {
|
36 |
+
$row_data = array();
|
37 |
+
$row_data['have_different_values'] = false;
|
38 |
+
$row_data['have_normal_values'] = false; // Normal = values not from $attributesToRemove array
|
39 |
+
$row_data['skip_empty_row'] = false;
|
40 |
+
$row_data['html'] = '';
|
41 |
+
$row_data['remove'] = false;
|
42 |
+
|
43 |
+
$first_value = '';
|
44 |
+
$first_value_set = false;
|
45 |
+
|
46 |
+
$_i = 0;
|
47 |
+
|
48 |
+
foreach($this->getItems() as $_item) {
|
49 |
+
if($_i++%$show_labels_after==0) {
|
50 |
+
$row_data['html'] .= '<th><span class="nobr">'.$_attribute->getStoreLabel().'</span></th>';
|
51 |
+
}
|
52 |
+
$row_data['html'] .= '<td>';
|
53 |
+
switch ($_attribute->getAttributeCode()) {
|
54 |
+
case "price":
|
55 |
+
$row_data['html'] .= $this->getPriceHtml($_item, true, '-compare-list-' . $_attribute->getCode());
|
56 |
+
break;
|
57 |
+
case "small_image":
|
58 |
+
$row_data['html'] .= '<img src="'.$this->helper('catalog/image')->init($_item, 'small_image')->resize(125, 125).'" width="125" height="125" alt="'.$this->htmlEscape($_item->getName()).'" title="'.$this->htmlEscape($_item->getName()).'" />';
|
59 |
+
break;
|
60 |
+
case "date":
|
61 |
+
$row_data['html'] .= substr($this->getProductAttributeValue($_item, $_attribute),0,10);
|
62 |
+
break;
|
63 |
+
default:
|
64 |
+
$value = $this->helper('catalog/output')->productAttribute($_item, $this->getProductAttributeValue($_item, $_attribute), $_attribute->getCode());
|
65 |
+
$row_data['html'] .= $value;
|
66 |
+
|
67 |
+
if (!$first_value_set) {
|
68 |
+
$first_value_set = true;
|
69 |
+
$first_value = $value;
|
70 |
+
}
|
71 |
+
|
72 |
+
if ($value != $first_value) {
|
73 |
+
$row_data['have_different_values'] = true;
|
74 |
+
$row_data['skip_empty_row'] = false;
|
75 |
+
$row_data['remove'] = false;
|
76 |
+
}
|
77 |
+
|
78 |
+
if (!in_array($value, $attributesToRemove)) {
|
79 |
+
$row_data['have_normal_values'] = true;
|
80 |
+
}
|
81 |
+
|
82 |
+
if (($skipempty) && (!$_item->hasData($_attribute->getAttributeCode()))) {
|
83 |
+
//$row_data['skip_empty_row'] = !$row_data['have_different_values'];
|
84 |
+
}
|
85 |
+
|
86 |
+
if (($removeAttributes) && (!$row_data['have_normal_values'])) {
|
87 |
+
$row_data['remove'] = !$row_data['have_normal_values'];
|
88 |
+
}
|
89 |
+
|
90 |
+
break;
|
91 |
+
}
|
92 |
+
$row_data['html'] .= '</td>';
|
93 |
+
}
|
94 |
+
|
95 |
+
if (!$row_data['remove']) {
|
96 |
+
$rows[] = $row_data;
|
97 |
+
}
|
98 |
+
|
99 |
+
|
100 |
+
}
|
101 |
+
?>
|
102 |
+
|
103 |
+
|
104 |
+
<style type="text/css">
|
105 |
+
html { overflow-x:auto !important; }
|
106 |
+
.diff td { color:black; }
|
107 |
+
.similar * { color:#838081; }
|
108 |
+
|
109 |
+
.hiddenRow { display:none; }
|
110 |
+
.visibleRow { }
|
111 |
+
|
112 |
+
.topcheckbox { position:absolute; top:55px; left:30px; }
|
113 |
+
.bottomcheckbox { padding-top:10px; }
|
114 |
+
</style>
|
115 |
+
|
116 |
+
|
117 |
+
<!--div class="topcheckbox">
|
118 |
+
<input type="checkbox" id="chb" onclick="toggleSimilarRows(this.checked);"> <label for="chb"><?=$checkbox_label;?></label>
|
119 |
+
</div-->
|
120 |
+
<div class="page-title title-buttons">
|
121 |
+
<h1><?php echo $this->__('Compare Products') ?></h1>
|
122 |
+
<a href="#" onclick="window.print(); return false;" class="link-print"><?php echo $this->__('Print This Page') ?></a>
|
123 |
+
</div>
|
124 |
+
|
125 |
+
<?php $_total=$this->getItems()->getSize() ?>
|
126 |
+
<?php if($_total): ?>
|
127 |
+
<table class="data-table compare-table" id="product_comparison">
|
128 |
+
<?php $_i=0 ?>
|
129 |
+
<?php foreach($this->getItems() as $_item): ?>
|
130 |
+
<?php if($_i++%$show_labels_after==0): ?>
|
131 |
+
<col width="1" />
|
132 |
+
<?php endif; ?>
|
133 |
+
<col width="<?php echo floor(100/$_total); ?>%" />
|
134 |
+
<?php endforeach; ?>
|
135 |
+
<?php if ($_total>2): ?>
|
136 |
+
<thead>
|
137 |
+
<tr>
|
138 |
+
<?php $_i=0 ?>
|
139 |
+
<?php foreach($this->getItems() as $_item): ?>
|
140 |
+
<?php if($_i++%$show_labels_after==0): ?>
|
141 |
+
<th> </th>
|
142 |
+
<?php endif; ?>
|
143 |
+
<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>
|
144 |
+
<?php endforeach; ?>
|
145 |
+
</tr>
|
146 |
+
</thead>
|
147 |
+
<?php endif ?>
|
148 |
+
<tbody>
|
149 |
+
<tr class="product-shop-row">
|
150 |
+
<?php $_i=0 ?>
|
151 |
+
<?php foreach($this->getItems() as $_item): ?>
|
152 |
+
<?php if($_i++%$show_labels_after==0): ?>
|
153 |
+
<th> </th>
|
154 |
+
<?php endif; ?>
|
155 |
+
<td>
|
156 |
+
<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>
|
157 |
+
<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>
|
158 |
+
<?php echo $this->getReviewsSummaryHtml($_item, 'short') ?>
|
159 |
+
<?php echo $this->getPriceHtml($_item, true, '-compare-list-top') ?>
|
160 |
+
<?php if($_item->isSaleable()): ?>
|
161 |
+
<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>
|
162 |
+
<?php else: ?>
|
163 |
+
<p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
|
164 |
+
<?php endif; ?>
|
165 |
+
<?php if ($this->helper('wishlist')->isAllow()) : ?>
|
166 |
+
<ul class="add-to-links">
|
167 |
+
<li><a href="#" class="link-wishlist" onclick="setPLocation('<?php echo $this->getAddToWishlistUrl($_item) ?>', true)"><?php echo $this->__('Add to Wishlist') ?></a></li>
|
168 |
+
</ul>
|
169 |
+
<?php endif; ?>
|
170 |
+
</td>
|
171 |
+
<?php endforeach; ?>
|
172 |
+
</tr>
|
173 |
+
</tbody>
|
174 |
+
|
175 |
+
|
176 |
+
<tbody id="full" class="hiddenRow">
|
177 |
+
<? foreach ($rows as $row) : ?>
|
178 |
+
|
179 |
+
<? if (!$row['skip_empty_row']) :?>
|
180 |
+
<? if ($row['have_different_values']) :?>
|
181 |
+
<tr class="diff">
|
182 |
+
<? else: ?>
|
183 |
+
<tr class="similar">
|
184 |
+
<? endif;?>
|
185 |
+
<?=$row['html'];?>
|
186 |
+
</tr>
|
187 |
+
<? endif;?>
|
188 |
+
|
189 |
+
|
190 |
+
<? endforeach; ?>
|
191 |
+
</tbody>
|
192 |
+
<tbody id="short" class="visibleRow">
|
193 |
+
<? foreach ($rows as $row) : ?>
|
194 |
+
|
195 |
+
<? if (!$row['skip_empty_row']) :?>
|
196 |
+
|
197 |
+
|
198 |
+
<? if ($row['have_different_values']) :?>
|
199 |
+
<tr>
|
200 |
+
<?=$row['html'];?>
|
201 |
+
</tr>
|
202 |
+
<? endif;?>
|
203 |
+
|
204 |
+
<? endif;?>
|
205 |
+
|
206 |
+
|
207 |
+
<? endforeach; ?>
|
208 |
+
</tbody>
|
209 |
+
|
210 |
+
<tbody>
|
211 |
+
<tr class="add-to-row">
|
212 |
+
<?php $_i=0 ?>
|
213 |
+
<?php foreach($this->getItems() as $_item): ?>
|
214 |
+
<?php if($_i++%$show_labels_after==0): ?>
|
215 |
+
<th> </th>
|
216 |
+
<?php endif; ?>
|
217 |
+
<td>
|
218 |
+
<?php echo $this->getPriceHtml($_item, true, '-compare-list-bottom') ?>
|
219 |
+
<?php if($_item->isSaleable()): ?>
|
220 |
+
<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>
|
221 |
+
<?php else: ?>
|
222 |
+
<p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
|
223 |
+
<?php endif; ?>
|
224 |
+
<?php if ($this->helper('wishlist')->isAllow()) : ?>
|
225 |
+
<ul class="add-to-links">
|
226 |
+
<li><a href="#" class="link-wishlist" onclick="setPLocation('<?php echo $this->getAddToWishlistUrl($_item) ?>', true)"><?php echo $this->__('Add to Wishlist') ?></a></li>
|
227 |
+
</ul>
|
228 |
+
<?php endif; ?>
|
229 |
+
</td>
|
230 |
+
<?php endforeach; ?>
|
231 |
+
</tr>
|
232 |
+
</tbody>
|
233 |
+
</table>
|
234 |
+
<!--div class="bottomcheckbox">
|
235 |
+
<input type="checkbox" id="chb2" onclick="toggleSimilarRows(this.checked);"> <label for="chb2"><?=$checkbox_label;?></label>
|
236 |
+
</div-->
|
237 |
+
<div class="buttons-set">
|
238 |
+
<button type="button" title="<?php echo $this->__('Close Window') ?>" class="button" onclick="window.close();"><span><span><?php echo $this->__('Close Window') ?></span></span></button>
|
239 |
+
<span class="please-wait" id="compare-list-please-wait" style="display:none;">
|
240 |
+
<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...') ?>
|
241 |
+
</span>
|
242 |
+
</div>
|
243 |
+
|
244 |
+
|
245 |
+
<script type="text/javascript">
|
246 |
+
decorateTable('product_comparison');
|
247 |
+
|
248 |
+
/**
|
249 |
+
* Send remove item request, after that reload windows
|
250 |
+
*/
|
251 |
+
function removeItem(url)
|
252 |
+
{
|
253 |
+
new Ajax.Request(url, {
|
254 |
+
parameters: {isAjax: 1, method: 'POST'},
|
255 |
+
onLoading: function(){$('compare-list-please-wait').show();},
|
256 |
+
onSuccess: function(transport) {
|
257 |
+
$('compare-list-please-wait').hide();
|
258 |
+
window.location.reload();
|
259 |
+
window.opener.location.reload();
|
260 |
+
}
|
261 |
+
});
|
262 |
+
}
|
263 |
+
|
264 |
+
function toggleSimilarRows(show) {
|
265 |
+
if (show == true) {
|
266 |
+
document.getElementById('full').className = 'visibleRow';
|
267 |
+
document.getElementById('short').className = 'hiddenRow';
|
268 |
+
document.getElementById('chb').checked = true;
|
269 |
+
document.getElementById('chb2').checked = true;
|
270 |
+
} else {
|
271 |
+
document.getElementById('full').className = 'hiddenRow';
|
272 |
+
document.getElementById('short').className = 'visibleRow';
|
273 |
+
document.getElementById('chb').checked = false;
|
274 |
+
document.getElementById('chb2').checked = false;
|
275 |
+
}
|
276 |
+
}
|
277 |
+
</script>
|
278 |
+
<?php else: ?>
|
279 |
+
<script type="text/javascript">window.close();</script>
|
280 |
+
<?php endif; ?>
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>ET_AdvancedCompare</name>
|
4 |
-
<version>1.0.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://shop.etwebsolutions.com/eng/etws-license-free-v1">ETWS Free License (EFL1)</license>
|
7 |
<channel>community</channel>
|
@@ -10,9 +10,9 @@
|
|
10 |
<description>_Extension allows to add products to compare without page reloading (AJAX), improves visualization of results and allows to switch compare off on your website._</description>
|
11 |
<notes>stable release</notes>
|
12 |
<authors><author><name>Jurij</name><user>auto-converted</user><email>support@etwebsolutions.com</email></author><author><name>Andrej</name><user>auto-converted</user><email>support@etwebsolutions.com</email></author></authors>
|
13 |
-
<date>2014-
|
14 |
-
<time>
|
15 |
-
<contents><target name="magecommunity"><dir name="ET"><dir name="AdvancedCompare"><dir name="Block"><dir name="Adminhtml"><file name="Support.php" hash="79d3f4eaf70ac0618a8ff806912c414c"/></dir
|
16 |
<compatible/>
|
17 |
<dependencies/>
|
18 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>ET_AdvancedCompare</name>
|
4 |
+
<version>1.0.5</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://shop.etwebsolutions.com/eng/etws-license-free-v1">ETWS Free License (EFL1)</license>
|
7 |
<channel>community</channel>
|
10 |
<description>_Extension allows to add products to compare without page reloading (AJAX), improves visualization of results and allows to switch compare off on your website._</description>
|
11 |
<notes>stable release</notes>
|
12 |
<authors><author><name>Jurij</name><user>auto-converted</user><email>support@etwebsolutions.com</email></author><author><name>Andrej</name><user>auto-converted</user><email>support@etwebsolutions.com</email></author></authors>
|
13 |
+
<date>2014-10-18</date>
|
14 |
+
<time>12:04:43</time>
|
15 |
+
<contents><target name="magecommunity"><dir name="ET"><dir name="AdvancedCompare"><dir name="Block"><dir name="Adminhtml"><file name="Support.php" hash="79d3f4eaf70ac0618a8ff806912c414c"/></dir></dir><dir name="Helper"><file name="Data.php" hash="702052fe21125ebfc48d8aa66cf673a1"/></dir><dir name="Model"><dir name="Resource"><dir name="Eav"><dir name="Mysql4"><dir name="Product"><dir name="Compare"><dir name="Item"><file name="Collection.php" hash="e9db5afa88daf6a70525bf2b58160489"/></dir></dir></dir></dir></dir></dir><file name="Observer.php" hash="c1a246b986753124c31c544d923e4714"/></dir><dir name="controllers"><file name="IndexController.php" hash="edd8d80a790ea9415e4de155b25e0501"/></dir><dir name="etc"><file name="config.xml" hash="8203071b5ac449be4d109ce91aa4e284"/><file name="system.xml" hash="0239ba90072ca541a8bfe4b5f7d8020b"/></dir><dir name="sql"><dir name="advancedcompare_setup"><file name="mysql4-install-0.1.php" hash="e4038068589261327903f210af4ca747"/></dir></dir></dir></dir></target><target name="magelocale"><dir name="ru_RU"><file name="ET_AdvancedCompare.csv" hash="536aea201d04850321b05bcd985de2ec"/></dir><dir name="en_US"><file name="ET_AdvancedCompare.csv" hash="772f8c59d17d778d471ad0850e8eb01e"/></dir><dir name="lv_LV"><file name="ET_AdvancedCompare.csv" hash="ed2b485b44f1df6ad41350011bcc2e06"/></dir></target><target name="mageetc"><dir name="modules"><file name="ET_AdvancedCompare.xml" hash="1f3eca245249878c9da9481464c2b84e"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="et_advancedcompare"><file name="list.phtml" hash="ea8bf46ca7a8a99da8fdb8601676bfe0"/><file name="list_13x.phtml" hash="045859ed681f3854c4c13be3e26cf275"/><file name="list_15x.phtml" hash="f5b0c350a28f87e90543c2978580abcc"/><file name="list_15x_custom.phtml" hash="f79ea8ec2c6cbecf26042bf5c0d5f888"/></dir></dir><dir name="layout"><file name="et_advancedcompare.xml" hash="d87c72cb9b2bea665b1cf90f038658ad"/></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><dir name="et_advancedcompare"><file name="noreload.css" hash="e2e7f8762594c129ad84ef865694d88e"/></dir></dir><dir name="js"><dir name="et_advancedcompare"><file name="noreload.js" hash="fce9dbe16eb0d5e412d7a78165ec8024"/></dir></dir></dir></dir></dir></target></contents>
|
16 |
<compatible/>
|
17 |
<dependencies/>
|
18 |
</package>
|