-
Notifications
You must be signed in to change notification settings - Fork 0
/
woocommerce-table-rate-shipping.php
78 lines (65 loc) · 2.49 KB
/
woocommerce-table-rate-shipping.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
<?php
/**
* Plugin Name: WooCommerce Table Rate Shipping
* Plugin URI: https://woocommerce.com/products/table-rate-shipping/
* Description: Table rate shipping lets you define rates depending on location vs shipping class, price, weight, or item count.
* Version: 3.3.1
* Author: WooCommerce
* Author URI: https://woocommerce.com/
* Text Domain: woocommerce-table-rate-shipping
* Copyright: © 2024 WooCommerce
* License: GNU General Public License v3.0
* License URI: http://www.gnu.org/licenses/gpl-3.0.html
* Domain Path: /languages
* Requires Plugins: woocommerce
* Tested up to: 6.6
* WC tested up to: 9.1
* WC requires at least: 8.9
*
* Woo: 18718:3034ed8aff427b0f635fe4c86bbf008a
*
* @package woocommerce-shipping-table-rate
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! defined( 'TABLE_RATE_SHIPPING_VERSION' ) ) {
define( 'TABLE_RATE_SHIPPING_VERSION', '3.3.1' ); // WRCS: DEFINED_VERSION.
}
if ( ! defined( 'TABLE_RATE_SHIPPING_DEBUG' ) ) {
define( 'TABLE_RATE_SHIPPING_DEBUG', defined( 'WP_DEBUG' ) && WP_DEBUG && ( ! defined( 'WP_DEBUG_DISPLAY' ) || WP_DEBUG_DISPLAY ) );
}
if ( ! defined( 'WC_TABLE_RATE_SHIPPING_MAIN_FILE' ) ) {
define( 'WC_TABLE_RATE_SHIPPING_MAIN_FILE', __FILE__ );
}
if ( ! defined( 'WC_TABLE_RATE_SHIPPING_MAIN_ABSPATH' ) ) {
define( 'WC_TABLE_RATE_SHIPPING_MAIN_ABSPATH', dirname( WC_TABLE_RATE_SHIPPING_MAIN_FILE ) . '/' );
}
if ( ! defined( 'WC_TABLE_RATE_SHIPPING_PLUGIN_DIR' ) ) {
define( 'WC_TABLE_RATE_SHIPPING_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
}
if ( ! defined( 'WC_TABLE_RATE_SHIPPING_PLUGIN_URL' ) ) {
define( 'WC_TABLE_RATE_SHIPPING_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
}
if ( ! defined( 'WC_TABLE_RATE_SHIPPING_DIST_DIR' ) ) {
define( 'WC_TABLE_RATE_SHIPPING_DIST_DIR', WC_TABLE_RATE_SHIPPING_PLUGIN_DIR . 'dist/' );
}
if ( ! defined( 'WC_TABLE_RATE_SHIPPING_DIST_URL' ) ) {
define( 'WC_TABLE_RATE_SHIPPING_DIST_URL', WC_TABLE_RATE_SHIPPING_PLUGIN_URL . 'dist/' );
}
// Require the main Shipping Per Product class.
if ( ! class_exists( 'WC_Table_Rate_Shipping' ) ) {
require_once dirname( WC_TABLE_RATE_SHIPPING_MAIN_FILE ) . '/includes/class-wc-table-rate-shipping.php';
}
new WC_Table_Rate_Shipping();
/**
* Callback function for loading an instance of this method.
*
* @todo: it seems this function is not used anywhere
*
* @param mixed $instance Table Rate instance.
* @return WC_Shipping_Table_Rate
*/
function woocommerce_get_shipping_method_table_rate( $instance = false ) {
return new WC_Shipping_Table_Rate( $instance );
}