| @@ 234-254 (lines=21) @@ | ||
| 231 | /** |
|
| 232 | * Output the settings. |
|
| 233 | */ |
|
| 234 | public function output() { |
|
| 235 | global $current_section; |
|
| 236 | ||
| 237 | // Load shipping methods so we can show any global options they may have. |
|
| 238 | $payment_gateways = WC()->payment_gateways->payment_gateways(); |
|
| 239 | ||
| 240 | if ( $current_section ) { |
|
| 241 | ||
| 242 | foreach ( $payment_gateways as $gateway ) { |
|
| 243 | ||
| 244 | if ( strtolower( get_class( $gateway ) ) == strtolower( $current_section ) ) { |
|
| 245 | $gateway->admin_options(); |
|
| 246 | break; |
|
| 247 | } |
|
| 248 | } |
|
| 249 | } else { |
|
| 250 | $settings = $this->get_settings(); |
|
| 251 | ||
| 252 | WC_Admin_Settings::output_fields( $settings ); |
|
| 253 | } |
|
| 254 | } |
|
| 255 | ||
| 256 | /** |
|
| 257 | * Output payment gateway settings. |
|
| @@ 149-169 (lines=21) @@ | ||
| 146 | /** |
|
| 147 | * Output the settings. |
|
| 148 | */ |
|
| 149 | public function output() { |
|
| 150 | global $current_section; |
|
| 151 | ||
| 152 | // Load shipping methods so we can show any global options they may have |
|
| 153 | $shipping_methods = WC()->shipping->load_shipping_methods(); |
|
| 154 | ||
| 155 | if ( $current_section ) { |
|
| 156 | ||
| 157 | foreach ( $shipping_methods as $method ) { |
|
| 158 | ||
| 159 | if ( strtolower( get_class( $method ) ) == strtolower( $current_section ) && $method->has_settings() ) { |
|
| 160 | $method->admin_options(); |
|
| 161 | break; |
|
| 162 | } |
|
| 163 | } |
|
| 164 | } else { |
|
| 165 | $settings = $this->get_settings(); |
|
| 166 | ||
| 167 | WC_Admin_Settings::output_fields( $settings ); |
|
| 168 | } |
|
| 169 | } |
|
| 170 | ||
| 171 | /** |
|
| 172 | * Save settings. |
|