Version Notes
This module was tested in Magento Commerce version 1.4.0.1 and 1.5.0.1, and work in this version smoothly.
Download this release
Release Info
Developer | Magento Core Team |
Extension | PSystem_CatalogAjax |
Version | 1.0.0 |
Comparing to | |
See all releases |
Version 1.0.0
- app/code/community/PSystem/CatalogAjax/Block/Config.php +90 -0
- app/code/community/PSystem/CatalogAjax/etc/adminhtml.xml +28 -0
- app/code/community/PSystem/CatalogAjax/etc/config.xml +32 -0
- app/code/community/PSystem/CatalogAjax/etc/system.xml +177 -0
- app/design/frontend/default/default/layout/ps_catalogajax.xml +20 -0
- app/etc/modules/PSystem_CatalogAjax.xml +20 -0
- js/pascalsystem/catalogajax.js +108 -0
- package.xml +18 -0
app/code/community/PSystem/CatalogAjax/Block/Config.php
ADDED
@@ -0,0 +1,90 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?
|
2 |
+
/**
|
3 |
+
* @category PSystem
|
4 |
+
* @package PSystem_CatalogAjax
|
5 |
+
* @author Pascal System <info@pascalsystem.pl>
|
6 |
+
* @version 1.0.0
|
7 |
+
*/
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Pascal Catalog Ajax config block
|
11 |
+
*
|
12 |
+
* @category PSystem
|
13 |
+
* @package PSystem_CatalogAjax
|
14 |
+
* @author Pascal System <info@pascalsystem.pl>
|
15 |
+
* @version 1.0.0
|
16 |
+
*/
|
17 |
+
class PSystem_CatalogAjax_Block_Config extends Mage_Core_Block_Abstract {
|
18 |
+
/**
|
19 |
+
* Render block config
|
20 |
+
*
|
21 |
+
* @return string
|
22 |
+
*
|
23 |
+
*/
|
24 |
+
public function _toHtml() {
|
25 |
+
$content = "";
|
26 |
+
|
27 |
+
$configs = array(
|
28 |
+
'selector' => array(
|
29 |
+
'paginator' => 'pscatalogajax/selector/paginator',
|
30 |
+
'limiter' => 'pscatalogajax/selector/limiter',
|
31 |
+
'mode' => 'pscatalogajax/selector/mode',
|
32 |
+
'sortby' => 'pscatalogajax/selector/sortby',
|
33 |
+
'sortdir' => 'pscatalogajax/selector/sortdir',
|
34 |
+
'navfilter' => 'pscatalogajax/selector/navfilter',
|
35 |
+
'navclear' => 'pscatalogajax/selector/navclear',
|
36 |
+
'navremove' => 'pscatalogajax/selector/navremove'
|
37 |
+
),
|
38 |
+
'content' => array(
|
39 |
+
'name' => 'pscatalogajax/blockcontent/name',
|
40 |
+
'selector' => 'pscatalogajax/blockcontent/selector',
|
41 |
+
'replace' => 'pscatalogajax/blockcontent/replace'
|
42 |
+
),
|
43 |
+
'layer' => array(
|
44 |
+
'name' => 'pscatalogajax/blocklayer/name',
|
45 |
+
'selector' => 'pscatalogajax/blocklayer/selector',
|
46 |
+
'replace' => 'pscatalogajax/blocklayer/replace'
|
47 |
+
)
|
48 |
+
);
|
49 |
+
|
50 |
+
$newConfig = array();
|
51 |
+
foreach ($configs as $confKey => $_data) {
|
52 |
+
foreach ($_data as $dataKey => $dataVal) {
|
53 |
+
$tempVal = Mage::getStoreConfig($dataVal);
|
54 |
+
if (!empty($tempVal)) {
|
55 |
+
if (!isset($newConfig[$confKey]))
|
56 |
+
$newConfig[$confKey] = array();
|
57 |
+
$newConfig[$confKey][$dataKey] = $tempVal;
|
58 |
+
}
|
59 |
+
}
|
60 |
+
}
|
61 |
+
|
62 |
+
if (count($newConfig)) {
|
63 |
+
$content.= "<script type=\"text/javascript\">\n";
|
64 |
+
foreach ($newConfig as $key => $data) {
|
65 |
+
switch ($key) {
|
66 |
+
case 'selector' :
|
67 |
+
foreach ($data as $_key => $_val) {
|
68 |
+
$content.= "PS.catalogajax.config.".$_key."='".$_val."';\n";
|
69 |
+
}
|
70 |
+
break;
|
71 |
+
case 'content' :
|
72 |
+
foreach ($data as $_key => $_val) {
|
73 |
+
$content.= "PS.catalogajax.config.blocks.content.".$_key."='".$_val."';\n";
|
74 |
+
}
|
75 |
+
break;
|
76 |
+
case 'layer' :
|
77 |
+
foreach ($data as $_key => $_val) {
|
78 |
+
$content.= "PS.catalogajax.config.blocks.layer.".$_key."='".$_val."';\n";
|
79 |
+
}
|
80 |
+
break;
|
81 |
+
default:
|
82 |
+
continue;
|
83 |
+
}
|
84 |
+
}
|
85 |
+
$content.= "</script>\n";
|
86 |
+
}
|
87 |
+
|
88 |
+
return $content;
|
89 |
+
}
|
90 |
+
}
|
app/code/community/PSystem/CatalogAjax/etc/adminhtml.xml
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* @category PSystem
|
5 |
+
* @package PSystem_CatalogAjax
|
6 |
+
* @author Pascal System <info@pascalsystem.pl>
|
7 |
+
* @version 1.0.0
|
8 |
+
*/
|
9 |
+
-->
|
10 |
+
<config>
|
11 |
+
<acl>
|
12 |
+
<resources>
|
13 |
+
<admin>
|
14 |
+
<children>
|
15 |
+
<system>
|
16 |
+
<children>
|
17 |
+
<config>
|
18 |
+
<children>
|
19 |
+
<pscatalogajax />
|
20 |
+
</children>
|
21 |
+
</config>
|
22 |
+
</children>
|
23 |
+
</system>
|
24 |
+
</children>
|
25 |
+
</admin>
|
26 |
+
</resources>
|
27 |
+
</acl>
|
28 |
+
</config>
|
app/code/community/PSystem/CatalogAjax/etc/config.xml
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* @category PSystem
|
5 |
+
* @package PSystem_CatalogAjax
|
6 |
+
* @author Pascal System <info@pascalsystem.pl>
|
7 |
+
* @version 1.0.0
|
8 |
+
*/
|
9 |
+
-->
|
10 |
+
<config>
|
11 |
+
<modules>
|
12 |
+
<PSystem_CatalogAjax>
|
13 |
+
<version>1.0.0</version>
|
14 |
+
</PSystem_CatalogAjax>
|
15 |
+
</modules>
|
16 |
+
<global>
|
17 |
+
<blocks>
|
18 |
+
<pscatalogajax>
|
19 |
+
<class>PSystem_CatalogAjax_Block</class>
|
20 |
+
</pscatalogajax>
|
21 |
+
</blocks>
|
22 |
+
</global>
|
23 |
+
<frontend>
|
24 |
+
<layout>
|
25 |
+
<updates>
|
26 |
+
<ps_catalogajax module="PSystem_CatalogAjax">
|
27 |
+
<file>ps_catalogajax.xml</file>
|
28 |
+
</ps_catalogajax>
|
29 |
+
</updates>
|
30 |
+
</layout>
|
31 |
+
</frontend>
|
32 |
+
</config>
|
app/code/community/PSystem/CatalogAjax/etc/system.xml
ADDED
@@ -0,0 +1,177 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* @category PSystem
|
5 |
+
* @package PSystem_CatalogAjax
|
6 |
+
* @author Pascal System <info@pascalsystem.pl>
|
7 |
+
* @version 1.0.0
|
8 |
+
*/
|
9 |
+
-->
|
10 |
+
<config>
|
11 |
+
<sections>
|
12 |
+
<pscatalogajax translate="label" module="psbase">
|
13 |
+
<label>Catalog Ajax</label>
|
14 |
+
<tab>psystem</tab>
|
15 |
+
<frontend_type>text</frontend_type>
|
16 |
+
<sort_order>10</sort_order>
|
17 |
+
<show_in_default>1</show_in_default>
|
18 |
+
<show_in_website>1</show_in_website>
|
19 |
+
<show_in_store>1</show_in_store>
|
20 |
+
<groups>
|
21 |
+
<selector translate="label">
|
22 |
+
<label>CSS Selectors</label>
|
23 |
+
<show_in_default>1</show_in_default>
|
24 |
+
<show_in_website>1</show_in_website>
|
25 |
+
<show_in_store>0</show_in_store>
|
26 |
+
<sort_order>5</sort_order>
|
27 |
+
<fields>
|
28 |
+
<paginator translate="label,comment">
|
29 |
+
<label>Paginator</label>
|
30 |
+
<comment><![CDATA[default: .toolbar .pager .pages a]]></comment>
|
31 |
+
<frontend_type>text</frontend_type>
|
32 |
+
<sort_order>5</sort_order>
|
33 |
+
<show_in_default>1</show_in_default>
|
34 |
+
<show_in_website>1</show_in_website>
|
35 |
+
<show_in_store>0</show_in_store>
|
36 |
+
</paginator>
|
37 |
+
<limiter translate="label,comment">
|
38 |
+
<label>Limiter</label>
|
39 |
+
<comment><![CDATA[default: .toolbar .pager .limiter select]]></comment>
|
40 |
+
<frontend_type>text</frontend_type>
|
41 |
+
<sort_order>10</sort_order>
|
42 |
+
<show_in_default>1</show_in_default>
|
43 |
+
<show_in_website>1</show_in_website>
|
44 |
+
<show_in_store>0</show_in_store>
|
45 |
+
</limiter>
|
46 |
+
<mode translate="label,comment">
|
47 |
+
<label>View mode</label>
|
48 |
+
<comment><![CDATA[default: .toolbar .sorter .view-mode a]]></comment>
|
49 |
+
<frontend_type>text</frontend_type>
|
50 |
+
<sort_order>15</sort_order>
|
51 |
+
<show_in_default>1</show_in_default>
|
52 |
+
<show_in_website>1</show_in_website>
|
53 |
+
<show_in_store>0</show_in_store>
|
54 |
+
</mode>
|
55 |
+
<sortby translate="label,comment">
|
56 |
+
<label>Sort by</label>
|
57 |
+
<comment><![CDATA[default: .toolbar .sorter .sort-by select]]></comment>
|
58 |
+
<frontend_type>text</frontend_type>
|
59 |
+
<sort_order>20</sort_order>
|
60 |
+
<show_in_default>1</show_in_default>
|
61 |
+
<show_in_website>1</show_in_website>
|
62 |
+
<show_in_store>0</show_in_store>
|
63 |
+
</sortby>
|
64 |
+
<sortdir translate="label,comment">
|
65 |
+
<label>Sort direction</label>
|
66 |
+
<comment><![CDATA[default: .toolbar .sorter .sort-by a]]></comment>
|
67 |
+
<frontend_type>text</frontend_type>
|
68 |
+
<sort_order>25</sort_order>
|
69 |
+
<show_in_default>1</show_in_default>
|
70 |
+
<show_in_website>1</show_in_website>
|
71 |
+
<show_in_store>0</show_in_store>
|
72 |
+
</sortdir>
|
73 |
+
<navfilter translate="label,comment">
|
74 |
+
<label>Navigation filter</label>
|
75 |
+
<comment><![CDATA[default: .block-layered-nav .block-content ol li a]]></comment>
|
76 |
+
<frontend_type>text</frontend_type>
|
77 |
+
<sort_order>30</sort_order>
|
78 |
+
<show_in_default>1</show_in_default>
|
79 |
+
<show_in_website>1</show_in_website>
|
80 |
+
<show_in_store>0</show_in_store>
|
81 |
+
</navfilter>
|
82 |
+
<navclear translate="label,comment">
|
83 |
+
<label>Navigation clear</label>
|
84 |
+
<comment><![CDATA[default: .block-layered-nav .block-content .currently .actions a]]></comment>
|
85 |
+
<frontend_type>text</frontend_type>
|
86 |
+
<sort_order>35</sort_order>
|
87 |
+
<show_in_default>1</show_in_default>
|
88 |
+
<show_in_website>1</show_in_website>
|
89 |
+
<show_in_store>0</show_in_store>
|
90 |
+
</navclear>
|
91 |
+
<navremove translate="label,comment">
|
92 |
+
<label>Navigation filter remove</label>
|
93 |
+
<comment><![CDATA[default: .block-layered-nav .block-content .currently ol li a]]></comment>
|
94 |
+
<frontend_type>text</frontend_type>
|
95 |
+
<sort_order>40</sort_order>
|
96 |
+
<show_in_default>1</show_in_default>
|
97 |
+
<show_in_website>1</show_in_website>
|
98 |
+
<show_in_store>0</show_in_store>
|
99 |
+
</navremove>
|
100 |
+
</fields>
|
101 |
+
</selector>
|
102 |
+
<blockcontent>
|
103 |
+
<label>Block Content</label>
|
104 |
+
<show_in_default>1</show_in_default>
|
105 |
+
<show_in_website>1</show_in_website>
|
106 |
+
<show_in_store>0</show_in_store>
|
107 |
+
<sort_order>10</sort_order>
|
108 |
+
<fields>
|
109 |
+
<name translate="label,comment">
|
110 |
+
<label>Name</label>
|
111 |
+
<comment><![CDATA[default: content]]></comment>
|
112 |
+
<frontend_type>text</frontend_type>
|
113 |
+
<sort_order>5</sort_order>
|
114 |
+
<show_in_default>1</show_in_default>
|
115 |
+
<show_in_website>1</show_in_website>
|
116 |
+
<show_in_store>0</show_in_store>
|
117 |
+
</name>
|
118 |
+
<selector translate="label,comment">
|
119 |
+
<label>Selector for block</label>
|
120 |
+
<comment><![CDATA[default: .page .main .col-main]]></comment>
|
121 |
+
<frontend_type>text</frontend_type>
|
122 |
+
<sort_order>10</sort_order>
|
123 |
+
<show_in_default>1</show_in_default>
|
124 |
+
<show_in_website>1</show_in_website>
|
125 |
+
<show_in_store>0</show_in_store>
|
126 |
+
</selector>
|
127 |
+
<replace translate="label,comment">
|
128 |
+
<label>Replace selector</label>
|
129 |
+
<comment><![CDATA[default: empty]]></comment>
|
130 |
+
<frontend_type>text</frontend_type>
|
131 |
+
<sort_order>15</sort_order>
|
132 |
+
<show_in_default>1</show_in_default>
|
133 |
+
<show_in_website>1</show_in_website>
|
134 |
+
<show_in_store>0</show_in_store>
|
135 |
+
</replace>
|
136 |
+
</fields>
|
137 |
+
</blockcontent>
|
138 |
+
<blocklayer>
|
139 |
+
<label>Block Layer Navigation</label>
|
140 |
+
<show_in_default>1</show_in_default>
|
141 |
+
<show_in_website>1</show_in_website>
|
142 |
+
<show_in_store>0</show_in_store>
|
143 |
+
<sort_order>15</sort_order>
|
144 |
+
<fields>
|
145 |
+
<name translate="label,comment">
|
146 |
+
<label>Name</label>
|
147 |
+
<comment><![CDATA[default: catalog.leftnav]]></comment>
|
148 |
+
<frontend_type>text</frontend_type>
|
149 |
+
<sort_order>5</sort_order>
|
150 |
+
<show_in_default>1</show_in_default>
|
151 |
+
<show_in_website>1</show_in_website>
|
152 |
+
<show_in_store>0</show_in_store>
|
153 |
+
</name>
|
154 |
+
<selector translate="label,comment">
|
155 |
+
<label>Selector for block</label>
|
156 |
+
<comment><![CDATA[default: .page .main .col-left]]></comment>
|
157 |
+
<frontend_type>text</frontend_type>
|
158 |
+
<sort_order>10</sort_order>
|
159 |
+
<show_in_default>1</show_in_default>
|
160 |
+
<show_in_website>1</show_in_website>
|
161 |
+
<show_in_store>0</show_in_store>
|
162 |
+
</selector>
|
163 |
+
<replace translate="label,comment">
|
164 |
+
<label>Replace selector</label>
|
165 |
+
<comment><![CDATA[default: .block-layered-nav]]></comment>
|
166 |
+
<frontend_type>text</frontend_type>
|
167 |
+
<sort_order>15</sort_order>
|
168 |
+
<show_in_default>1</show_in_default>
|
169 |
+
<show_in_website>1</show_in_website>
|
170 |
+
<show_in_store>0</show_in_store>
|
171 |
+
</replace>
|
172 |
+
</fields>
|
173 |
+
</blocklayer>
|
174 |
+
</groups>
|
175 |
+
</pscatalogajax>
|
176 |
+
</sections>
|
177 |
+
</config>
|
app/design/frontend/default/default/layout/ps_catalogajax.xml
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* @category PSystem
|
5 |
+
* @package PSystem_CatalogAjax
|
6 |
+
* @author Pascal System <info@pascalsystem.pl>
|
7 |
+
* @version 1.0.0
|
8 |
+
*/
|
9 |
+
-->
|
10 |
+
<layout version="0.1.0">
|
11 |
+
<default>
|
12 |
+
<reference name="head">
|
13 |
+
<action method="addCss"><stylesheet>css/pascalsystem/base.css</stylesheet></action>
|
14 |
+
<action method="addJs"><script>pascalsystem/base.js</script></action>
|
15 |
+
<action method="addJs"><script>pascalsystem/catalogajax.js</script></action>
|
16 |
+
|
17 |
+
<block type="pscatalogajax/config" name="catalogajaxconfig" />
|
18 |
+
</reference>
|
19 |
+
</default>
|
20 |
+
</layout>
|
app/etc/modules/PSystem_CatalogAjax.xml
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* @category PSystem
|
5 |
+
* @package PSystem_CatalogAjax
|
6 |
+
* @author Pascal System <info@pascalsystem.pl>
|
7 |
+
* @version 1.0.0
|
8 |
+
*/
|
9 |
+
-->
|
10 |
+
<config>
|
11 |
+
<modules>
|
12 |
+
<PSystem_CatalogAjax>
|
13 |
+
<active>true</active>
|
14 |
+
<codePool>community</codePool>
|
15 |
+
<depends>
|
16 |
+
<PSystem_Base/>
|
17 |
+
</depends>
|
18 |
+
</PSystem_CatalogAjax>
|
19 |
+
</modules>
|
20 |
+
</config>
|
js/pascalsystem/catalogajax.js
ADDED
@@ -0,0 +1,108 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
PS.catalogajax = {
|
2 |
+
init : function() {
|
3 |
+
PS.catalogajax._initElementsByType('paginator', 'content');
|
4 |
+
PS.catalogajax._initElementsByType('mode', 'content');
|
5 |
+
PS.catalogajax._initElementsByType('limiter', 'content');
|
6 |
+
PS.catalogajax._initElementsByType('sortby', 'content');
|
7 |
+
PS.catalogajax._initElementsByType('sortdir', 'content');
|
8 |
+
PS.catalogajax._initElementsLayerNav(PS.catalogajax.config.navfilter);
|
9 |
+
PS.catalogajax._initElementsLayerNav(PS.catalogajax.config.navclear);
|
10 |
+
PS.catalogajax._initElementsLayerNav(PS.catalogajax.config.navremove);
|
11 |
+
},
|
12 |
+
loadData : function() {
|
13 |
+
var url = this.getAttribute('href');
|
14 |
+
PS.catalogajax.beforeLoad(PS.catalogajax.config.blocks.content.selector+((typeof PS.catalogajax.config.blocks.content.replace == 'undefined')?'':' '+PS.catalogajax.config.blocks.content.replace));
|
15 |
+
PS.ajax.call(url,this._catalogajax);
|
16 |
+
return false;
|
17 |
+
},
|
18 |
+
loadDataBySelect : function(selectElement, url) {
|
19 |
+
if (!url) return false;
|
20 |
+
PS.catalogajax.beforeLoad(PS.catalogajax.config.blocks.content.selector+((typeof PS.catalogajax.config.blocks.content.replace == 'undefined')?'':' '+PS.catalogajax.config.blocks.content.replace));
|
21 |
+
PS.ajax.call(url,selectElement._catalogajax);
|
22 |
+
return false;
|
23 |
+
},
|
24 |
+
loadLayerData : function() {
|
25 |
+
var url = this.getAttribute('href');
|
26 |
+
PS.catalogajax.beforeLoad(PS.catalogajax.config.blocks.content.selector+((typeof PS.catalogajax.config.blocks.content.replace == 'undefined')?'':' '+PS.catalogajax.config.blocks.content.replace));
|
27 |
+
PS.catalogajax.beforeLoad(PS.catalogajax.config.blocks.layer.selector+((typeof PS.catalogajax.config.blocks.layer.replace == 'undefined')?'':' '+PS.catalogajax.config.blocks.layer.replace));
|
28 |
+
PS.ajax.call(url,this._catalogajax);
|
29 |
+
return false;
|
30 |
+
},
|
31 |
+
beforeLoad : function(selector) {
|
32 |
+
PS.eachFunc(selector, PS.overlayElement);
|
33 |
+
},
|
34 |
+
_initElementsLayerNav : function(selector) {
|
35 |
+
if (typeof selector != 'string') {
|
36 |
+
if (typeof selector.length == 'undefined') {
|
37 |
+
throw 'bad selector';
|
38 |
+
}
|
39 |
+
for (var j=0;j<selector.length;j++) {
|
40 |
+
PS.catalogajax._initElementsLayerNav(selector[j]);
|
41 |
+
}
|
42 |
+
return;
|
43 |
+
}
|
44 |
+
var els = $$(selector);
|
45 |
+
for (var i=0;i<els.length;i++) {
|
46 |
+
if (typeof els[i]._catalogajax != 'undefined')
|
47 |
+
continue;
|
48 |
+
els[i]._catalogajax = {};
|
49 |
+
els[i]._catalogajax[PS.catalogajax.config.blocks.content.name] = PS.catalogajax.config.blocks.content.selector+((typeof PS.catalogajax.config.blocks.content.replace == 'undefined')?'':'|'+PS.catalogajax.config.blocks.content.replace);
|
50 |
+
els[i]._catalogajax[PS.catalogajax.config.blocks.layer.name] = PS.catalogajax.config.blocks.layer.selector+((typeof PS.catalogajax.config.blocks.layer.replace == 'undefined')?'':'|'+PS.catalogajax.config.blocks.layer.replace);
|
51 |
+
els[i].onclick = PS.catalogajax.loadLayerData;
|
52 |
+
}
|
53 |
+
},
|
54 |
+
_initElementsByType : function(type, block) {
|
55 |
+
var selector = PS.catalogajax.config[type];
|
56 |
+
if (typeof selector != 'string') {
|
57 |
+
if (typeof selector.length == 'undefined') {
|
58 |
+
throw 'bad param config for: `'+type+'`';
|
59 |
+
}
|
60 |
+
for (var j=0;j<selector.length;j++) {
|
61 |
+
PS.catalogajax._initElementsBySelector(selector[j], block);
|
62 |
+
}
|
63 |
+
return;
|
64 |
+
}
|
65 |
+
PS.catalogajax._initElementsBySelector(selector, block);
|
66 |
+
},
|
67 |
+
_initElementsBySelector : function(selector, block) {
|
68 |
+
var isSelect = (PS.substr(selector,selector.length-6,6)=='select')?true:false;
|
69 |
+
var els = $$(selector);
|
70 |
+
var attVal;
|
71 |
+
for (var i=0;i<els.length;i++) {
|
72 |
+
if (typeof els[i]._catalogajax != 'undefined')
|
73 |
+
continue;
|
74 |
+
els[i]._catalogajax = {};
|
75 |
+
els[i]._catalogajax[PS.catalogajax.config.blocks.content.name] = PS.catalogajax.config.blocks.content.selector+((typeof PS.catalogajax.config.blocks.content.replace == 'undefined')?'':'|'+PS.catalogajax.config.blocks.content.replace);
|
76 |
+
if (isSelect) {
|
77 |
+
els[i].onchange = function(){
|
78 |
+
PS.catalogajax.loadDataBySelect(this, this.value);
|
79 |
+
}
|
80 |
+
} else {
|
81 |
+
els[i].onclick = PS.catalogajax.loadData;
|
82 |
+
}
|
83 |
+
}
|
84 |
+
}
|
85 |
+
};
|
86 |
+
PS.onload(function(){PS.catalogajax.init()});
|
87 |
+
|
88 |
+
PS.catalogajax.config = {
|
89 |
+
'paginator' : '.toolbar .pager .pages a',
|
90 |
+
'limiter' : '.toolbar .pager .limiter select',
|
91 |
+
'mode' : '.toolbar .sorter .view-mode a',
|
92 |
+
'sortby' : '.toolbar .sorter .sort-by select',
|
93 |
+
'sortdir' : '.toolbar .sorter .sort-by a',
|
94 |
+
'navfilter' : '.block-layered-nav .block-content ol li a',
|
95 |
+
'navclear' : '.block-layered-nav .block-content .currently .actions a',
|
96 |
+
'navremove' : '.block-layered-nav .block-content .currently ol li a',
|
97 |
+
'blocks' : {
|
98 |
+
'content' : {
|
99 |
+
'name' : 'content',
|
100 |
+
'selector' : '.page .main .col-main'
|
101 |
+
},
|
102 |
+
'layer' : {
|
103 |
+
'name' : 'catalog.leftnav',
|
104 |
+
'selector' : '.page .main .col-left',
|
105 |
+
'replace' : '.block-layered-nav'
|
106 |
+
}
|
107 |
+
}
|
108 |
+
};
|
package.xml
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<package>
|
3 |
+
<name>PSystem_CatalogAjax</name>
|
4 |
+
<version>1.0.0</version>
|
5 |
+
<stability>stable</stability>
|
6 |
+
<license>OSL v3.0</license>
|
7 |
+
<channel>community</channel>
|
8 |
+
<extends/>
|
9 |
+
<summary>Thim module use ajax for catalog product list and layer navigation.</summary>
|
10 |
+
<description>This module load product list by ajax.You can use filter in left navigation, page limiter, page browser and switch list mode by ajax.You can define your own css selector for reloading content in Admin Panel.</description>
|
11 |
+
<notes>This module was tested in Magento Commerce version 1.4.0.1 and 1.5.0.1, and work in this version smoothly.</notes>
|
12 |
+
<authors><author><name>Pascal System</name><user>auto-converted</user><email>info@pascalsystem.pl</email></author></authors>
|
13 |
+
<date>2011-03-28</date>
|
14 |
+
<time>22:13:17</time>
|
15 |
+
<contents><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="ps_catalogajax.xml" hash="bda5effb4895e7e5f6cb5e2f24f5e224"/></dir></dir></dir></dir></target><target name="mage"><dir name="js"><dir name="pascalsystem"><file name="catalogajax.js" hash="a9da925bab5f68ad5c31026f709ba94c"/></dir></dir></target><target name="mageetc"><dir name="modules"><file name="PSystem_CatalogAjax.xml" hash="a1b27aa646ead7ae99289877041e6243"/></dir></target><target name="magecommunity"><dir name="PSystem"><dir name="CatalogAjax"><dir name="Block"><file name="Config.php" hash="4b038604f2bc5dc0911df30b43706c39"/></dir><dir name="etc"><file name="adminhtml.xml" hash="50be3a6a231b96a8984998ffd4acd036"/><file name="config.xml" hash="a21294fa5984f03de7d77ebf76b64a3a"/><file name="system.xml" hash="62aeb4c9f1826f964d23a4e8ced00e83"/></dir></dir></dir></target></contents>
|
16 |
+
<compatible/>
|
17 |
+
<dependencies><required><package><name>PSystem_Base</name><channel>community</channel><min></min><max></max></package></required></dependencies>
|
18 |
+
</package>
|