oct_products_modules.ocmod.xml
6.35 KB
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
<?xml version="1.0" encoding="utf-8"?>
<modification>
<code>oct_products_modules</code>
<name>Octemplates - Products Modules</name>
<version>1.0.0</version>
<author>Octemplates</author>
<link>http://octemplates.net/</link>
<file path="admin/controller/extension/module/{bestseller,featured,latest,special}.php">
<operation error="skip">
<search><![CDATA[if (isset($this->request->post['status'])) {]]></search>
<add position="before"><![CDATA[
if (isset($this->request->post['show_type'])) {
$data['show_type'] = $this->request->post['show_type'];
} elseif (!empty($module_info) && isset($module_info['show_type'])) {
$data['show_type'] = $module_info['show_type'];
} else {
$data['show_type'] = '';
}
]]></add>
</operation>
<operation error="skip">
<search><![CDATA[$data['limit'] = 5;]]></search>
<add position="replace"><![CDATA[
$data['limit'] = '10/6/6';
]]></add>
</operation>
</file>
<file path="admin/view/template/extension/module/{bestseller,featured,latest,special}.twig">
<operation error="skip">
<search><![CDATA[<label class="col-sm-2 control-label" for="input-status">{{ entry_status }}</label>]]></search>
<add position="before" offset="1"><![CDATA[
<div class="form-group">
<label class="col-sm-2 control-label" for="select-show_type">{{ entry_module_show_type }}</label>
<div class="col-sm-10">
<select id="select-show_type" name="show_type" class="form-control">
<option value="" {% if show_type == '' %}selected="selected"{% endif %}>{{ entry_module_show_type_deff}}</option>
<option value="width-100" {% if show_type == 'width-100' %}selected="selected"{% endif %}>{{ entry_module_show_type_100 }}</option>
<option value="width-50" {% if show_type == 'width-50' %}selected="selected"{% endif %}>{{ entry_module_show_type_50 }}</option>
<option value="width-infinity" {% if show_type == 'width-infinity' %}selected="selected"{% endif %}>{{ entry_module_show_type_infinity }}</option>
<option value="width-minimal" {% if show_type == 'width-minimal' %}selected="selected"{% endif %}>{{ entry_module_show_type_minimal }}</option>
</select>
</div>
</div>
]]></add>
</operation>
<operation error="skip">
<search><![CDATA[<input type="text" name="limit" value="{{ limit }}" placeholder="{{ entry_limit }}" id="input-limit" class="form-control" />]]></search>
<add position="replace"><![CDATA[
<input type="text" name="limit" value="{{ limit }}" placeholder="{{ help_recomend_limit }}" id="input-limit" class="form-control" />
<span style="font-size:11px;color:#ccc;">{{ help_recomend_limit }}</span>
]]></add>
</operation>
</file>
<file path="catalog/controller/extension/module/{bestseller,latest,featured,special}.php|catalog/controller/product/{category,product}.php">
<operation error="skip">
<search><![CDATA[public function index(]]></search>
<add position="after"><![CDATA[
if ($this->registry->has('oct_mobiledetect')) {
if ($this->oct_mobiledetect->isMobile() && !$this->oct_mobiledetect->isTablet()) {
$data['oct_isMobile'] = $this->oct_mobiledetect->isMobile();
}
if ($this->oct_mobiledetect->isTablet()) {
$data['oct_isTablet'] = $this->oct_mobiledetect->isTablet();
}
}
]]></add>
</operation>
</file>
<file path="catalog/controller/extension/module/{bestseller,latest,featured,special}.php">
<operation error="skip">
<search><![CDATA[public function index($setting) {]]></search>
<add position="after"><![CDATA[
static $module = 0;
]]></add>
</operation>
<operation error="skip">
<search><![CDATA[$data['products'] = array();]]></search>
<add position="before"><![CDATA[
$data['show_type'] = isset($setting['show_type']) ? $setting['show_type'] : '';
$limit = (isset($setting['limit']) && !empty($setting['limit'])) ? explode('/', $setting['limit']) : explode('/', '10/6/6');
if (count($limit) == 1) {
$limit = explode('/', '10/6/6');
}
if (isset($data['oct_isMobile'])) {
$setting['limit'] = (isset($limit[2]) && !empty($limit[2])) ? trim($limit[2]) : trim($setting['limit']);
} elseif (isset($data['oct_isTablet'])) {
$setting['limit'] = (isset($limit[1]) && !empty($limit[1])) ? trim($limit[1]) : trim($setting['limit']);
} else {
$setting['limit'] = (isset($limit[0]) && !empty($limit[0])) ? trim($limit[0]) : trim($setting['limit']);
}
]]></add>
</operation>
<operation error="skip">
<search><![CDATA[$rating,]]></search>
<add position="after"><![CDATA[
'reviews' => isset($product_info) ? $product_info['reviews'] : $result['reviews'],
'oct_model' => $this->config->get('theme_oct_deals_data_model') ? isset($product_info) ? $product_info['model'] : $result['model'] : '',
'quantity' => isset($product_info) ? ($product_info['quantity'] <= 0 ? true : false) : ($result['quantity'] <= 0 ? true : false),
'width' => $setting['width'],
'height' => $setting['height'],
'quantity_show' => true,
]]></add>
</operation>
<operation error="skip">
<search><![CDATA[return $this->load->view(]]></search>
<add position="before"><![CDATA[
$data['module_name'] = mb_strtolower(str_replace('ControllerExtensionModule', '', get_class($this)));
$data['module'] = $module++;
return $this->load->view('octemplates/module/oct_products_modules', $data);
]]></add>
</operation>
</file>
<file path="catalog/controller/product/product.php">
<operation error="skip">
<search><![CDATA[$rating,]]></search>
<add position="after"><![CDATA[
'reviews' => $result['reviews'],
'oct_model' => $this->config->get('theme_oct_deals_data_model') ? $result['model'] : '',
'quantity' => $result['quantity'] <= 0 ? true : false,
'width' => $this->config->get('theme_' . $this->config->get('config_theme') . '_image_related_width'),
'height' => $this->config->get('theme_' . $this->config->get('config_theme') . '_image_related_height'),
]]></add>
</operation>
<operation error="skip">
<search><![CDATA[$data['tags'] = array();]]></search>
<add position="before"><![CDATA[
$data['products'] = $this->load->controller('octemplates/module/oct_products_modules', $data);
]]></add>
</operation>
</file>
</modification>