| @@ 59-75 (lines=17) @@ | ||
| 56 | /** |
|
| 57 | * init function. |
|
| 58 | */ |
|
| 59 | public function init() { |
|
| 60 | ||
| 61 | // Load the settings. |
|
| 62 | $this->init_form_fields(); |
|
| 63 | $this->init_settings(); |
|
| 64 | ||
| 65 | // Define user set variables |
|
| 66 | $this->enabled = $this->get_option( 'enabled' ); |
|
| 67 | $this->title = $this->get_option( 'title' ); |
|
| 68 | $this->min_amount = $this->get_option( 'min_amount', 0 ); |
|
| 69 | $this->availability = $this->get_option( 'availability' ); |
|
| 70 | $this->countries = $this->get_option( 'countries' ); |
|
| 71 | $this->requires = $this->get_option( 'requires' ); |
|
| 72 | ||
| 73 | // Actions |
|
| 74 | add_action( 'woocommerce_update_options_shipping_' . $this->id, array( $this, 'process_admin_options' ) ); |
|
| 75 | } |
|
| 76 | ||
| 77 | /** |
|
| 78 | * Initialise Gateway Settings Form Fields. |
|
| @@ 53-69 (lines=17) @@ | ||
| 50 | /** |
|
| 51 | * init function. |
|
| 52 | */ |
|
| 53 | public function init() { |
|
| 54 | ||
| 55 | // Load the settings. |
|
| 56 | $this->init_form_fields(); |
|
| 57 | $this->init_settings(); |
|
| 58 | ||
| 59 | // Define user set variables |
|
| 60 | $this->title = $this->get_option( 'title' ); |
|
| 61 | $this->type = $this->get_option( 'type' ); |
|
| 62 | $this->fee = $this->get_option( 'fee' ); |
|
| 63 | $this->type = $this->get_option( 'type' ); |
|
| 64 | $this->codes = $this->get_option( 'codes' ); |
|
| 65 | $this->availability = $this->get_option( 'availability' ); |
|
| 66 | $this->countries = $this->get_option( 'countries' ); |
|
| 67 | ||
| 68 | add_action( 'woocommerce_update_options_shipping_' . $this->id, array( $this, 'process_admin_options' ) ); |
|
| 69 | } |
|
| 70 | ||
| 71 | /** |
|
| 72 | * calculate_shipping function. |
|