first commit
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
class stDeliveryOrderProductInfo extends stDeliveryProductInfoAbstract
|
||||
{
|
||||
/**
|
||||
* Zamówienie
|
||||
* @var Order
|
||||
*/
|
||||
protected $order;
|
||||
|
||||
public function __construct(Order $order, stCurrencyModelInterface $currency)
|
||||
{
|
||||
$this->order = $order;
|
||||
parent::__construct($currency);
|
||||
}
|
||||
|
||||
protected function initialize(): void
|
||||
{
|
||||
foreach ($this->order->getOrderProductsJoinProduct() as $orderProduct)
|
||||
{
|
||||
$this->addAmountWithCurrency($orderProduct->getTotalAmount(true, true));
|
||||
$this->addWeight($orderProduct->getTotalWeight());
|
||||
$this->addQuantity($orderProduct->getQuantity());
|
||||
$this->addDimensions($orderProduct->getWidth(), $orderProduct->getHeight(), $orderProduct->getDepth(), $orderProduct->getQuantity());
|
||||
$this->addDeliveryPrice($orderProduct->getTotalDeliveryPrice());
|
||||
$this->addMaxTax($orderProduct->getTax());
|
||||
|
||||
if (!empty($orderProduct->getProduct()->getDeliveries()))
|
||||
{
|
||||
$this->addAllowedDeliveries($orderProduct->getProduct()->getDeliveries());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user