Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
/**
* This File contains \QUI\ERP\Shipping\EventHandler
*/
namespace QUI\ERP\Shipping;
use QUI;
/**
* Class EventHandler
*
* @package QUI\ERP\Shipping
*/
class EventHandler
{
/**
* event - on price factor init
*
* @param $Basket
* @param QUI\ERP\Order\AbstractOrder $Order
* @param QUI\ERP\Products\Product\ProductList $Products
*/
public static function onQuiqqerOrderBasketToOrder(
$Basket,
QUI\ERP\Order\AbstractOrder $Order,
QUI\ERP\Products\Product\ProductList $Products
) {
$Shipping = $Order->getShipping();
if (!$Shipping) {
return;
}
$PriceFactors = $Products->getPriceFactors();
$PriceFactors->addToEnd($Shipping->toPriceFactor());
try {
$Products->recalculation();
} catch (QUI\Exception $Exception) {
QUI\System\Log::writeDebugException($Exception);
}
}
}