svn commit: r691980 - in /ofbiz/trunk/applications/ecommerce/webapp/ecommerce: WEB-INF/actions/customer/EditBillingAddress.groovy 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: r691980 - in /ofbiz/trunk/applications/ecommerce/webapp/ecommerce: WEB-INF/actions/customer/EditBillingAddress.groovy order/OnePageCheckoutProcess.ftl

mor-2
Author: mor
Date: Thu Sep  4 04:51:19 2008
New Revision: 691980

URL: http://svn.apache.org/viewvc?rev=691980&view=rev
Log:
Misc. improvements on One page checkout.
If a user has both shipping and billing addresses same then on moving to Step 4, Billing address form comes hidden and
check box "Billing address is same as the shipping address" checked.

Patch from Brajesh Patel.


Modified:
    ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/customer/EditBillingAddress.groovy
    ofbiz/trunk/applications/ecommerce/webapp/ecommerce/order/OnePageCheckoutProcess.ftl

Modified: ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/customer/EditBillingAddress.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/customer/EditBillingAddress.groovy?rev=691980&r1=691979&r2=691980&view=diff
==============================================================================
--- ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/customer/EditBillingAddress.groovy (original)
+++ ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/customer/EditBillingAddress.groovy Thu Sep  4 04:51:19 2008
@@ -25,8 +25,9 @@
     party = userLogin.getRelatedOne("Party");
     contactMech = EntityUtil.getFirst(ContactHelper.getContactMech(party, "BILLING_LOCATION", "POSTAL_ADDRESS", false));
     if (contactMech) {
-        postalAddress = contactMech.getRelatedOne("PostalAddress");    
-        context.billToContactMechId = postalAddress.contactMechId;
+        postalAddress = contactMech.getRelatedOne("PostalAddress");
+        billToContactMechId = postalAddress.contactMechId;
+        context.billToContactMechId = billToContactMechId;
         context.billToAddress1 = postalAddress.address1;
         context.billToAddress2 = postalAddress.address2;
         context.billToCity = postalAddress.city;
@@ -64,5 +65,10 @@
             context.expMonth = (creditCard.expireDate).substring(0, 2);
             context.expYear = (creditCard.expireDate).substring(3);
        }
+    }
+    if (shipToContactMechId) {
+        if (billToContactMechId && billToContactMechId.equals(shipToContactMechId)) {
+            context.put("useShippingAddressForBilling", "Y");
+        }
     }    
 }
\ No newline at end of file

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=691980&r1=691979&r2=691980&view=diff
==============================================================================
--- ofbiz/trunk/applications/ecommerce/webapp/ecommerce/order/OnePageCheckoutProcess.ftl (original)
+++ ofbiz/trunk/applications/ecommerce/webapp/ecommerce/order/OnePageCheckoutProcess.ftl Thu Sep  4 04:51:19 2008
@@ -524,11 +524,9 @@
                   <td width="20%">&nbsp;</td>
                   <td valign="top">
                     <div class="form-row">
-                      <div>
-                        <input class="checkbox" id="useShippingAddressForBilling" name="useShippingAddressForBilling" type="checkbox" value="Y" <#if parameters.useShippingAddressForBilling?has_content && parameters.useShippingAddressForBilling?default("")=="Y">checked</#if>> ${uiLabelMap.FacilityBillingAddressSameShipping}
-                      </div>
+                      <div><input class="checkbox" id="useShippingAddressForBilling" name="useShippingAddressForBilling" type="checkbox" value="Y" <#if useShippingAddressForBilling?has_content && useShippingAddressForBilling?default("")=="Y">checked</#if>>${uiLabelMap.FacilityBillingAddressSameShipping}</div>
                     </div>
-                    <div id="billingAddress" <#if parameters.useShippingAddressForBilling?has_content && parameters.useShippingAddressForBilling?default("")=="Y">style="display:none"</#if>>
+                    <div id="billingAddress" <#if useShippingAddressForBilling?has_content && useShippingAddressForBilling?default("")=="Y">style="display:none"</#if>>
                       <div class="form-row">
                         <div class="field-label">
                           <label for="address1">${uiLabelMap.PartyAddressLine1}*<span id="advice-required-billToAddress1" style="display:none" class="errorMessage"> (required)</span></label>