| 1 |
<?php |
| 2 |
|
| 3 |
namespace MakeCommerce\Shipping\Method\ParcelMachine; |
| 4 |
|
| 5 |
/** |
| 6 |
* Smartpost parcelmachine shipping method. |
| 7 |
* Defines all Smartpost specific options. |
| 8 |
* |
| 9 |
* @since 3.0.0 |
| 10 |
*/ |
| 11 |
|
| 12 |
class Smartpost extends \MakeCommerce\Shipping\Method\ParcelMachine { |
| 13 |
|
| 14 |
use \MakeCommerce\Shipping\Method\Common\Smartpost; |
| 15 |
|
| 16 |
public $default_price = "5.00"; |
| 17 |
public $default_max_weight = "35"; |
| 18 |
|
| 19 |
/** |
| 20 |
* Overrides Method class function |
| 21 |
* Removes loading of user and password fields |
| 22 |
* |
| 23 |
* @since 3.3.0 |
| 24 |
*/ |
| 25 |
public function initialize_method_type_form_fields() { |
| 26 |
|
| 27 |
//Initialize method specific fields |
| 28 |
$this->initialize_method_form_fields(); |
| 29 |
} |
| 30 |
|
| 31 |
/** |
| 32 |
* Loads all form fields specific to this shipping method |
| 33 |
* |
| 34 |
* @since 3.0.0 |
| 35 |
*/ |
| 36 |
|
| 37 |
public function initialize_method_form_fields() { |
| 38 |
|
| 39 |
$this->initialize_smartpost_api_field(); |
| 40 |
|
| 41 |
//option to disable white parcel machines, if only machines capable of recipient authentication are required. |
| 42 |
$this->form_fields['use_white_apts'] = array( |
| 43 |
'type' => 'select', |
| 44 |
'title' => __( 'Use authenticable APTs', 'wc_makecommerce_domain' ), |
| 45 |
'options' => array( |
| 46 |
false => __( 'use all APTs', 'wc_makecommerce_domain' ), |
| 47 |
true => __( 'use only non-white auth-capable APTs', 'wc_makecommerce_domain' ), |
| 48 |
), |
| 49 |
'default' => false, |
| 50 |
'description' => '', |
| 51 |
); |
| 52 |
|
| 53 |
} |
| 54 |
} |
| 55 |
|