Changeset 2569476
- Timestamp:
- 07/21/2021 06:50:27 PM (5 years ago)
- Location:
- mulutu
- Files:
-
- 41 added
- 7 edited
-
tags/1.1.0 (added)
-
tags/1.1.0/GHNStatus.php (added)
-
tags/1.1.0/MulutuGHNShippingMethod.php (added)
-
tags/1.1.0/MulutuSettings.php (added)
-
tags/1.1.0/MulutuWC.php (added)
-
tags/1.1.0/MulutuWCAdmin.php (added)
-
tags/1.1.0/MulutuWCFront.php (added)
-
tags/1.1.0/apis.php (added)
-
tags/1.1.0/const.php (added)
-
tags/1.1.0/css (added)
-
tags/1.1.0/css/checkout.css (added)
-
tags/1.1.0/css/jquery.modal.min.css (added)
-
tags/1.1.0/css/loader.css (added)
-
tags/1.1.0/css/order.css (added)
-
tags/1.1.0/css/select2.min.css (added)
-
tags/1.1.0/css/settings.css (added)
-
tags/1.1.0/helpers.php (added)
-
tags/1.1.0/init.php (added)
-
tags/1.1.0/js (added)
-
tags/1.1.0/js/checkout.js (added)
-
tags/1.1.0/js/jquery.modal.min.js (added)
-
tags/1.1.0/js/order.js (added)
-
tags/1.1.0/js/select2.min.js (added)
-
tags/1.1.0/js/settings.js (added)
-
tags/1.1.0/plugin.php (added)
-
tags/1.1.0/readme.md (added)
-
tags/1.1.0/readme.txt (added)
-
tags/1.1.0/views (added)
-
tags/1.1.0/views/meta_box_order.php (added)
-
tags/1.1.0/views/settings (added)
-
tags/1.1.0/views/settings/admin_page.php (added)
-
tags/1.1.0/views/settings/env.php (added)
-
tags/1.1.0/views/settings/facebook_help.php (added)
-
tags/1.1.0/views/settings/payment_type.php (added)
-
tags/1.1.0/views/settings/shipping_brand.php (added)
-
tags/1.1.0/views/settings/shipping_default_dimension.php (added)
-
tags/1.1.0/views/settings/shipping_default_weight.php (added)
-
tags/1.1.0/views/settings/shipping_fee.php (added)
-
tags/1.1.0/views/settings/shipping_ghn.php (added)
-
tags/1.1.0/views/settings/shipping_include_cod.php (added)
-
tags/1.1.0/views/settings/shops.php (added)
-
trunk/MulutuSettings.php (modified) (6 diffs)
-
trunk/apis.php (modified) (1 diff)
-
trunk/js/settings.js (modified) (2 diffs)
-
trunk/readme.md (modified) (1 diff)
-
trunk/readme.txt (modified) (1 diff)
-
trunk/views/settings/admin_page.php (modified) (1 diff)
-
trunk/views/settings/shipping_ghn.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
mulutu/trunk/MulutuSettings.php
r2543097 r2569476 171 171 'mulutu_setting_section' // section 172 172 ); 173 174 add_settings_field( 175 'include_cod_flg', // id 176 'Thu hộ COD ', // title 177 array($this, 'shippingIncludeCODCallback'), // callback 178 MulutuSettings::$ADMIN_PAGE_SLUG, // page 179 'mulutu_setting_section' // section 180 ); 173 181 } 174 182 … … 180 188 'shipping_brand', 181 189 'ghn_token', 190 'ghn_registered_phone', 182 191 'ghn_shop_id', 183 192 'ghn_shop_name', … … 194 203 $sanitaryValues[$key] = sanitize_text_field($input[$key]); 195 204 } 205 } 206 207 if (empty($sanitaryValues['ghn_token'])) { 208 add_settings_error('token', '400', 'Token không hợp lệ'); 209 return false; 210 } 211 212 if (empty($sanitaryValues['ghn_registered_phone']) || !preg_match('/^\d{9,12}$/', $sanitaryValues['ghn_registered_phone'])) { 213 add_settings_error('ghn_registered_phone', '400', 'Số điện thoại không hợp lệ'); 214 return false; 196 215 } 197 216 … … 245 264 } 246 265 266 $sanitaryValues['include_cod_flg'] = 0; 267 if (isset($input['include_cod_flg'])) { 268 if(sanitize_text_field($input['include_cod_flg']) == 1) { 269 $sanitaryValues['include_cod_flg'] = 1; 270 } 271 } 272 247 273 if ($this->mulutuOptions == '') { 248 274 $this->mulutuOptions = array(); … … 275 301 'selectedShippingBrand' => $shippingBrand, 276 302 'shippingGHNSetting' => mulutuRenderView('settings/shipping_ghn', array( 277 'title' => 'GHN', 278 'value' => 'ghn', 279 'ghn_token' => !empty($this->mulutuOptions['ghn_token']) ? $this->mulutuOptions['ghn_token'] : null 303 'title' => 'GHN', 304 'value' => 'ghn', 305 'ghn_token' => !empty($this->mulutuOptions['ghn_token']) ? $this->mulutuOptions['ghn_token'] : null, 306 'ghn_registered_phone' => !empty($this->mulutuOptions['ghn_registered_phone']) ? $this->mulutuOptions['ghn_registered_phone'] : null 280 307 )) 281 308 )); … … 321 348 )); 322 349 } 350 351 public function shippingIncludeCODCallback() { 352 echo mulutuRenderView('settings/shipping_include_cod', array( 353 'include_cod_flg' => !empty($this->mulutuOptions['include_cod_flg']) ? $this->mulutuOptions['include_cod_flg'] : 0 354 )); 355 } 323 356 } 324 357 } -
mulutu/trunk/apis.php
r2543097 r2569476 416 416 ); 417 417 418 if ($mulutuOptions['include_cod_flg'] == 0) { 419 $query['cod'] = 0; 420 } 421 418 422 if($shippingServiceId == 'freeship_by_amount_over_value') { 419 423 $query['pm_t'] = 1; -
mulutu/trunk/js/settings.js
r2506157 r2569476 293 293 if (!!needUpdateAffiliate) { 294 294 updateShopWebhookMapping(); 295 getOTPPromise($('# mulutu_options_ghn_shop_phone').val()).done(function(otpResponse) {295 getOTPPromise($('#ghn_registered_phone').val()).done(function(otpResponse) { 296 296 $('#countdown').countDown(10 * 60); 297 297 $('#otp-modal').loading(false); … … 327 327 $('.btn-submit-shop').on('click', function(e) { 328 328 e.preventDefault(); 329 getOTPPromise($('# view_ghn_shoptel').val()).done(function(otpResponse) {329 getOTPPromise($('#ghn_registered_phone').val()).done(function(otpResponse) { 330 330 $('#countdown').countDown(10 * 60); 331 331 $('#otp-modal').loading(false); -
mulutu/trunk/readme.md
r2558235 r2569476 33 33 34 34 ### Changelog 35 * 1.0.2 * 35 1.1.0 36 * Fix bug 37 * Add GHN registered phone number 38 1.0.2 36 39 * Fix bug 37 40 * Add leadtime -
mulutu/trunk/readme.txt
r2558235 r2569476 39 39 40 40 == Changelog == 41 = 1.1.0 = 42 * Fix bug 43 * Add GHN register phone number 41 44 = 1.0.2 = 42 45 * Fix bug -
mulutu/trunk/views/settings/admin_page.php
r2543097 r2569476 4 4 } 5 5 .hint-block { 6 border-left: 5px solid # 48922b;6 border-left: 5px solid #1f93d8; 7 7 padding-left: 5px; 8 8 font-size: small; -
mulutu/trunk/views/settings/shipping_ghn.php
r2506157 r2569476 10 10 <input class="regular-text" type="text" name="mulutu_options[ghn_token]" id="ghn_token" value="<?php echo $ghn_token; ?>"> 11 11 </div> 12 <div class="form-control"> 13 <label for="ghn_registered_phone" class="input-required">Số điện thoại</label> 14 <input class="regular-text" maxlength="20" type="text" name="mulutu_options[ghn_registered_phone]" id="ghn_registered_phone" value="<?php echo $ghn_registered_phone; ?>"> 15 </div> 12 16 </div> 13 17 <div class="hint">
Note: See TracChangeset
for help on using the changeset viewer.