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

fix(fulfilment): export phonenumber and weight #810

Merged
merged 1 commit into from
Jan 18, 2024
Merged
Changes from all commits
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
12 changes: 8 additions & 4 deletions Model/Sales/MagentoOrderCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ class MagentoOrderCollection extends MagentoCollection
*/
private $orders = null;

/**
* @var \Magento\Sales\Model\Order
*/
private $order;

/**
Expand Down Expand Up @@ -332,7 +335,7 @@ private function setMagentoOrdersAsExported(): void
}

/**
* @return int
* @return int weight in grams
*/
private function getTotalWeight(): int
{
Expand All @@ -345,10 +348,10 @@ private function getTotalWeight(): int
continue;
}

$totalWeight += $this->helper->convertToGrams($product->getWeight() * $item->getQtyShipped());
$totalWeight += $product->getWeight() * $item->getQtyOrdered();
}

return $totalWeight;
return $this->helper->convertToGrams($totalWeight);
}

/**
Expand Down Expand Up @@ -426,7 +429,8 @@ public function setShippingRecipient(): self
->setStreet($streetParts->getStreet())
->setNumber((string) $streetParts->getNumber())
->setNumberSuffix((string) $streetParts->getNumberSuffix())
->setBoxNumber((string) $streetParts->getBoxNumber());
->setBoxNumber((string) $streetParts->getBoxNumber())
->setPhone($this->order->getShippingAddress()->getTelephone());

return $this;
}
Expand Down