|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/** |
|
4
|
|
|
* @file |
|
5
|
|
|
* Magento API Client (SOAP v1). |
|
6
|
|
|
* Allows wrappers for each call, dependencies injections |
|
7
|
|
|
* and code completion. |
|
8
|
|
|
* |
|
9
|
|
|
* @author Sébastien MALOT <[email protected]> |
|
10
|
|
|
* @license MIT |
|
11
|
|
|
* @url <https://github.com/smalot/magento-client> |
|
12
|
|
|
* |
|
13
|
|
|
* For the full copyright and license information, please view the LICENSE |
|
14
|
|
|
* file that was distributed with this source code. |
|
15
|
|
|
*/ |
|
16
|
|
|
|
|
17
|
|
|
namespace Smalot\Magento\Order; |
|
18
|
|
|
|
|
19
|
|
|
use Smalot\Magento\ActionInterface; |
|
20
|
|
|
use Smalot\Magento\MagentoModuleAbstract; |
|
21
|
|
|
|
|
22
|
|
|
/** |
|
23
|
|
|
* Class OrderShipment |
|
24
|
|
|
* |
|
25
|
|
|
* @package Smalot\Magento\Order |
|
26
|
|
|
*/ |
|
27
|
|
|
class OrderShipment extends MagentoModuleAbstract |
|
28
|
|
|
{ |
|
29
|
|
|
/** |
|
30
|
|
|
* Allows you to add a new comment to the order shipment. |
|
31
|
|
|
* |
|
32
|
|
|
* @param string $shipmentIncrementId |
|
33
|
|
|
* @param string $comment |
|
34
|
|
|
* @param string $email |
|
35
|
|
|
* @param string $includeInEmail |
|
36
|
|
|
* |
|
37
|
|
|
* @return ActionInterface |
|
38
|
|
|
*/ |
|
39
|
|
|
public function addComment($shipmentIncrementId, $comment = null, $email = null, $includeInEmail = null) |
|
|
|
|
|
|
40
|
|
|
{ |
|
41
|
|
|
return $this->__createAction('order_shipment.addComment', func_get_args()); |
|
42
|
|
|
} |
|
43
|
|
|
|
|
44
|
|
|
/** |
|
45
|
|
|
* Allows you to add a new tracking number to the order shipment. |
|
46
|
|
|
* |
|
47
|
|
|
* @param string $shipmentIncrementId |
|
48
|
|
|
* @param string $carrier |
|
49
|
|
|
* @param string $title |
|
50
|
|
|
* @param string $trackNumber |
|
51
|
|
|
* |
|
52
|
|
|
* @return ActionInterface |
|
53
|
|
|
*/ |
|
54
|
|
|
public function addTrack($shipmentIncrementId, $carrier, $title, $trackNumber) |
|
|
|
|
|
|
55
|
|
|
{ |
|
56
|
|
|
return $this->__createAction('order_shipment.addTrack', func_get_args()); |
|
57
|
|
|
} |
|
58
|
|
|
|
|
59
|
|
|
/** |
|
60
|
|
|
* Allows you to create a new shipment for an order. |
|
61
|
|
|
* |
|
62
|
|
|
* @param string $orderIncrementId |
|
63
|
|
|
* @param string $itemsQty |
|
64
|
|
|
* @param string $comment |
|
65
|
|
|
* @param int $email |
|
66
|
|
|
* @param int $includeComment |
|
67
|
|
|
* |
|
68
|
|
|
* @return ActionInterface |
|
69
|
|
|
*/ |
|
70
|
|
|
public function create($orderIncrementId, $itemsQty = null, $comment = null, $email = null, $includeComment = null) |
|
|
|
|
|
|
71
|
|
|
{ |
|
72
|
|
|
return $this->__createAction('order_shipment.create', func_get_args()); |
|
73
|
|
|
} |
|
74
|
|
|
|
|
75
|
|
|
/** |
|
76
|
|
|
* Allows you to retrieve the list of allowed carriers for an order. |
|
77
|
|
|
* |
|
78
|
|
|
* @param string $orderIncrementId |
|
79
|
|
|
* |
|
80
|
|
|
* @return ActionInterface |
|
81
|
|
|
*/ |
|
82
|
|
|
public function getCarriers($orderIncrementId) |
|
|
|
|
|
|
83
|
|
|
{ |
|
84
|
|
|
return $this->__createAction('order_shipment.getCarriers', func_get_args()); |
|
85
|
|
|
} |
|
86
|
|
|
|
|
87
|
|
|
/** |
|
88
|
|
|
* Allows you to retrieve the shipment information. |
|
89
|
|
|
* |
|
90
|
|
|
* @param $shipmentIncrementId |
|
91
|
|
|
* |
|
92
|
|
|
* @return ActionInterface |
|
93
|
|
|
*/ |
|
94
|
|
|
public function getInfo($shipmentIncrementId) |
|
|
|
|
|
|
95
|
|
|
{ |
|
96
|
|
|
return $this->__createAction('order_shipment.info', func_get_args()); |
|
97
|
|
|
} |
|
98
|
|
|
|
|
99
|
|
|
/** |
|
100
|
|
|
* Allows you to retrieve the list of order shipments. |
|
101
|
|
|
* Additional filters can be applied. |
|
102
|
|
|
* |
|
103
|
|
|
* @param array $filters |
|
104
|
|
|
* |
|
105
|
|
|
* @return ActionInterface |
|
106
|
|
|
*/ |
|
107
|
|
|
public function getList($filters) |
|
|
|
|
|
|
108
|
|
|
{ |
|
109
|
|
|
return $this->__createAction('order_shipment.list', func_get_args()); |
|
110
|
|
|
} |
|
111
|
|
|
|
|
112
|
|
|
/** |
|
113
|
|
|
* Allows you to remove a tracking number from the order shipment. |
|
114
|
|
|
* |
|
115
|
|
|
* @param string $shipmentIncrementId |
|
116
|
|
|
* @param string $trackId |
|
117
|
|
|
* |
|
118
|
|
|
* @return ActionInterface |
|
119
|
|
|
*/ |
|
120
|
|
|
public function removeTrack($shipmentIncrementId, $trackId) |
|
|
|
|
|
|
121
|
|
|
{ |
|
122
|
|
|
return $this->__createAction('order_shipment.removeTrack', func_get_args()); |
|
123
|
|
|
} |
|
124
|
|
|
} |
|
125
|
|
|
|
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.