diff --git a/includes/admin/html/html-shipping-methods.php b/includes/admin/html/html-shipping-methods.php index 357d84ad190f495dd0f91ed601240100572f5023..cb045126e4ac7edd5f9811f67a3bd837334e195c 100644 --- a/includes/admin/html/html-shipping-methods.php +++ b/includes/admin/html/html-shipping-methods.php @@ -30,9 +30,10 @@ $methods = array(); $globalzone['shipping_methods'] = $globalshippingzone->get_shipping_methods(); $zones[] = $globalzone; foreach ($zones as $zone) { + $zoneid = isset($zone['zone_id'])?$zone['zone_id']:$zone['id']; ?> <tr> - <td class="name"><a href="<?php echo admin_url(sprintf('admin.php?page=wc-settings&tab=shipping&zone_id=%d', $zone['zone_id'] )); ?>"><?php echo $zone['zone_name']; ?> (<?php echo $zone['formatted_zone_location']; ?>)</a></td> + <td class="name"><a href="<?php echo admin_url(sprintf('admin.php?page=wc-settings&tab=shipping&zone_id=%d', $zoneid )); ?>"><?php echo $zone['zone_name']; ?> (<?php echo $zone['formatted_zone_location']; ?>)</a></td> <td class="methods wc-shipping-zone-methods "> <ul> <?php diff --git a/includes/rules_shipping_framework_woocommerce.php b/includes/rules_shipping_framework_woocommerce.php index 73833109b7e929170be3982d64d3066cff0df79e..ea13b4a97b8fc63c84118cce0ece08777a8aacd1 100644 --- a/includes/rules_shipping_framework_woocommerce.php +++ b/includes/rules_shipping_framework_woocommerce.php @@ -233,8 +233,10 @@ class RulesShippingFrameworkWooCommerce extends RulesShippingFramework { $vendornames = array(); foreach ($data['vendorids'] as $v) { $vnd = get_user_by('id', $v); // Get user name by user id - $vendornames[] = $vnd->display_name; - $vendors[] = $vnd->user_login; + if (is_object($vnd)) { + $vendornames[] = $vnd->display_name; + $vendors[] = $vnd->user_login; + } } $data['vendornames'] = array_unique($vendornames); $data['vendors'] = array_unique($vendors); diff --git a/legacy-includes/legacy-rules_shipping_framework_woocommerce.php b/legacy-includes/legacy-rules_shipping_framework_woocommerce.php index 74c755ce2d06200519813b1d8a6313a33c82ae08..86f03f085476571678fb375597c5ab09d163d6f9 100644 --- a/legacy-includes/legacy-rules_shipping_framework_woocommerce.php +++ b/legacy-includes/legacy-rules_shipping_framework_woocommerce.php @@ -32,7 +32,7 @@ class LegacyRulesShippingFrameworkWooCommerce extends RulesShippingFrameworkWooC } protected function parseMethodRules (&$method) { - $rulesets = Shipping_Rules_post_type::get_rulesets($method); + $rulesets = Legacy_Shipping_Rules_post_type::get_rulesets($method); foreach ($rulesets as $ruleset) { $this->parseMethodRule( /* Rules */ isset($ruleset['rules'])?$ruleset['rules']:'', diff --git a/woocommerce-shipping-by-rules.php b/woocommerce-shipping-by-rules.php index 99ab81febaf8918c01ad45f6a84319ece9d00561..0b79cf68cefb9d5e1502ef3840cd528685b53b6a 100644 --- a/woocommerce-shipping-by-rules.php +++ b/woocommerce-shipping-by-rules.php @@ -117,13 +117,6 @@ class WooCommerce_Shipping_By_Rules { } $this->helper = RulesShippingFrameworkWooCommerce::getHelper(); - // Shipping method post type definition: - // TODO: Legacy -// if (!class_exists("Shipping_Rules_post_type")) { -// // require_once plugin_dir_path( __FILE__ ) . 'includes/rules-shipping-post-type.php'; -// } -// $this->post_type = new Shipping_Rules_post_type($this->helper); - // Links to docs and config in the plugin page add_filter( 'plugin_row_meta', array( &$this, 'shippingbyrules_row_meta' ), 30, 2 ); add_filter( 'plugin_action_links_'.plugin_basename(__FILE__), array( &$this, 'shippingbyrules_add_settings_link' ) );