-
Notifications
You must be signed in to change notification settings - Fork 1
/
Suma minima de comanda OPencart 3
139 lines (138 loc) · 6.68 KB
/
Suma minima de comanda OPencart 3
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
137
138
139
<?xml version="1.0" encoding="UTF-8"?>
<modification>
<name>Suma minima de comanda BabyPlants</name>
<code>Suma minima de comanda BabyPlants</code>
<version>1.0.0</version>
<author>BabyPlants</author>
<link>https://babyplants.md</link>
<file path="admin/controller/setting/setting.php">
<operation error="skip">
<search><![CDATA[if (isset($this->error['voucher_min'])) {]]></search>
<add position="before"><![CDATA[
if (isset($this->error['order_amount_min'])) {
$data['error_order_amount_min'] = $this->error['order_amount_min'];
} else {
$data['error_order_amount_min'] = '';
}]]></add>
</operation>
<operation error="skip">
<search><![CDATA[if (isset($this->request->post['config_voucher_min'])) {]]></search>
<add position="before"><![CDATA[
if (isset($this->request->post['config_order_amount_min'])) {
$data['config_order_amount_min'] = $this->request->post['config_order_amount_min'];
} else {
$data['config_order_amount_min'] = $this->config->get('config_order_amount_min');
}]]></add>
</operation>
</file>
<file path="admin/language/ro-ro/setting/setting.php">
<operation error="skip">
<search regex="true"><![CDATA[~(\$_\[\'entry_voucher_min\'\])~]]></search>
<add position="replace"><![CDATA[
$_['entry_order_amount_min'] = 'Suma minimă a comenzii';
$_['entry_voucher_min']
]]></add>
</operation>
<operation error="skip">
<search regex="true"><![CDATA[~(\$_\[\'help_voucher_min\'\])~]]></search>
<add position="replace"><![CDATA[
$_['help_order_amount_min'] = 'Suma minimă a comenzii';
$_['help_voucher_min']
]]></add>
</operation>
<operation error="skip">
<search regex="true"><![CDATA[~(\$_\[\'error_voucher_min\'\])~]]></search>
<add position="replace"><![CDATA[
$_['error_order_amount_min'] = 'Suma minimă a comenzii!';
$_['error_voucher_min']
]]></add>
</operation>
</file>
<file path="admin/language/ru-ru/setting/setting.php">
<operation error="skip">
<search regex="true"><![CDATA[~(\$_\[\'entry_voucher_min\'\])~]]></search>
<add position="replace"><![CDATA[
$_['entry_order_amount_min'] = 'Минимальная сумма заказа';
$_['entry_voucher_min']
]]></add>
</operation>
<operation error="skip">
<search regex="true"><![CDATA[~(\$_\[\'help_voucher_min\'\])~]]></search>
<add position="replace"><![CDATA[
$_['help_order_amount_min'] = 'Минимальная сумма заказа';
$_['help_voucher_min']
]]></add>
</operation>
<operation error="skip">
<search regex="true"><![CDATA[~(\$_\[\'error_voucher_min\'\])~]]></search>
<add position="replace"><![CDATA[
$_['error_order_amount_min'] = 'Минимальная сумма заказа!';
$_['error_voucher_min']
]]></add>
</operation>
</file>
<file path="admin/view/template/setting/setting.twig">
<operation error="skip">
<search><![CDATA[<legend>{{ text_checkout }}</legend>]]></search>
<add position="after"><![CDATA[
<div class="form-group required">
<label class="col-sm-2 control-label" for="input-order-amount-min"><span data-toggle="tooltip" title="{{ help_order_amount_min }}">{{ entry_order_amount_min }}</span></label>
<div class="col-sm-10">
<input type="text" name="config_order_amount_min" value="{{ config_order_amount_min }}" placeholder="{{ entry_order_amount_min }}" id="input-order-amount-min" class="form-control" />
{% if error_order_amount_min %}
<div class="text-danger">{{ error_order_amount_min }}</div>
{% endif %}
</div>
</div>
]]></add>
</operation>
</file>
<file path="catalog/controller/checkout/cart.php">
<operation error="skip">
<search><![CDATA[if (!$this->cart->hasStock() && (!$this->config->get('config_stock_checkout') || $this->config->get('config_stock_warning'))) {]]></search>
<add position="replace"><![CDATA[
if (!$this->cart->checkOrderMinAmount()) {
$data['error_warning'] = sprintf($this->language->get('error_order_amount_min'), $this->currency->format($this->cart->getOrderMinAmount(), 'BYN'));
} elseif (!$this->cart->hasStock() && (!$this->config->get('config_stock_checkout') || $this->config->get('config_stock_warning'))) {
]]></add>
</operation>
</file>
<file path="catalog/controller/checkout/oct_fastorder.php">
<operation error="skip">
<search><![CDATA[$this->load->language('octemplates/oct_fastorder');]]></search>
<add position="before"><![CDATA[
if (!$this->cart->checkOrderMinAmount()) {
$this->response->redirect($this->url->link('checkout/cart'));
}
]]></add>
</operation>
</file>
<file path="catalog/language/ro-ro/checkout/cart.php">
<operation error="skip">
<search><![CDATA[// Error]]></search>
<add position="after"><![CDATA[
$_['error_order_amount_min'] = 'Atenție! Suma minimă a comenzii este de %s MDL';
]]></add>
</operation>
</file>
<file path="catalog/language/ru-ru/checkout/cart.php">
<operation error="skip">
<search><![CDATA[// Error]]></search>
<add position="after"><![CDATA[
$_['error_order_amount_min'] = 'Внимание! Минимальная сумма заказа составляет %s MDL';
]]></add>
</operation>
</file>
<file path="system/library/cart/cart.php">
<operation error="skip">
<search><![CDATA[public function hasDownload() {]]></search>
<add position="before"><![CDATA[
public function checkOrderMinAmount() {
return $this->getSubTotal() >= $this->config->get('config_order_amount_min');
}
public function getOrderMinAmount() {
return $this->config->get('config_order_amount_min');
}]]></add>
</operation>
</file>
</modification>