| 1 |
<?php |
| 2 |
|
| 3 |
namespace MakeCommerce\Shipping\Method\Courier; |
| 4 |
|
| 5 |
/** |
| 6 |
* Specifics for DPD courier shipping method |
| 7 |
* |
| 8 |
* @since 3.4.0 |
| 9 |
*/ |
| 10 |
|
| 11 |
class DPD extends \MakeCommerce\Shipping\Method\Courier { |
| 12 |
|
| 13 |
use \MakeCommerce\Shipping\Method\Common\DPD; |
| 14 |
|
| 15 |
public $default_price = "4.95"; |
| 16 |
public $default_max_weight = "60"; |
| 17 |
|
| 18 |
/** |
| 19 |
* Overrides Method class function |
| 20 |
* Removes loading of user and password fields |
| 21 |
* |
| 22 |
* @since 3.4.0 |
| 23 |
*/ |
| 24 |
public function initialize_method_type_form_fields() { |
| 25 |
|
| 26 |
//Initialize method specific fields |
| 27 |
$this->initialize_method_form_fields(); |
| 28 |
} |
| 29 |
|
| 30 |
/** |
| 31 |
* Loads all form fields specific to this shipping method |
| 32 |
* |
| 33 |
* @since 3.4.0 |
| 34 |
*/ |
| 35 |
public function initialize_method_form_fields() { |
| 36 |
|
| 37 |
$this->form_fields['registerOnPaymentCode'] = [ |
| 38 |
'title' => __('Register shipments automatically as', 'wc_makecommerce_domain'), |
| 39 |
'type' => 'select', |
| 40 |
'label' => __('register on Payment', 'wc_makecommerce_domain'), |
| 41 |
'description' => __('Shipments will be automatically registered on payment using the selected DPD service code', 'wc_makecommerce_domain'), |
| 42 |
'options' => [ |
| 43 |
'QP' => __('QP - handover to DPD at Post Office', 'wc_makecommerce_domain'), |
| 44 |
'PK' => __('PK - handover to DPD via Parcel Machine', 'wc_makecommerce_domain') |
| 45 |
], |
| 46 |
'default' => 'QP', |
| 47 |
]; |
| 48 |
|
| 49 |
$this->form_fields['service_carrier'] = [ |
| 50 |
'type' => 'select', |
| 51 |
'title' => __('Integration country', 'wc_makecommerce_domain'), |
| 52 |
'options' => [ |
| 53 |
"DPD" => __('Estonia', 'wc_makecommerce_domain'), |
| 54 |
"DPD_LV" => __('Latvia', 'wc_makecommerce_domain'), |
| 55 |
"DPD_LT" => __('Lithuania', 'wc_makecommerce_domain'), |
| 56 |
], |
| 57 |
'default' => "DPD", |
| 58 |
'description' => __("Which country's carrier gave you the credentials", 'wc_makecommerce_domain'), |
| 59 |
]; |
| 60 |
|
| 61 |
$this->initialize_dpd_api_field(); |
| 62 |
} |
| 63 |
|
| 64 |
/** |
| 65 |
* Set method specific hooks/filters |
| 66 |
* |
| 67 |
* @since 3.4.0 |
| 68 |
*/ |
| 69 |
public function set_method_hooks() { |
| 70 |
|
| 71 |
//No fish to hook here yet |
| 72 |
} |
| 73 |
} |
| 74 |
|