-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathvqmod_ocu_news_seo_pro_support.xml
executable file
·112 lines (103 loc) · 3.89 KB
/
vqmod_ocu_news_seo_pro_support.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
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
101
102
103
104
105
106
107
108
109
110
111
112
<modification>
<id>OCU News SEO PRO Support</id>
<version>1.5</version>
<vqmver>0.1</vqmver>
<author>OpenCart Ukrainian Community (www.opncart.ua) by Eugene Kuligin</author>
<file name="catalog/controller/common/seo_pro.php">
<operation>
<search position="before">
<![CDATA[
if ($url[0] == 'category_id') {
]]>
</search>
<add>
<![CDATA[
if ($url[0] == 'news_id') {
$this->request->get['news_id'] = $url[1];
}
if ($url[0] == 'news_category_id') {
if (!isset($this->request->get['npath'])) {
$this->request->get['npath'] = $url[1];
} else {
$this->request->get['npath'] .= '_' . $url[1];
}
}
]]>
</add>
</operation>
<operation>
<search position="before">
<![CDATA[
case 'path':
]]>
</search>
<add>
<![CDATA[
case 'npath':
$categories = explode('_', $value);
foreach ($categories as $category) {
$queries[] = 'news_category_id=' . $category;
}
unset($data[$key]);
break;
case 'news_id':
$queries[] = $key . '=' . $value;
unset($data[$key]);
$postfix = 1;
break;
]]>
</add>
</operation>
<operation>
<search position="before">
<![CDATA[
} elseif (isset($this->request->get['path'])) {
]]>
</search>
<add>
<![CDATA[
}elseif (isset($this->request->get['npath'])) {
if (isset($this->request->get['news_id'])) {
$this->request->get['route'] = 'news/news';
} else {
$this->request->get['route'] = 'news/category';
}
}elseif (isset($this->request->get['news_id'])) {
$this->request->get['route'] = 'news/news';
]]>
</add>
</operation>
<operation>
<search position="replace">
<![CDATA[
return $seo_url;
]]>
</search>
<add>
<![CDATA[
parse_str($component['query'], $data_2);
$get_params = '';
if (count($data_2)) {
$i = 0;
foreach ($data_2 as $key => $value) {
if (!in_array($key, array('route',
'product_id',
'manufacturer_id',
'category_id',
'information_id',
'path',
'npath',
'news_category_id',
'news_id',
))){
$get_params .= ($i==0?'?':'&') . $key . '=' . $value;
$i++;
}
}
}
return $seo_url . $get_params;
]]>
</add>
</operation>
</file>
</modification>