You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by mo...@apache.org on 2008/07/15 13:13:27 UTC

svn commit: r676872 - /ofbiz/trunk/applications/ecommerce/webapp/ecommerce/images/checkoutProcess.js

Author: mor
Date: Tue Jul 15 04:13:27 2008
New Revision: 676872

URL: http://svn.apache.org/viewvc?rev=676872&view=rev
Log:
Misc. cleanups in js used in One Page Checkout. Patch from Sumit Pandit and Brajesh Patel

Modified:
    ofbiz/trunk/applications/ecommerce/webapp/ecommerce/images/checkoutProcess.js

Modified: ofbiz/trunk/applications/ecommerce/webapp/ecommerce/images/checkoutProcess.js
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/ecommerce/webapp/ecommerce/images/checkoutProcess.js?rev=676872&r1=676871&r2=676872&view=diff
==============================================================================
--- ofbiz/trunk/applications/ecommerce/webapp/ecommerce/images/checkoutProcess.js (original)
+++ ofbiz/trunk/applications/ecommerce/webapp/ecommerce/images/checkoutProcess.js Tue Jul 15 04:13:27 2008
@@ -395,35 +395,13 @@
         asynchronous: false, 
         onSuccess: function(transport) {
             var data = transport.responseText.evalJSON(true);
-            if (data._ERROR_MESSAGE_LIST_ != undefined) {
-                $('cartFormServerError').update(data._ERROR_MESSAGE_LIST_);
-            } else if (data._ERROR_MESSAGE_ != undefined) {
-                $('cartFormServerError').update(data._ERROR_MESSAGE_);  
+            var serverError = getServerError(data);
+            if(serverError != "") {
+                Effect.Appear('cartFormServerError');
+                $('cartFormServerError').update(serverError);
             } else {
-                $('cartDiscountValue').update(data.displayOrderAdjustmentsTotalCurrencyFormatted);
-                $('cartSubTotal').update(data.subTotalCurrencyFormatted);
-                $('cartTotalShipping').update(data.totalShippingCurrencyFormatted);
-                $('cartTotalSalesTax').update(data.totalSalesTaxCurrencyFormatted);
-                $('cartDisplayGrandTotal').update(data.displayGrandTotalCurrencyFormatted);
-                // update summary
-                $('completedCartSubTotal').update(data.subTotalCurrencyFormatted);
-                $('completedCartTotalShipping').update(data.totalShippingCurrencyFormatted);
-                $('completedCartTotalSalesTax').update(data.totalSalesTaxCurrencyFormatted);
-                $('completedCartDisplayGrandTotal').update(data.displayGrandTotalCurrencyFormatted);
-                $('completedCartDiscount').update(data.displayOrderAdjustmentsTotalCurrencyFormatted); 
-                if (data.displayDiscountTotal < 0) {
-                    $('completedCartDiscountRow').show();
-                } else {
-                    $('completedCartDiscountRow').hide();
-                }
-                if (elementId !=undefined ) {
-                    if ($(elementId).value == 0) {
-                        var cartItemRowId = elementId.sub('qty_','cartItemRow_');
-                        $(cartItemRowId).remove();
-                        var cartItemDisplayRowId = elementId.sub('qty_','cartItemDisplayRow_');
-                        $(cartItemDisplayRowId).remove();
-                    }
-                }
+                Effect.Fade('cartFormServerError');
+                updateCartData();
             }
         },
         parameters: {productPromoCodeId:$F('productPromoCode')}