| 1 |
<?php |
| 2 |
|
| 3 |
namespace MakeCommerce\Shipping\Method\Common; |
| 4 |
|
| 5 |
/** |
| 6 |
* Omniva specific functionality that is used by both courier and parcelmachine |
| 7 |
* |
| 8 |
* @since 3.0.4 |
| 9 |
*/ |
| 10 |
|
| 11 |
trait DPD { |
| 12 |
|
| 13 |
public $carrier = "DPD"; |
| 14 |
public $carrier_id = "dpd"; |
| 15 |
public $carrier_title = "DPD"; |
| 16 |
public $service_name = "DPD InterConnect"; |
| 17 |
public $international_number_format = true; |
| 18 |
|
| 19 |
/** |
| 20 |
* https://www.dpd.com/ee/wp-content/uploads/sites/235/2020/04/Interconnector_dokumentatsioon-1.pdf |
| 21 |
* |
| 22 |
* Recipient phone number, must start with international |
| 23 |
* country code. e.g. +372555555, +37065123456 |
| 24 |
* |
| 25 |
* country code => array( |
| 26 |
* starting number(s) => array( lenght1, lenght2 ) |
| 27 |
* ) |
| 28 |
*/ |
| 29 |
//DPD does not define any restrictions on phone numbers. Leave $valid_phonenumber_country_codes undefined |
| 30 |
|
| 31 |
/** |
| 32 |
* Returns invalid phone number error |
| 33 |
* |
| 34 |
* @since 3.0.4 |
| 35 |
*/ |
| 36 |
public function phone_number_validation_error() { |
| 37 |
return '<strong>' . $this->carrier_title . ' ' . $this->identifier . '</strong> ' . __(' can be used with an international phone number only. Please specify your phone number with international country code (e.g. +372xxxxxxx)', 'wc_makecommerce_domain' ); |
| 38 |
} |
| 39 |
} |
| 40 |
|