| 1 |
<?php |
| 2 |
|
| 3 |
namespace Sendy\WooCommerce\ShippingMethods; |
| 4 |
|
| 5 |
use WC_Shipping_Flat_Rate; |
| 6 |
|
| 7 |
class StandardDelivery extends WC_Shipping_Flat_Rate |
| 8 |
{ |
| 9 |
use ShippingMethodTrait; |
| 10 |
|
| 11 |
public const ID = 'sendy_standard_delivery'; |
| 12 |
|
| 13 |
public function __construct($instance_id = 0) |
| 14 |
{ |
| 15 |
$this->id = self::ID; |
| 16 |
$this->instance_id = absint($instance_id); |
| 17 |
$this->method_title = __('Sendy - Standard Delivery', 'sendy'); |
| 18 |
$this->method_description = __('Standard delivery method', 'sendy'); |
| 19 |
|
| 20 |
|
| 21 |
$this->supports = [ |
| 22 |
'shipping-zones', |
| 23 |
'instance-settings', |
| 24 |
'instance-settings-modal', |
| 25 |
]; |
| 26 |
|
| 27 |
$this->init(); |
| 28 |
$this->init_form_fields(); |
| 29 |
$this->init_settings(); |
| 30 |
|
| 31 |
add_filter('woocommerce_shipping_instance_form_fields_' . $this->id, [$this, 'instance_form_fields'], 10, 1); |
| 32 |
add_action('woocommerce_update_options_shipping_' . $this->id, [$this, 'process_admin_options']); |
| 33 |
} |
| 34 |
} |
| 35 |
|