Index: branches/5.2.x/units/orders/order_manager.php =================================================================== diff -u -N -r14258 -r14641 --- branches/5.2.x/units/orders/order_manager.php (.../order_manager.php) (revision 14258) +++ branches/5.2.x/units/orders/order_manager.php (.../order_manager.php) (revision 14641) @@ -1,6 +1,6 @@ 'state_changed', 2 => 'qty_unavailable', @@ -96,7 +89,6 @@ function reset() { - $this->errorCode = 0; $this->operations = Array (); $this->totalsOverride = Array (); @@ -109,23 +101,34 @@ } /** - * Sets error from last operation + * Sets checkout error * + * @param int $error_type = {product,coupon,gc} * @param int $error_code + * @param int $product_id - {ProductId}:{OptionsSalt}:{BackOrderFlag}:{FieldName} + * @return void + * @access public */ - public function setError($error_code) + public function setError($error_type, $error_code, $product_id = null) { - $this->errorCode = $error_code; + $this->order->setCheckoutError($error_type, $error_code, $product_id); } /** - * Sets error from last operation + * Gets error count * * @return int + * @access public */ - public function getError() + public function getErrorCount() { - return $this->errorCode; + $errors = $this->Application->RecallVar('checkout_errors'); + + if ( !$errors ) { + return 0; + } + + return count( unserialize($errors) ); } /** @@ -146,7 +149,7 @@ { $this->calculator->calculate(); - $changed = $this->applyOperations() || ($this->getError() > 0); + $changed = $this->applyOperations() || ($this->getErrorCount() > 0); $this->setOrderTotals(); return $changed;