-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathShip_Depot_init.php
133 lines (101 loc) · 3.28 KB
/
Ship_Depot_init.php
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
<?php
/**
* Plugin Name: Ship Depot
* Plugin URI: https://shipdepot.vn/
* Description: Ship Depot support shipping couriers in Vietnam like GHN, GHTK, AhaMove.
* Version: 1.2.15
* Author: ShipDepot.vn
* Text Domain: ship-depot-translate
* Domain Path: /languages
* Requires at least: 6.1.1
* Requires PHP: 7.4.3
*/
// If this file is called directly, abort.
if (!defined('WPINC')) {
die;
}
if (!defined('SHIP_DEPOT_PLUGIN_FILE')) {
define('SHIP_DEPOT_PLUGIN_FILE', __FILE__);
}
if (!defined('SHIP_DEPOT_DIR_URL')) {
define('SHIP_DEPOT_DIR_URL', plugin_dir_url(__FILE__));
}
if (!defined('SHIP_DEPOT_DIR_PATH')) {
define('SHIP_DEPOT_DIR_PATH', plugin_dir_path(__FILE__));
}
if (!defined('SHIP_DEPOT_LOCALE')) {
define('SHIP_DEPOT_LOCALE', 'vi-VN');
}
if (!defined('SHIP_DEPOT_VERSION')) {
define('SHIP_DEPOT_VERSION', '1.2.15');
}
if (!defined('SHIP_DEPOT_WEIGHT_UNIT')) {
define('SHIP_DEPOT_WEIGHT_UNIT', 'gram');
}
if (!defined('SHIP_DEPOT_MEASUREMENT_UNIT')) {
define('SHIP_DEPOT_MEASUREMENT_UNIT', 'cm');
}
if (!defined('SHIP_DEPOT_HOST_API')) {
define('SHIP_DEPOT_HOST_API', 'https://admin.shipdepot.co/api');
}
if (!defined('SHIP_DEPOT_SITE')) {
define('SHIP_DEPOT_SITE', 'https://shipdepot.vn');
}
if (!defined('SHIP_DEPOT_SHIPPING_METHOD')) {
define('SHIP_DEPOT_SHIPPING_METHOD', 'sd_shipdepot_shipping_method');
}
if (!defined('SD_SELECT_CITY_TEXT')) {
define('SD_SELECT_CITY_TEXT', __('Chọn tỉnh/thành phố', 'ship-depot-translate'));
}
if (!defined('SD_SELECT_DISTRICT_TEXT')) {
define('SD_SELECT_DISTRICT_TEXT', __('Chọn quận/huyện', 'ship-depot-translate'));
}
if (!defined('SD_SELECT_WARD_TEXT')) {
define('SD_SELECT_WARD_TEXT', __('Chọn phường/xã', 'ship-depot-translate'));
}
if (!defined('SD_DELIVERING_STATUS')) {
define('SD_DELIVERING_STATUS', 'delivering');
}
if (!defined('SD_DELI_SUCCESS_STATUS')) {
define('SD_DELI_SUCCESS_STATUS', 'delivered');
}
if (!defined('SD_FOR_CONTROL_STATUS')) {
define('SD_FOR_CONTROL_STATUS', 'for_control');
}
if (!defined('SD_DELI_FAIL_STATUS')) {
define('SD_DELI_FAIL_STATUS', 'delivery_fail');
}
if (!defined('SD_CANCEL_STATUS')) {
define('SD_CANCEL_STATUS', 'cancel');
}
if (!defined('GHTK_COURIER_CODE')) {
define('GHTK_COURIER_CODE', 'GHTK');
}
if (!defined('GHN_COURIER_CODE')) {
define('GHN_COURIER_CODE', 'GHN');
}
if (!defined('AHA_COURIER_CODE')) {
define('AHA_COURIER_CODE', 'AHA');
}
if (!defined('GHTK_PROVINCE_SPECIAL')) {
//Lâm Đồng(209) và Kiên Giang(219)
define('GHTK_PROVINCE_SPECIAL', '209,219');
}
if (!defined('BIG_CITY_CODE')) {
define('BIG_CITY_CODE', '201,202');
}
include_once(ABSPATH . 'wp-admin/includes/plugin.php');
if (!class_exists('Ship_Depot', false)) {
include_once dirname(__FILE__) . '/includes/class-ship-depot-general.php';
}
if (!function_exists('Ship_Depot_init')) {
function Ship_Depot_init()
{
return Ship_Depot::instance();
}
function ship_depot_plugins_loaded()
{
$GLOBALS['sd'] = Ship_Depot_init();
}
add_action('plugins_loaded', 'ship_depot_plugins_loaded');
}