Changeset View
Changeset View
Standalone View
Standalone View
branches/5.2.x/units/orders/orders_event_handler.php
Show First 20 Lines • Show All 514 Lines • ▼ Show 20 Line(s) | |||||
$order_idfield = $this->Application->getUnitOption('ord','IDField'); | $order_idfield = $this->Application->getUnitOption('ord','IDField'); | ||||
$order_table = $this->Application->getUnitOption('ord','TableName'); | $order_table = $this->Application->getUnitOption('ord','TableName'); | ||||
$original_amount = $order->GetDBField('SubTotal') + $order->GetDBField('ShippingCost') + $order->GetDBField('VAT') + $order->GetDBField('ProcessingFee') + $order->GetDBField('InsuranceFee') - $order->GetDBField('GiftCertificateDiscount'); | $original_amount = $order->GetDBField('SubTotal') + $order->GetDBField('ShippingCost') + $order->GetDBField('VAT') + $order->GetDBField('ProcessingFee') + $order->GetDBField('InsuranceFee') - $order->GetDBField('GiftCertificateDiscount'); | ||||
$sql = 'UPDATE '.$order_table.' | $sql = 'UPDATE '.$order_table.' | ||||
SET OriginalAmount = '.$original_amount.' | SET OriginalAmount = '.$original_amount.' | ||||
WHERE '.$order_idfield.' = '.$order_id; | WHERE '.$order_idfield.' = '.$order_id; | ||||
$this->Conn->Query($sql); | $this->Conn->Query($sql); | ||||
// Remember order ID for use on "Thank You" page. | |||||
$this->Application->StoreVar('front_order_id', $order_id); | $this->Application->StoreVar('front_order_id', $order_id); | ||||
// Remove globals, set from "_createNewCart" method. | |||||
$this->Application->DeleteVar('ord_id'); | |||||
$this->Application->RemoveVar('ord_id'); | $this->Application->RemoveVar('ord_id'); | ||||
// Prevent accidental access to non-Incomplete order. | |||||
$this->Application->removeObject($event->getPrefixSpecial()); | |||||
$this->Application->Session->SetCookie('shop_cart_cookie', '', strtotime('-1 month')); | $this->Application->Session->SetCookie('shop_cart_cookie', '', strtotime('-1 month')); | ||||
} | } | ||||
/** | /** | ||||
* Set billing address same as shipping | * Set billing address same as shipping | ||||
* | * | ||||
* @param kEvent $event | * @param kEvent $event | ||||
*/ | */ | ||||
▲ Show 20 Lines • Show All 3575 Lines • Show Last 20 Lines |