Changeset View
Changeset View
Standalone View
Standalone View
modules/in-commerce/units/orders/orders_event_handler.php
Show First 20 Lines • Show All 2977 Lines • ▼ Show 20 Line(s) | |||||
$sub_order->RecalculateGift($event); | $sub_order->RecalculateGift($event); | ||||
$original_amount = $sub_order->GetDBField('SubTotal') + $sub_order->GetDBField('ShippingCost') + $sub_order->GetDBField('VAT') + $sub_order->GetDBField('ProcessingFee') + $sub_order->GetDBField('InsuranceFee') - $sub_order->GetDBField('GiftCertificateDiscount'); | $original_amount = $sub_order->GetDBField('SubTotal') + $sub_order->GetDBField('ShippingCost') + $sub_order->GetDBField('VAT') + $sub_order->GetDBField('ProcessingFee') + $sub_order->GetDBField('InsuranceFee') - $sub_order->GetDBField('GiftCertificateDiscount'); | ||||
$sub_order->SetDBField('OriginalAmount', $original_amount); | $sub_order->SetDBField('OriginalAmount', $original_amount); | ||||
$sub_order->Update(); | $sub_order->Update(); | ||||
} | } | ||||
$processed_sub_orders[] = $sub_order->GetID(); | $processed_sub_orders[] = $sub_order->GetID(); | ||||
$next_sub_number++; | $next_sub_number = $sub_order->getNextSubNumber(); | ||||
$group++; | $group++; | ||||
} | } | ||||
foreach ($processed_sub_orders as $sub_id) { | foreach ($processed_sub_orders as $sub_id) { | ||||
// update DiscountTotal field | // update DiscountTotal field | ||||
$sql = 'SELECT SUM(ROUND(FlatPrice-Price,2)*Quantity) FROM '.$table_prefix.'OrderItems WHERE OrderId = '.$sub_id; | $sql = 'SELECT SUM(ROUND(FlatPrice-Price,2)*Quantity) FROM '.$table_prefix.'OrderItems WHERE OrderId = '.$sub_id; | ||||
$discount_total = $this->Conn->GetOne($sql); | $discount_total = $this->Conn->GetOne($sql); | ||||
▲ Show 20 Lines • Show All 1045 Lines • Show Last 20 Lines |