Merge pull request #1004 from GeertDD/shipping
Made shipping classes a bit more DRY
This commit is contained in:
commit
f67e93291f
|
@ -19,8 +19,8 @@ class WC_Flat_Rate extends WC_Shipping_Method {
|
|||
$this->admin_page_heading = __('Flat Rates', 'woocommerce');
|
||||
$this->admin_page_description = __('Flat rates let you define a standard rate per item, or per order.', 'woocommerce');
|
||||
|
||||
add_action('woocommerce_update_options_shipping_flat_rate', array(&$this, 'process_admin_options'));
|
||||
add_action('woocommerce_update_options_shipping_flat_rate', array(&$this, 'process_flat_rates'));
|
||||
add_action('woocommerce_update_options_shipping_'.$this->id, array(&$this, 'process_admin_options'));
|
||||
add_action('woocommerce_update_options_shipping_'.$this->id, array(&$this, 'process_flat_rates'));
|
||||
|
||||
$this->init();
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@ class WC_Free_Shipping extends WC_Shipping_Method {
|
|||
$this->requires_coupon = $this->settings['requires_coupon'];
|
||||
|
||||
// Actions
|
||||
add_action('woocommerce_update_options_shipping_free_shipping', array(&$this, 'process_admin_options'));
|
||||
add_action('woocommerce_update_options_shipping_'.$this->id, array(&$this, 'process_admin_options'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -22,8 +22,8 @@ class WC_International_Delivery extends WC_Flat_Rate {
|
|||
$this->admin_page_heading = __('International Delivery', 'woocommerce');
|
||||
$this->admin_page_description = __('International delivery based on flat rate shipping.', 'woocommerce');
|
||||
|
||||
add_action('woocommerce_update_options_shipping_international_delivery', array(&$this, 'process_admin_options'));
|
||||
add_action('woocommerce_update_options_shipping_international_delivery', array(&$this, 'process_flat_rates'));
|
||||
add_action('woocommerce_update_options_shipping_'.$this->id, array(&$this, 'process_admin_options'));
|
||||
add_action('woocommerce_update_options_shipping_'.$this->id, array(&$this, 'process_flat_rates'));
|
||||
|
||||
$this->init();
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@ class WC_Local_Delivery extends WC_Shipping_Method {
|
|||
$this->availability = empty( $this->settings['availability'] ) ? '' : $this->settings['availability'];
|
||||
$this->countries = empty( $this->settings['countries'] ) ? '' : $this->settings['countries'];
|
||||
|
||||
add_action('woocommerce_update_options_shipping_local_delivery', array(&$this, 'process_admin_options'));
|
||||
add_action('woocommerce_update_options_shipping_'.$this->id, array(&$this, 'process_admin_options'));
|
||||
}
|
||||
|
||||
function calculate_shipping( $package = array() ) {
|
||||
|
|
|
@ -31,7 +31,7 @@ class WC_Local_Pickup extends WC_Shipping_Method {
|
|||
$this->availability = $this->settings['availability'];
|
||||
$this->countries = $this->settings['countries'];
|
||||
|
||||
add_action('woocommerce_update_options_shipping_local_pickup', array(&$this, 'process_admin_options'));
|
||||
add_action('woocommerce_update_options_shipping_'.$this->id, array(&$this, 'process_admin_options'));
|
||||
}
|
||||
|
||||
function calculate_shipping() {
|
||||
|
|
Loading…
Reference in New Issue