| 1 |
<?php |
| 2 |
/** |
| 3 |
* Class Attribute |
| 4 |
* |
| 5 |
* @package Packetery |
| 6 |
*/ |
| 7 |
|
| 8 |
declare( strict_types=1 ); |
| 9 |
|
| 10 |
namespace Packetery\Module\Order; |
| 11 |
|
| 12 |
/** |
| 13 |
* Class Attribute |
| 14 |
* |
| 15 |
* @package Packetery |
| 16 |
*/ |
| 17 |
class Attribute { |
| 18 |
|
| 19 |
public const POINT_ID = 'packetery_point_id'; |
| 20 |
public const POINT_NAME = 'packetery_point_name'; |
| 21 |
public const POINT_CITY = 'packetery_point_city'; |
| 22 |
public const POINT_ZIP = 'packetery_point_zip'; |
| 23 |
public const POINT_STREET = 'packetery_point_street'; |
| 24 |
public const POINT_PLACE = 'packetery_point_place'; // Business name of pickup point. |
| 25 |
public const CARRIER_ID = 'packetery_carrier_id'; |
| 26 |
public const POINT_URL = 'packetery_point_url'; |
| 27 |
public const POINT_TYPE = 'packetery_point_type'; |
| 28 |
|
| 29 |
public const ADDRESS_IS_VALIDATED = 'packetery_address_isValidated'; |
| 30 |
public const ADDRESS_HOUSE_NUMBER = 'packetery_address_houseNumber'; |
| 31 |
public const ADDRESS_STREET = 'packetery_address_street'; |
| 32 |
public const ADDRESS_CITY = 'packetery_address_city'; |
| 33 |
public const ADDRESS_POST_CODE = 'packetery_address_postCode'; |
| 34 |
public const ADDRESS_COUNTY = 'packetery_address_county'; |
| 35 |
public const ADDRESS_COUNTRY = 'packetery_address_country'; |
| 36 |
public const ADDRESS_LATITUDE = 'packetery_address_latitude'; |
| 37 |
public const ADDRESS_LONGITUDE = 'packetery_address_longitude'; |
| 38 |
|
| 39 |
public const CAR_DELIVERY_ID = 'packetery_car_delivery_id'; |
| 40 |
public const EXPECTED_DELIVERY_FROM = 'packetery_car_delivery_from'; |
| 41 |
public const EXPECTED_DELIVERY_TO = 'packetery_car_delivery_to'; |
| 42 |
|
| 43 |
/** |
| 44 |
* Pickup point attributes configuration. |
| 45 |
* |
| 46 |
* @var array<string, array<string, string|bool>> |
| 47 |
*/ |
| 48 |
public static $pickupPointAttributes = [ |
| 49 |
'id' => [ |
| 50 |
'name' => self::POINT_ID, |
| 51 |
'required' => true, |
| 52 |
], |
| 53 |
'name' => [ |
| 54 |
'name' => self::POINT_NAME, |
| 55 |
'required' => false, |
| 56 |
], |
| 57 |
'city' => [ |
| 58 |
'name' => self::POINT_CITY, |
| 59 |
'required' => false, |
| 60 |
], |
| 61 |
'zip' => [ |
| 62 |
'name' => self::POINT_ZIP, |
| 63 |
'required' => false, |
| 64 |
], |
| 65 |
'street' => [ |
| 66 |
'name' => self::POINT_STREET, |
| 67 |
'required' => false, |
| 68 |
], |
| 69 |
'place' => [ |
| 70 |
'name' => self::POINT_PLACE, |
| 71 |
'required' => false, |
| 72 |
], |
| 73 |
'carrierId' => [ |
| 74 |
'name' => self::CARRIER_ID, |
| 75 |
'required' => false, |
| 76 |
], |
| 77 |
'url' => [ |
| 78 |
'name' => self::POINT_URL, |
| 79 |
'required' => false, |
| 80 |
], |
| 81 |
'pickupPointType' => [ |
| 82 |
'name' => self::POINT_TYPE, |
| 83 |
'required' => false, |
| 84 |
], |
| 85 |
]; |
| 86 |
|
| 87 |
/** |
| 88 |
* Home delivery attributes configuration. |
| 89 |
* |
| 90 |
* @var array<string, array<string, string|bool>> |
| 91 |
*/ |
| 92 |
public static $homeDeliveryAttributes = [ |
| 93 |
'isValidated' => [ |
| 94 |
'name' => self::ADDRESS_IS_VALIDATED, |
| 95 |
// Name of checkout hidden form field. Must be unique in entire form. |
| 96 |
'isWidgetResultField' => false, |
| 97 |
// Is attribute included in widget result address? By default, it is. |
| 98 |
], |
| 99 |
'houseNumber' => [ |
| 100 |
'name' => self::ADDRESS_HOUSE_NUMBER, |
| 101 |
], |
| 102 |
'street' => [ |
| 103 |
'name' => self::ADDRESS_STREET, |
| 104 |
], |
| 105 |
'city' => [ |
| 106 |
'name' => self::ADDRESS_CITY, |
| 107 |
], |
| 108 |
'postCode' => [ |
| 109 |
'name' => self::ADDRESS_POST_CODE, |
| 110 |
'widgetResultField' => 'postcode', |
| 111 |
// Widget returns address object containing specified field. By default, it is the array key 'postCode', but in this case it is 'postcode'. |
| 112 |
], |
| 113 |
'county' => [ |
| 114 |
'name' => self::ADDRESS_COUNTY, |
| 115 |
], |
| 116 |
'country' => [ |
| 117 |
'name' => self::ADDRESS_COUNTRY, |
| 118 |
], |
| 119 |
'latitude' => [ |
| 120 |
'name' => self::ADDRESS_LATITUDE, |
| 121 |
], |
| 122 |
'longitude' => [ |
| 123 |
'name' => self::ADDRESS_LONGITUDE, |
| 124 |
], |
| 125 |
]; |
| 126 |
|
| 127 |
/** |
| 128 |
* Car delivery attributes configuration. |
| 129 |
* |
| 130 |
* @var array<string, array<string, string|bool>> |
| 131 |
*/ |
| 132 |
public static $carDeliveryAttributes = [ |
| 133 |
'carDeliveryId' => [ |
| 134 |
'name' => self::CAR_DELIVERY_ID, |
| 135 |
'isWidgetResultField' => false, |
| 136 |
], |
| 137 |
'street' => [ |
| 138 |
'name' => self::ADDRESS_STREET, |
| 139 |
], |
| 140 |
'houseNumber' => [ |
| 141 |
'name' => self::ADDRESS_HOUSE_NUMBER, |
| 142 |
], |
| 143 |
'city' => [ |
| 144 |
'name' => self::ADDRESS_CITY, |
| 145 |
], |
| 146 |
'postalCode' => [ |
| 147 |
'name' => self::ADDRESS_POST_CODE, |
| 148 |
], |
| 149 |
'country' => [ |
| 150 |
'name' => self::ADDRESS_COUNTRY, |
| 151 |
], |
| 152 |
'expectedDeliveryDayFrom' => [ |
| 153 |
'name' => self::EXPECTED_DELIVERY_FROM, |
| 154 |
'isWidgetResultField' => false, |
| 155 |
], |
| 156 |
'expectedDeliveryDayTo' => [ |
| 157 |
'name' => self::EXPECTED_DELIVERY_TO, |
| 158 |
'isWidgetResultField' => false, |
| 159 |
], |
| 160 |
]; |
| 161 |
} |
| 162 |
|