質問編集履歴

2

関数の追加

2016/11/16 09:17

投稿

margin
margin

スコア16

test CHANGED
File without changes
test CHANGED
@@ -81,3 +81,139 @@
81
81
 
82
82
 
83
83
  何かご存知の方がいれば、ファイル名か関数名など教えて頂きたいと思います。ご教授お願いします。
84
+
85
+
86
+
87
+ 追加 下記の関数が入力チェックをしている?
88
+
89
+ ```ここに言語を入力
90
+
91
+ function delivery_check() {
92
+
93
+ $mes = '';
94
+
95
+ if ( isset($_POST['delivery']['delivery_flag']) && $_POST['delivery']['delivery_flag'] == 1 ) {
96
+
97
+ if ( WCUtils::is_blank($_POST["delivery"]["name1"]) )
98
+
99
+ $mes .= __('Name is not correct', 'usces') . "<br />";
100
+
101
+ // if ( trim($_POST["delivery"]["name3"]) == "" && USCES_JP )
102
+
103
+ // $mes .= __('Invalid CANNAT pretend.', 'usces') . "<br />";
104
+
105
+ if ( WCUtils::is_blank($_POST["delivery"]["zipcode"]) )
106
+
107
+ $mes .= __('postal code is not correct', 'usces') . "<br />";
108
+
109
+ if ( $_POST["delivery"]["pref"] == __('-- Select --', 'usces') || $_POST["delivery"]["pref"] == '-- Select --' )
110
+
111
+ $mes .= __('enter the prefecture', 'usces') . "<br />";
112
+
113
+ if ( WCUtils::is_blank($_POST["delivery"]["address1"]) )
114
+
115
+ $mes .= __('enter the city name', 'usces') . "<br />";
116
+
117
+ if ( WCUtils::is_blank($_POST["delivery"]["address2"]) )
118
+
119
+ $mes .= __('enter house numbers', 'usces') . "<br />";
120
+
121
+ if ( WCUtils::is_blank($_POST["delivery"]["tel"]) )
122
+
123
+ $mes .= __('enter phone numbers', 'usces') . "<br />";
124
+
125
+ }
126
+
127
+ if ( !isset($_POST['offer']['delivery_method']) || (empty($_POST['offer']['delivery_method']) && !WCUtils::is_zero($_POST['offer']['delivery_method'])) ) {
128
+
129
+ $mes .= __('chose one from delivery method.', 'usces') . "<br />";
130
+
131
+ } else {
132
+
133
+ $d_method_index = $this->get_delivery_method_index((int)$_POST['offer']['delivery_method']);
134
+
135
+ $country = $_SESSION['usces_entry']["delivery"]["country"];
136
+
137
+ $local_country = usces_get_base_country();
138
+
139
+ if($country == $local_country) {
140
+
141
+ if($this->options['delivery_method'][$d_method_index]['intl'] == 1) {
142
+
143
+ $mes .= __('Delivery method is incorrect. Can not specify an international flight.', 'usces') . "<br />";
144
+
145
+ }
146
+
147
+ } else {
148
+
149
+ if( WCUtils::is_zero($this->options['delivery_method'][$d_method_index]['intl']) ) {
150
+
151
+ $mes .= __('Delivery method is incorrect. Specify the international flights.', 'usces') . "<br />";
152
+
153
+ }
154
+
155
+ }
156
+
157
+ }
158
+
159
+ if ( !isset($_POST['offer']['payment_name']) ){
160
+
161
+ $mes .= __('chose one from payment options.', 'usces') . "<br />";
162
+
163
+ }else{
164
+
165
+ $payments = $this->getPayments($_POST['offer']['payment_name']);
166
+
167
+ if('COD' == $payments['settlement']){
168
+
169
+ $total_items_price = $this->get_total_price();
170
+
171
+ $usces_entries = $this->cart->get_entry();
172
+
173
+ $materials = array(
174
+
175
+ 'total_items_price' => $usces_entries['order']['total_items_price'],
176
+
177
+ 'discount' => $usces_entries['order']['discount'],
178
+
179
+ 'shipping_charge' => $usces_entries['order']['shipping_charge'],
180
+
181
+ 'cod_fee' => $usces_entries['order']['cod_fee'],
182
+
183
+ 'use_point' => ( isset($usces_entries['order']['use_point']) ) ? $usces_entries['order']['use_point'] : 0,
184
+
185
+ );
186
+
187
+ $tax = $this->getTax( $total_items_price, $materials );
188
+
189
+ $total_items_price = $total_items_price + $tax;
190
+
191
+ $cod_limit_amount = ( isset($this->options['cod_limit_amount']) && 0 < (int)$this->options['cod_limit_amount'] ) ? $this->options['cod_limit_amount'] : 0;
192
+
193
+ if( 0 < $cod_limit_amount && $total_items_price > $cod_limit_amount )
194
+
195
+ $mes .= sprintf(__('A total products amount of money surpasses the upper limit(%s) that I can purchase in C.O.D.', 'usces'), usces_crform($this->options['cod_limit_amount'], true, false, 'return')) . "<br />";
196
+
197
+ }
198
+
199
+ }
200
+
201
+ if( isset($d_method_index) && isset($payments) ) {
202
+
203
+ if($this->options['delivery_method'][$d_method_index]['nocod'] == 1) {
204
+
205
+ if('COD' == $payments['settlement'])
206
+
207
+ $mes .= __('COD is not available.', 'usces') . "<br />";
208
+
209
+ }
210
+
211
+ }
212
+
213
+ $mes = apply_filters('usces_filter_delivery_check', $mes);
214
+
215
+ return $mes;
216
+
217
+ }
218
+
219
+ ```

1

開発フォーラムのリンクを挿入

2016/11/16 09:17

投稿

margin
margin

スコア16

test CHANGED
File without changes
test CHANGED
@@ -2,7 +2,9 @@
2
2
 
3
3
 
4
4
 
5
- ここで聞くのは場違いかもしれませんが、知恵を貸してほしく思います。開発フォーラムには質問済みです。
5
+ ここで聞くのは場違いかもしれませんが、知恵を貸してほしく思います。開発フォーラムには質問済みです。下記が質問内容です。
6
+
7
+ [リンク内容](https://www.welcart.com/community/forums/topic/%E5%88%A5%E3%81%AE%E7%99%BA%E9%80%81%E5%85%88%E3%81%AE%E6%8C%87%E5%AE%9A%E3%81%AB%E3%81%A4%E3%81%84%E3%81%A6?loggedout=true)
6
8
 
7
9
 
8
10