:-) -- Ashish
On Thu, Sep 22, 2011 at 4:02 PM, Jacques Le Roux < [email protected]> wrote: > Not a bug fix Sascha ;o) > > Jacques > > From: <[email protected]> > > Author: sascharodekamp >> Date: Thu Sep 22 07:42:37 2011 >> New Revision: 1173978 >> >> URL: >> http://svn.apache.org/viewvc?**rev=1173978&view=rev<http://svn.apache.org/viewvc?rev=1173978&view=rev> >> Log: >> OnePageCheckout should reuse UpdateCart while first time rendering ( >> https://issues.apache.org/**jira/browse/OFBIZ-4436<https://issues.apache.org/jira/browse/OFBIZ-4436>) >> A patch from Kiran Gawde which reuses the UpdateCart Screen in the >> OnePageCheckout to avoid code duplication. >> >> Modified: >> ofbiz/branches/release11.04/**specialpurpose/ecommerce/** >> webapp/ecommerce/order/**OnePageCheckoutProcess.ftl >> ofbiz/branches/release11.04/**specialpurpose/ecommerce/** >> widget/OrderScreens.xml >> >> Modified: ofbiz/branches/release11.04/**specialpurpose/ecommerce/** >> webapp/ecommerce/order/**OnePageCheckoutProcess.ftl >> URL: http://svn.apache.org/viewvc/**ofbiz/branches/release11.04/** >> specialpurpose/ecommerce/**webapp/ecommerce/order/** >> OnePageCheckoutProcess.ftl?**rev=1173978&r1=1173977&r2=** >> 1173978&view=diff<http://svn.apache.org/viewvc/ofbiz/branches/release11.04/specialpurpose/ecommerce/webapp/ecommerce/order/OnePageCheckoutProcess.ftl?rev=1173978&r1=1173977&r2=1173978&view=diff> >> ==============================**==============================** >> ================== >> --- ofbiz/branches/release11.04/**specialpurpose/ecommerce/** >> webapp/ecommerce/order/**OnePageCheckoutProcess.ftl (original) >> +++ ofbiz/branches/release11.04/**specialpurpose/ecommerce/** >> webapp/ecommerce/order/**OnePageCheckoutProcess.ftl Thu Sep 22 07:42:37 >> 2011 >> @@ -25,171 +25,7 @@ under the License. >> >> <#-- ==============================**==============================** >> ==============================**==============================**== --> >> <div id="cartPanel" class="screenlet"> >> - <h3>${uiLabelMap.**EcommerceStep} 1: ${uiLabelMap.** >> PageTitleShoppingCart}</h3> >> - <div id="cartSummaryPanel" style="display: none;"> >> - <a href="javascript:void(0);" id="openCartPanel" >> class="button">${uiLabelMap.**EcommerceClickHereToEdit}</a> >> - <table id="cartSummaryPanel_**cartItems" summary="This table >> displays the list of item added into Shopping Cart."> >> - <thead> >> - <tr> >> - <th id="orderItem">${uiLabelMap.**OrderItem}</th> >> - <th id="description">${uiLabelMap.** >> CommonDescription}</th> >> - <th id="unitPrice">${uiLabelMap.** >> EcommerceUnitPrice}</th> >> - <th id="quantity">${uiLabelMap.**OrderQuantity}</th> >> - <th id="adjustment">${uiLabelMap.** >> EcommerceAdjustments}</th> >> - <th id="itemTotal">${uiLabelMap.** >> EcommerceItemTotal}</th> >> - </tr> >> - </thead> >> - <tfoot> >> - <tr id="completedCartSubtotalRow"> >> - <th id="subTotal" scope="row" colspan="5">${uiLabelMap. >> **CommonSubtotal}</th> >> - <td headers="subTotal" >> id="completedCartSubTotal"><@**ofbizCurrency >> amount=shoppingCart.**getSubTotal() isoCode=shoppingCart.**getCurrency() >> /></td> >> - </tr> >> - <#assign orderAdjustmentsTotal = 0 /> >> - <#list shoppingCart.getAdjustments() as cartAdjustment> >> - <#assign orderAdjustmentsTotal = orderAdjustmentsTotal >> + Static["org.ofbiz.order.order.**OrderReadHelper"].** >> calcOrderAdjustment(**cartAdjustment, shoppingCart.getSubTotal()) /> >> - </#list> >> - <tr id="completedCartDiscountRow"> >> - <th id="productDiscount" scope="row" >> colspan="5">${uiLabelMap.**ProductDiscount}</th> >> - <td headers="productDiscount" >> id="completedCartDiscount"><**input type="hidden" >> value="${**orderAdjustmentsTotal}" >> id="**initializedCompletedCartDiscou**nt" /><@ofbizCurrency >> amount=orderAdjustmentsTotal isoCode=shoppingCart.**getCurrency() /></td> >> - </tr> >> - <tr> >> - <th id="shippingAndHandling" scope="row" >> colspan="5">${uiLabelMap.**OrderShippingAndHandling}</th> >> - <td headers="shippingAndHandling" id="** >> completedCartTotalShipping"><@**ofbizCurrency >> amount=shoppingCart.**getTotalShipping() >> isoCode=shoppingCart.**getCurrency() /></td> >> - </tr> >> - <tr> >> - <th id="salesTax" scope="row" colspan="5">${uiLabelMap. >> **OrderSalesTax}</th> >> - <td headers="salesTax" id="** >> completedCartTotalSalesTax"><@**ofbizCurrency >> amount=shoppingCart.**getTotalSalesTax() >> isoCode=shoppingCart.**getCurrency() /></td> >> - </tr> >> - <tr> >> - <th id="grandTotal" scope="row" >> colspan="5">${uiLabelMap.**OrderGrandTotal}</th> >> - <td headers="grandTotal" id="** >> completedCartDisplayGrandTotal**"><@ofbizCurrency >> amount=shoppingCart.**getDisplayGrandTotal() >> isoCode=shoppingCart.**getCurrency() /></td> >> - </tr> >> - </tfoot> >> - <tbody> >> - <#list shoppingCart.items() as cartLine> >> - <#if cartLine.getProductId()?**exists> >> - <#if cartLine.getParentProductId()?**exists> >> - <#assign parentProductId = >> cartLine.getParentProductId() /> >> - <#else> >> - <#assign parentProductId = cartLine.getProductId() >> /> >> - </#if> >> - <#assign smallImageUrl = Static["org.ofbiz.product.* >> *product.ProductContentWrapper"**].getProductContentAsText(**cartLine.getProduct(), >> "SMALL_IMAGE_URL", locale, dispatcher)?if_exists /> >> - <#if !smallImageUrl?string?has_**content><#assign >> smallImageUrl = "" /></#if> >> - </#if> >> - <tr id="cartItemDisplayRow_${**cartLine_index}"> >> - <td headers="orderItem"><img >> src="<@ofbizContentUrl>${**requestAttributes.** >> contentPathPrefix?if_exists}${**smallImageUrl}</@**ofbizContentUrl>" alt >> = "Product Image" /></td> >> - <td headers="description">${** >> cartLine.getName()?if_exists}<**/td> >> - <td headers="unitPrice" id="completedCartItemPrice_${ >> **cartLine_index}">${cartLine.**getDisplayPrice()}</td> >> - <td headers="quantity"><span >> id="completedCartItemQty_${**cartLine_index}">${cartLine.** >> getQuantity()?string.number}</**span></td> >> - <td headers="adjustment"><span id="** >> completedCartItemAdjustment_${**cartLine_index}"><@**ofbizCurrency >> amount=cartLine.**getOtherAdjustments() isoCode=shoppingCart.**getCurrency() >> /></span></td> >> - <td headers="itemTotal" align="right"><span >> id="completedCartItemSubTotal_**${cartLine_index}"><@**ofbizCurrency >> amount=cartLine.**getDisplayItemSubTotal() >> isoCode=shoppingCart.**getCurrency() >> /></span></td> >> - </tr> >> - </#list> >> - </tbody> >> - </table> >> - </div> >> - >> -<#-- ==============================**==============================**= >> --> >> - <div id="editCartPanel"> >> - <form id="cartForm" method="post" action="<@ofbizUrl></@** >> ofbizUrl>"> >> - <fieldset> >> - <input type="hidden" name="removeSelected" >> value="false" /> >> - <div id="cartFormServerError" >> class="errorMessage"></div> >> - <table id="editCartPanel_cartItems"> >> - <thead> >> - <tr> >> - <th id="editOrderItem">${** >> uiLabelMap.OrderItem}</th> >> - <th id="editDescription">${** >> uiLabelMap.CommonDescription}<**/th> >> - <th id="editUnitPrice">${** >> uiLabelMap.EcommerceUnitPrice}**</th> >> - <th id="editQuantity">${** >> uiLabelMap.OrderQuantity}</th> >> - <th id="editAdjustment">${**uiLabelMap.** >> EcommerceAdjustments}</th> >> - <th id="editItemTotal">${** >> uiLabelMap.EcommerceItemTotal}**</th> >> - <th id="removeItem">${uiLabelMap.** >> FormFieldTitle_removeButton}</**th> >> - </tr> >> - </thead> >> - <tfoot> >> - <tr> >> - <th scope="row" colspan="6">${uiLabelMap.** >> CommonSubtotal}</th> >> - <td id="cartSubTotal"><@**ofbizCurrency >> amount=shoppingCart.**getSubTotal() isoCode=shoppingCart.**getCurrency() >> /></td> >> - </tr> >> - <tr> >> - <th scope="row" colspan="6">${uiLabelMap.** >> ProductDiscount}</th> >> - <td id="cartDiscountValue"> >> - <#assign orderAdjustmentsTotal = 0 /> >> - <#list shoppingCart.getAdjustments() as >> cartAdjustment> >> - <#assign orderAdjustmentsTotal = >> orderAdjustmentsTotal + Static["org.ofbiz.order.order.** >> OrderReadHelper"].**calcOrderAdjustment(**cartAdjustment, >> shoppingCart.getSubTotal()) /> >> - </#list> >> - <@ofbizCurrency amount=orderAdjustmentsTotal >> isoCode=shoppingCart.**getCurrency() /> >> - </td> >> - </tr> >> - <tr> >> - <th scope="row" colspan="6">${uiLabelMap.** >> OrderShippingAndHandling}</th> >> - <td id="cartTotalShipping"><@**ofbizCurrency >> amount=shoppingCart.**getTotalShipping() isoCode=shoppingCart.**getCurrency() >> /></td> >> - </tr> >> - <tr> >> - <th scope="row" colspan="6">${uiLabelMap.** >> OrderSalesTax}</th> >> - <td id="cartTotalSalesTax"><@**ofbizCurrency >> amount=shoppingCart.**getTotalSalesTax() isoCode=shoppingCart.**getCurrency() >> /></td> >> - </tr> >> - <tr> >> - <th scope="row" colspan="6">${uiLabelMap.** >> OrderGrandTotal}</th> >> - <td id="cartDisplayGrandTotal"><@**ofbizCurrency >> amount=shoppingCart.**getDisplayGrandTotal() >> isoCode=shoppingCart.**getCurrency() >> /></td> >> - </tr> >> - </tfoot> >> - <tbody id="updateBody"> >> - <#list shoppingCart.items() as cartLine> >> - <tr id="cartItemRow_${cartLine_**index}"> >> - <td headers="editOrderItem"> >> - <#if cartLine.getProductId()?**exists> >> - <#if cartLine.getParentProductId()?** >> exists> >> - <#assign parentProductId = >> cartLine.getParentProductId() /> >> - <#else> >> - <#assign parentProductId = >> cartLine.getProductId() /> >> - </#if> >> - <#assign smallImageUrl = >> Static["org.ofbiz.product.**product.ProductContentWrapper"** >> ].getProductContentAsText(**cartLine.getProduct(), "SMALL_IMAGE_URL", >> locale, dispatcher)?if_exists /> >> - <#if >> !smallImageUrl?string?has_**content><#assign >> smallImageUrl = "" /></#if> >> - <#if smallImageUrl?string?has_**content> >> - <img src="<@ofbizContentUrl>${** >> requestAttributes.**contentPathPrefix?if_exists}${**smallImageUrl}</@**ofbizContentUrl>" >> alt="Product Image" /> >> - </#if> >> - </#if> >> - </td> >> - <td headers="editDescription">${** >> cartLine.getName()?if_exists}<**/td> >> - <td headers="editUnitPrice" >> id="itemUnitPrice_${cartLine_**index}"><@ofbizCurrency >> amount=cartLine.**getDisplayPrice() >> isoCode=shoppingCart.**getCurrency() /></td> >> - <td headers="editQuantity"> >> - <#if cartLine.getIsPromo()> >> - ${cartLine.getQuantity()?**string.number} >> - <#else> >> - <input type="hidden" >> name="cartLineProductId" id="cartLineProductId_${**cartLine_index}" >> value="${cartLine.**getProductId()}" /> >> - <input type="text" >> name="update${cartLine_index}" id="qty_${cartLine_index}" >> value="${cartLine.getQuantity(**)?string.number}" class="required >> validate-number" /> >> - <span >> id="advice-required-qty_${**cartLine_index}" >> style="display:none;" class="errorMessage"> (${uiLabelMap.CommonRequired}) >> **</span> >> - <span >> id="advice-validate-number-**qty_${cartLine_index}" >> style="display:none;" class="errorMessage"> (${uiLabelMap.** >> CommonPleaseEnterValidNumberIn**ThisField}) </span> >> - </#if> >> - </td> >> - <#if !cartLine.getIsPromo()> >> - <td headers="editAdjustment" >> id="addPromoCode_${cartLine_**index}"><@ofbizCurrency >> amount=cartLine.**getOtherAdjustments() >> isoCode=shoppingCart.**getCurrency() /></td> >> - <#else> >> - <td headers="editAdjustment"><@**ofbizCurrency >> amount=cartLine.**getOtherAdjustments() isoCode=shoppingCart.**getCurrency() >> /></td> >> - </#if> >> - <td headers="editItemTotal" >> id="displayItem_${cartLine_**index}"><@ofbizCurrency >> amount=cartLine.**getDisplayItemSubTotal() >> isoCode=shoppingCart.**getCurrency() /></td> >> - <#if !cartLine.getIsPromo()> >> - <td><a id="removeItemLink_${cartLine_**index}" >> href="javascript:void(0);"><**img id="remove_${cartLine_index}" >> src="<@ofbizContentUrl>/**ecommerce/images/remove.png</@**ofbizContentUrl>" >> alt="Remove Item Image" /></a></td> >> - </#if> >> - </tr> >> - </#list> >> - </tbody> >> - </table> >> - </fieldset> >> - <fieldset id="productPromoCodeFields"> >> - <div> >> - <label for="productPromoCode">${**uiLabelMap.** >> EcommerceEnterPromoCode}</**label> >> - <input id="productPromoCode" >> name="productPromoCode" type="text" value="" /> >> - </div> >> - </fieldset> >> - <fieldset> >> - <a href="javascript:void(0);" class="button" >> id="updateShoppingCart" >${uiLabelMap.**EcommerceContinueToStep} 2</a> >> - <a style="display: none" class="button" >> href="javascript:void(0);" id="processingShipping">${**uiLabelMap.** >> EcommercePleaseWait}....</a> >> - </fieldset> >> - </form> >> - </div> >> + ${screens.render("component://**ecommerce/widget/CartScreens.* >> *xml#UpdateCart")} >> </div> >> >> <#-- ==============================**==============================** >> ==============================**==============================**== --> >> @@ -257,7 +93,7 @@ under the License. >> <span> >> <label for="shipToCountryCode">${** >> uiLabelMap.PartyCountry}* >> <span id="advice-required-**shipToCountryCode" >> style="display:none" class="errorMessage"> (${uiLabelMap.CommonRequired}) >> **</span> >> - </label> >> + </label> >> <input type="text" name="shipToCountryCode" >> class="required" id="shipToCountryCode" >> value="${shipToTelecomNumber.**countryCode?if_exists}" >> size="5" maxlength="3" /> - >> </span> >> <span> >> @@ -475,7 +311,7 @@ under the License. >> <input id="lastNameOnCard" >> name="lastNameOnCard" class="required" type="text" >> value="${lastNameOnCard?if_**exists}" /> >> </span> >> </div> >> - <div> >> + <div> >> <#if billToTelecomNumber?has_**content> >> <span> >> <label for="billToCountryCode">${** >> uiLabelMap.PartyCountry}* >> >> Modified: ofbiz/branches/release11.04/**specialpurpose/ecommerce/** >> widget/OrderScreens.xml >> URL: http://svn.apache.org/viewvc/**ofbiz/branches/release11.04/** >> specialpurpose/ecommerce/**widget/OrderScreens.xml?rev=** >> 1173978&r1=1173977&r2=1173978&**view=diff<http://svn.apache.org/viewvc/ofbiz/branches/release11.04/specialpurpose/ecommerce/widget/OrderScreens.xml?rev=1173978&r1=1173977&r2=1173978&view=diff> >> ==============================**==============================** >> ================== >> --- >> ofbiz/branches/release11.04/**specialpurpose/ecommerce/**widget/OrderScreens.xml >> (original) >> +++ >> ofbiz/branches/release11.04/**specialpurpose/ecommerce/**widget/OrderScreens.xml >> Thu Sep 22 07:42:37 2011 >> @@ -613,7 +613,6 @@ under the License. >> <set field="titleProperty" value="** >> EcommerceOnePageCheckout"/> >> <set field="layoutSettings.**javaScripts[]" >> value="/ecommerce/images/**checkoutProcess.js" global="true"/> >> <set field="layoutSettings.**javaScripts[]" >> value="/ordermgr/images/js/**geoAutoCompleter.js" global="true"/> >> - <script location="component://** >> ecommerce/webapp/ecommerce/**WEB-INF/actions/cart/ShowCart.**groovy"/> >> <script location="component://** >> ecommerce/webapp/ecommerce/**WEB-INF/actions/customer/** >> EditShippingAddress.groovy"/> >> <script location="component://** >> ecommerce/webapp/ecommerce/**WEB-INF/actions/customer/** >> EditBillingAddress.groovy"/> >> <script location="component://** >> ecommerce/webapp/ecommerce/**WEB-INF/actions/customer/** >> EditEmailAndTelecomNumber.**groovy"/> >> >> >>
