svn commit: r1068286 - /ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/order/checkoutshippingoptions.ftl

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

svn commit: r1068286 - /ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/order/checkoutshippingoptions.ftl

jleroux@apache.org
Author: jleroux
Date: Tue Feb  8 08:04:36 2011
New Revision: 1068286

URL: http://svn.apache.org/viewvc?rev=1068286&view=rev
Log:
A patch from Stephen Rufle "Checkout Shipping Options" (https://issues.apache.org/jira/browse/OFBIZ-4162) - OFBIZ-4162

When the user selects a shipping option and moves to the next step and then comes back to the "Shipping Options" step the previously selected value is not selected on the screen. This is because in the ftl a comparison is made between shippingMethod and chosenShippingMethod. chosenShippingMethod is being escaped so the values will never match. The solution is to use wrapString on chosenShippingMethod.

# Add a product to the cart
# login as any user I used "admin"
# Checkout Step "Shipping Address" (Step 1: Where shall we ship it?)
    * Click Next
# Checkout Step "Shipping Options" (Step 2: How shall we ship it?)
    * Choose "UPS Air"
    * Click Next
# Checkout Step "Payment Options" (Step 3: How shall you pay?)
    * Click "Browser" back button, in my code had a request that directed back a step, but this shows the issue
# ISSUE: Now "UPS Air" is no longer selected, after my patch it will be

JLR: this was only with modified code, but it makes sense and can't hurt. I will not backport though

Modified:
    ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/order/checkoutshippingoptions.ftl

Modified: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/order/checkoutshippingoptions.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/order/checkoutshippingoptions.ftl?rev=1068286&r1=1068285&r2=1068286&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/order/checkoutshippingoptions.ftl (original)
+++ ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/order/checkoutshippingoptions.ftl Tue Feb  8 08:04:36 2011
@@ -71,7 +71,7 @@ function submitForm(form, mode, value) {
                 <#assign shippingMethod = carrierShipmentMethod.shipmentMethodTypeId + "@" + carrierShipmentMethod.partyId>
                 <tr>
                   <td width="1%" valign="top" >
-                    <input type="radio" name="shipping_method" value="${shippingMethod}" <#if shippingMethod == chosenShippingMethod?default("N@A")>checked="checked"</#if> />
+                    <input type="radio" name="shipping_method" value="${shippingMethod}" <#if shippingMethod == StringUtil.wrapString(chosenShippingMethod!"N@A")>checked="checked"</#if> />
                   </td>
                   <td valign="top">
                     <div class="tabletext">