-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstaller.php
47 lines (39 loc) · 1.12 KB
/
installer.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
<?php
/**
* Installer.
*
* @package WooCommerce_Table_Rate_Shipping
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
global $wpdb;
$wpdb->hide_errors();
$collate = '';
if ( $wpdb->has_cap( 'collation' ) ) {
$collate = $wpdb->get_charset_collate();
}
require_once ABSPATH . 'wp-admin/includes/upgrade.php';
// Table for storing table rates themselves. shipping_method_id is an individual table of rates applied to a zone.
$sql = "
CREATE TABLE {$wpdb->prefix}woocommerce_shipping_table_rates (
rate_id bigint(20) NOT NULL auto_increment,
rate_class varchar(200) NOT NULL,
rate_condition varchar(200) NOT NULL,
rate_min varchar(200) NOT NULL,
rate_max varchar(200) NOT NULL,
rate_cost varchar(200) NOT NULL,
rate_cost_per_item varchar(200) NOT NULL,
rate_cost_per_weight_unit varchar(200) NOT NULL,
rate_cost_percent varchar(200) NOT NULL,
rate_label longtext NULL,
rate_priority int(1) NOT NULL,
rate_order bigint(20) NOT NULL,
shipping_method_id bigint(20) NOT NULL,
rate_abort int(1) NOT NULL,
rate_abort_reason longtext NULL,
PRIMARY KEY (rate_id)
) $collate;
";
dbDelta( $sql );
update_option( 'hide_table_rate_welcome_notice', '' );