Skip to content
Snippets Groups Projects
Commit 5ca65b4d authored by Reinhold Kainhofer's avatar Reinhold Kainhofer
Browse files

Fix warnings for WC 3.0

Work on issue #12
parent f0d82bb6
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
......@@ -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);
......
......@@ -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']:'',
......
......@@ -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' ) );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment