PluginProbe
MakeCommerce for WooCommerce / 3.5.4
MakeCommerce for WooCommerce v3.5.4
4.1.0 4.0.8 trunk 1.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 2.0.0 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.2.0 2.2.1 2.2.2 All 96 releases
makecommerce / shipping / method / common / dpd.php

dpd.php in MakeCommerce for WooCommerce 3.5.4, at shipping/method/common/dpd.php

54 lines 1.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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->identifierString . '</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 /**
41 * Loads API key field for DPD
42 *
43 * @since 3.4.0
44 */
45 public function initialize_dpd_api_field() {
46
47 $this->form_fields['api_key'] = [
48 'title' => __( 'DPD API Key', 'wc_makecommerce_domain' ),
49 'type' => 'text',
50 'default' => ''
51 ];
52 }
53 }
54