Index: branches/5.2.x/units/orders/order_calculator.php =================================================================== diff -u -N -r14436 -r14641 --- branches/5.2.x/units/orders/order_calculator.php (.../order_calculator.php) (revision 14436) +++ branches/5.2.x/units/orders/order_calculator.php (.../order_calculator.php) (revision 14641) @@ -1,6 +1,6 @@ manager->setError($error_code); + $this->manager->setError($error_type, $error_code, $product_id); } /** @@ -228,7 +232,12 @@ if ($to_order < $item['Quantity']) { // ordered less, then requested -> inform user - $this->setError($to_order > 0 ? 2 : 3); + if ( $to_order > 0 ) { + $this->setError(OrderCheckoutErrorType::PRODUCT, OrderCheckoutError::QTY_UNAVAILABLE, $item['ProductId'] . ':' . $item['OptionsSalt'] . ':0:Quantity'); + } + else { + $this->setError(OrderCheckoutErrorType::PRODUCT, OrderCheckoutError::QTY_OUT_OF_STOCK, $item['ProductId'] . ':' . $item['OptionsSalt'] . ':0:Quantity'); + } } } } @@ -364,7 +373,8 @@ if ($qty > 0 && $qty < $min_qty) { // qty in cart increased to meat minimal qry requirements of given product - $this->setError(6); + $this->setError(OrderCheckoutErrorType::PRODUCT, OrderCheckoutError::QTY_CHANGED_TO_MINIMAL, $item['ProductId'] . ':' . $item['OptionsSalt'] . ':0:Quantity'); + $item['Quantity'] = $min_qty; } }