| 1 |
<?php |
| 2 |
|
| 3 |
namespace MakeCommerce\Shipping\Method\Courier; |
| 4 |
|
| 5 |
/** |
| 6 |
* Specifics for Omniva courier shipping method |
| 7 |
* |
| 8 |
* @since 3.0.0 |
| 9 |
*/ |
| 10 |
|
| 11 |
class Omniva extends \MakeCommerce\Shipping\Method\Courier { |
| 12 |
|
| 13 |
public $carrier = "Omniva"; |
| 14 |
public $service_name = "Omniva web services"; |
| 15 |
public $default_price = "4.95"; |
| 16 |
public $default_max_weight = "60"; |
| 17 |
|
| 18 |
/** |
| 19 |
* Loads all form fields specific to this shipping method |
| 20 |
* |
| 21 |
* @since 3.0.0 |
| 22 |
*/ |
| 23 |
public function initialize_method_form_fields() { |
| 24 |
|
| 25 |
$this->form_fields['registerOnPaymentCode'] = array( |
| 26 |
'title' => __('Register shipments automatically as', 'wc_makecommerce_domain'), |
| 27 |
'type' => 'select', |
| 28 |
'label' => __('register on Payment', 'wc_makecommerce_domain'), |
| 29 |
'description' => __('Shipments will be automatically registered on payment using the selected Omniva service code', 'wc_makecommerce_domain'), |
| 30 |
'options' => array( |
| 31 |
'QP' => __('QP - handover to Omniva at Post Office', 'wc_makecommerce_domain'), |
| 32 |
'PK' => __('PK - handover to Omniva via Parcel Machine', 'wc_makecommerce_domain'), |
| 33 |
'' => __('None - do not register automatically', 'wc_makecommerce_domain'), |
| 34 |
), |
| 35 |
'default' => 'QP', |
| 36 |
); |
| 37 |
|
| 38 |
$this->form_fields['service_carrier'] = array( |
| 39 |
'type' => 'select', |
| 40 |
'title' => __('Integration country', 'wc_makecommerce_domain'), |
| 41 |
'options' => array( |
| 42 |
"OMNIVA" => __('Estonia', 'wc_makecommerce_domain'), |
| 43 |
"OMNIVA_LV" => __('Latvia', 'wc_makecommerce_domain'), |
| 44 |
"OMNIVA_LT" => __('Lithuania', 'wc_makecommerce_domain'), |
| 45 |
), |
| 46 |
'default' => "ee", |
| 47 |
'description' => __("Which country's carrier gave you the credentials", 'wc_makecommerce_domain'), |
| 48 |
); |
| 49 |
} |
| 50 |
|
| 51 |
/** |
| 52 |
* Set method specific hooks/filters |
| 53 |
* |
| 54 |
* @since 3.0.0 |
| 55 |
*/ |
| 56 |
public function set_method_hooks() { |
| 57 |
|
| 58 |
//No fish to hook here yet |
| 59 |
} |
| 60 |
} |