svn commit: r675188 - in /ofbiz/trunk/applications/ecommerce/webapp/ecommerce: images/checkoutProcess.js order/OnePageCheckoutProcess.ftl

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r675188 - in /ofbiz/trunk/applications/ecommerce/webapp/ecommerce: images/checkoutProcess.js order/OnePageCheckoutProcess.ftl

mor-2
Author: mor
Date: Wed Jul  9 07:30:45 2008
New Revision: 675188

URL: http://svn.apache.org/viewvc?rev=675188&view=rev
Log:
Error handling on One Page Checkout.

Patch from Brajesh Patel.

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

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=675188&r1=675187&r2=675188&view=diff
==============================================================================
--- ofbiz/trunk/applications/ecommerce/webapp/ecommerce/images/checkoutProcess.js (original)
+++ ofbiz/trunk/applications/ecommerce/webapp/ecommerce/images/checkoutProcess.js Wed Jul  9 07:30:45 2008
@@ -203,12 +203,13 @@
             });
             $('shipMethod').update(optionList);
             if (data._ERROR_MESSAGE_LIST_ != undefined) {
-                console.log(data._ERROR_MESSAGE_LIST_);
+                $('shippingFormServerError').update(data._ERROR_MESSAGE_LIST_);
             } else if (data._ERROR_MESSAGE_ != undefined) {
                 if (data._ERROR_MESSAGE_LIST_ == "SessionTimedOut") {
-                    console.log('session time out');
+                    $('emptyCartCheckoutPanel').show();
+                    $('checkoutPanel').hide();
                 }
-                console.log(data._ERROR_MESSAGE_);
+                $('shippingFormServerError').update(data._ERROR_MESSAGE_);
             } else {
                 // Process Shipping data response.
                 $('shippingPartyId').value = data.partyId;
@@ -248,12 +249,14 @@
             shipMethod = data.shippingDescription;
             shipTotal = data.shippingTotal;
             if (data._ERROR_MESSAGE_LIST_ != undefined) {
-                console.log(data._ERROR_MESSAGE_LIST_);
+                $('shippingOptionFormServerError').update(data._ERROR_MESSAGE_LIST_);
+            
             } else if (data._ERROR_MESSAGE_ != undefined) {
                 if (data._ERROR_MESSAGE_LIST_ == "SessionTimedOut") {
-                    console.log('session time out');
+                    $('emptyCartCheckoutPanel').show();
+                    $('checkoutPanel').hide();
                 }
-                console.log(data._ERROR_MESSAGE_);
+                $('shippingOptionFormServerError').update(data._ERROR_MESSAGE_);
             } else {
                 $('shippingDescription').value = data.shippingDescription;
                 $('shippingTotal').value = data.shippingTotal;
@@ -266,8 +269,7 @@
 }
 
 function setDataInShippingOptionCompleted() {
-    var shipOpt = shipMethod +'-'+shipTotal;
-    $('selectedShipmentOption').update(shipOpt);
+    $('selectedShipmentOption').update($('shipMethod').value);
 }
 
 // Billing
@@ -292,12 +294,13 @@
             var data = transport.responseText.evalJSON(true);
             console.log(data);
             if (data._ERROR_MESSAGE_LIST_ != undefined) {
-                console.log(data._ERROR_MESSAGE_LIST_);
+                $('billingFormServerError').update(data._ERROR_MESSAGE_LIST_);
             } else if (data._ERROR_MESSAGE_ != undefined) {
                 if (data._ERROR_MESSAGE_LIST_="SessionTimedOut") {
-                    console.log('session time out');
+                    $('emptyCartCheckoutPanel').show();
+                    $('checkoutPanel').hide();
                 }
-                console.log(data._ERROR_MESSAGE_);
+                $('billingFormServerError').update(data._ERROR_MESSAGE_);
             } else {
                 $('billToContactMechId').value = data.billToContactMechId;
                 $('paymentMethodId').value = data.paymentMethodId;

Modified: ofbiz/trunk/applications/ecommerce/webapp/ecommerce/order/OnePageCheckoutProcess.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/ecommerce/webapp/ecommerce/order/OnePageCheckoutProcess.ftl?rev=675188&r1=675187&r2=675188&view=diff
==============================================================================
--- ofbiz/trunk/applications/ecommerce/webapp/ecommerce/order/OnePageCheckoutProcess.ftl (original)
+++ ofbiz/trunk/applications/ecommerce/webapp/ecommerce/order/OnePageCheckoutProcess.ftl Wed Jul  9 07:30:45 2008
@@ -269,6 +269,7 @@
                 <input type="hidden" name="userLogin" value="${parameters.userLogin?if_exists}"/>
                 <input type="hidden" id="phoneContactMechId" name="phoneContactMechId" value="${parameters.phoneContactMechId?if_exists}"/>
                 <input type="hidden" id="emailContactMechId" name="emailContactMechId" value="${parameters.emailContactMechId?if_exists}"/>
+                <div id="shippingFormServerError" class="validation-advice"></div>
                           <table>
                             <tr><td width="40%" valign="top">
                                 <div class="form-row">
@@ -408,6 +409,7 @@
 
             <div id="editShippingOptionPanel" class="screenlet-body" style="display: none;">
               <form name="shippingOptionForm" id="shippingOptionForm" action="<@ofbizUrl></@ofbizUrl>" method="post">
+                <div id="shippingOptionFormServerError" class="validation-advice"></div>
                 <table>
                   <tr><td>
                       <div class="form-row">
@@ -473,6 +475,7 @@
                 <input type="hidden" name="userLogin" value="${parameters.userLogin?if_exists}"/>
                 <input type="hidden" name="expireDate" value="${parameters.expireDate?if_exists}"/>
                 <input type="hidden" id="cardType" name="cardType" value="Visa"/>
+                <div id="billingFormServerError" class="validation-advice"></div>
                   <table>
                     <tr><td valign="top">
                         <div class="form-row">