Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add weight for API salesOrderShipmentAddTrack #1377

Merged
merged 2 commits into from
Aug 9, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion app/code/core/Mage/Sales/Model/Order/Shipment/Api.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ public function create(
* @param string $trackNumber
luigifab marked this conversation as resolved.
Show resolved Hide resolved
* @return int
*/
public function addTrack($shipmentIncrementId, $carrier, $title, $trackNumber)
public function addTrack($shipmentIncrementId, $carrier, $title, $trackNumber, $weight = null)
{
$shipment = Mage::getModel('sales/order_shipment')->loadByIncrementId($shipmentIncrementId);

Expand All @@ -194,6 +194,10 @@ public function addTrack($shipmentIncrementId, $carrier, $title, $trackNumber)
->setCarrierCode($carrier)
->setTitle($title);

if (!empty($weight)) {
$track->setWeight($weight);
}

$shipment->addTrack($track);

try {
Expand Down
1 change: 1 addition & 0 deletions app/code/core/Mage/Sales/etc/wsdl.xml
Original file line number Diff line number Diff line change
Expand Up @@ -843,6 +843,7 @@
<part name="carrier" type="xsd:string" />
<part name="title" type="xsd:string" />
<part name="trackNumber" type="xsd:string" />
<part name="weight" type="xsd:double" minOccurs="0" />
</message>
<message name="salesOrderShipmentAddTrackResponse">
<part name="result" type="xsd:int" />
Expand Down
1 change: 1 addition & 0 deletions app/code/core/Mage/Sales/etc/wsi.xml
Original file line number Diff line number Diff line change
Expand Up @@ -881,6 +881,7 @@
<xsd:element minOccurs="1" maxOccurs="1" name="carrier" type="xsd:string" />
<xsd:element minOccurs="1" maxOccurs="1" name="title" type="xsd:string" />
<xsd:element minOccurs="1" maxOccurs="1" name="trackNumber" type="xsd:string" />
<xsd:element minOccurs="0" maxOccurs="1" name="weight" type="xsd:double" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
Expand Down