From b7af0335b4a482d99b28188c19e3644174ca55ee Mon Sep 17 00:00:00 2001 From: Deepak Dixit Date: Mon, 25 Dec 2017 09:28:38 +0000 Subject: [PATCH] Improved: Update markup of One Page checkout page and improve markup on Shopping Cart according to standard markup given by Bootstrap 4. (OFBIZ-10126) Thanks Mayank for your contribution git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1819239 13f79535-47bb-0310-9956-ffa450edef68 --- .../template/cart/PromoUseDetailsInline.ftl | 80 ---- ecommerce/template/cart/ShowCart.ftl | 33 +- ecommerce/template/cart/UpdateCart.ftl | 108 ++--- .../template/order/OnePageCheckoutProcess.ftl | 435 ++++++++---------- 4 files changed, 270 insertions(+), 386 deletions(-) diff --git a/ecommerce/template/cart/PromoUseDetailsInline.ftl b/ecommerce/template/cart/PromoUseDetailsInline.ftl index 9181f6a0f..9968f3fed 100644 --- a/ecommerce/template/cart/PromoUseDetailsInline.ftl +++ b/ecommerce/template/cart/PromoUseDetailsInline.ftl @@ -9,86 +9,6 @@ with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, -software distributed under the License is distributed on an -"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, either express or implied. See the License for the -specific language governing permissions and limitations -under the License. ---> -

${uiLabelMap.OrderPromotionInformation}:

-
-
-

${uiLabelMap.OrderPromotionsApplied}:

-
    - <#list shoppingCart.getProductPromoUseInfoIter() as productPromoUseInfo> -
  • - <#-- TODO: when promo pretty print is done show promo short description here --> - ${uiLabelMap.OrderPromotion} ${uiLabelMap.CommonDetails} - <#if productPromoUseInfo.productPromoCodeId?has_content> - ${uiLabelMap.OrderWithPromoCode} [${productPromoUseInfo.productPromoCodeId}] - <#if (productPromoUseInfo.totalDiscountAmount != 0)> - ${uiLabelMap.CommonTotalValue} <@ofbizCurrency amount=(-1*productPromoUseInfo.totalDiscountAmount) isoCode=shoppingCart.getCurrency()/> - <#if productPromoUseInfo.productPromoCodeId?has_content> - ${uiLabelMap.OrderRemovePromotion} - -
  • - <#if (productPromoUseInfo.quantityLeftInActions > 0)> -
  • - Could be used for ${productPromoUseInfo.quantityLeftInActions} more discounted item<#if (productPromoUseInfo.quantityLeftInActions > 1)>s if added to your cart.
  • - - -
-
- -
-

${uiLabelMap.OrderCartItemUseinPromotions}:

-
    - <#list shoppingCart.items() as cartLine> - <#assign cartLineIndex = shoppingCart.getItemIndex(cartLine)> - <#if cartLine.getIsPromo()> -
  • ${uiLabelMap.OrderItemN} ${cartLineIndex+1} [${cartLine.getProductId()!}] - ${uiLabelMap.OrderIsAPromotionalItem}
  • - <#else> -
  • ${uiLabelMap.OrderItemN} ${cartLineIndex+1} [${cartLine.getProductId()!}] - ${cartLine.getPromoQuantityUsed()?string.number}/${cartLine.getQuantity()?string.number} ${uiLabelMap.CommonUsed} - ${cartLine.getPromoQuantityAvailable()?string.number} ${uiLabelMap.CommonAvailable} -
      - <#list cartLine.getQuantityUsedPerPromoActualIter() as quantityUsedPerPromoActualEntry> - <#assign productPromoActualPK = quantityUsedPerPromoActualEntry.getKey()> - <#assign actualQuantityUsed = quantityUsedPerPromoActualEntry.getValue()> - <#assign isQualifier = "ProductPromoCond" == productPromoActualPK.getEntityName()> -
    •   - ${actualQuantityUsed} ${uiLabelMap.CommonUsedAs} <#if isQualifier>${uiLabelMap.CommonQualifier}<#else>${uiLabelMap.CommonBenefit} ${uiLabelMap.OrderOfPromotion} ${uiLabelMap.CommonDetails}
    • - - -
    -
      - <#list cartLine.getQuantityUsedPerPromoFailedIter() as quantityUsedPerPromoFailedEntry> - <#assign productPromoFailedPK = quantityUsedPerPromoFailedEntry.getKey()> - <#assign failedQuantityUsed = quantityUsedPerPromoFailedEntry.getValue()> - <#assign isQualifier = "ProductPromoCond" == productPromoFailedPK.getEntityName()> -
    •   - ${uiLabelMap.CommonCouldBeUsedAs} <#if isQualifier>${uiLabelMap.CommonQualifier}<#else>${uiLabelMap.CommonBenefit} ${uiLabelMap.OrderOfPromotion} ${uiLabelMap.CommonDetails}
    • - - -
    - <#list cartLine.getQuantityUsedPerPromoCandidateIter() as quantityUsedPerPromoCandidateEntry> - <#assign productPromoCandidatePK = quantityUsedPerPromoCandidateEntry.getKey()> - <#assign candidateQuantityUsed = quantityUsedPerPromoCandidateEntry.getValue()> - <#assign isQualifier = "ProductPromoCond" == productPromoCandidatePK.getEntityName()> - - - -
  • - - -
-
-
-<#-- -Licensed to the Apache Software Foundation (ASF) under one -or more contributor license agreements. See the NOTICE file -distributed with this work for additional information -regarding copyright ownership. The ASF licenses this file -to you under the Apache License, Version 2.0 (the -"License"); you may not use this file except in compliance -with the License. You may obtain a copy of the License at - -http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY diff --git a/ecommerce/template/cart/ShowCart.ftl b/ecommerce/template/cart/ShowCart.ftl index a313f2fc2..5edab318d 100644 --- a/ecommerce/template/cart/ShowCart.ftl +++ b/ecommerce/template/cart/ShowCart.ftl @@ -73,7 +73,6 @@ under the License. <#assign fixedAssetExist = shoppingCart.containAnyWorkEffortCartItems() /> <#-- change display format when rental items exist in the shoppingcart -->
-

<#if ((sessionAttributes.lastViewedProducts)?has_content && sessionAttributes.lastViewedProducts?size > 0)> <#assign continueLink = "/product?product_id=" + sessionAttributes.lastViewedProducts.get(0) /> <#else> @@ -92,7 +91,6 @@ under the License. ${uiLabelMap.CommonQuickAdd} -

-
${uiLabelMap.OrderShoppingCart} @@ -188,13 +185,13 @@ under the License. - + <#if asslGiftWraps?has_content && productStore.showCheckoutGiftOptions! != "N">> - + @@ -535,7 +532,8 @@ under the License.
${uiLabelMap.OrderProduct} - <#list allgiftWraps as option> @@ -279,12 +276,12 @@ under the License. <#-- ${cartLineIndex} - -->
-

+

${cartLine.getProductId()} - ${cartLine.getName(dispatcher)!} -

+ ${cartLine.getDescription(dispatcher)!} <#-- For configurable products, the selected options are shown --> <#if cartLine.getConfigWrapper()??> @@ -472,7 +469,7 @@ under the License.
Summary:
<#if sessionAttributes.userLogin?has_content && sessionAttributes.userLogin.userLoginId != "anonymous"> - <#if shoppingLists?has_content> <#list shoppingLists as shoppingList> @@ -544,10 +542,12 @@ under the License. -    - + + ${uiLabelMap.EcommerceAddSelectedtoList} -    + + + <#else> ${uiLabelMap.OrderYouMust} @@ -560,7 +560,6 @@ under the License.
<#if sessionAttributes.userLogin?has_content && sessionAttributes.userLogin.userLoginId != "anonymous"> -    ${uiLabelMap.OrderCreateCustRequestFromCart}      @@ -588,7 +587,7 @@ under the License.
<#else> -

${uiLabelMap.EcommerceYourShoppingCartEmpty}.

+

${uiLabelMap.EcommerceYourShoppingCartEmpty}.

<#-- Copy link bar to bottom to include a link bar at the bottom too -->
@@ -597,7 +596,7 @@ under the License.
-

${uiLabelMap.ProductPromoCodes}

+

${uiLabelMap.ProductPromoCodes}

@@ -627,7 +626,7 @@ under the License. <#if showPromoText?? && showPromoText>
-

${uiLabelMap.OrderSpecialOffers}

+

${uiLabelMap.OrderSpecialOffers}

<#-- show promotions text --> @@ -651,7 +650,7 @@ under the License. <#if associatedProducts?has_content>
-

${uiLabelMap.EcommerceYouMightAlsoIntrested}:

+

${uiLabelMap.EcommerceYouMightAlsoIntrested}:

<#-- random complementary products --> diff --git a/ecommerce/template/cart/UpdateCart.ftl b/ecommerce/template/cart/UpdateCart.ftl index 0152e3d78..d3efe8c1b 100644 --- a/ecommerce/template/cart/UpdateCart.ftl +++ b/ecommerce/template/cart/UpdateCart.ftl @@ -18,24 +18,25 @@ under the License. --> <#if shoppingCart?has_content && shoppingCart.size() > 0> -

${uiLabelMap.EcommerceStep} 1: ${uiLabelMap.PageTitleShoppingCart}

-
-
- - +
+ - + - - + + + - - + + - - + + - - + + - - + + - - + + @@ -183,7 +190,7 @@ under the License. - <#if !cartLine.getIsPromo()> - <#else> - - <#if !cartLine.getIsPromo()> @@ -227,21 +234,18 @@ under the License.
${uiLabelMap.OrderItem} ${uiLabelMap.CommonDescription}${uiLabelMap.EcommerceUnitPrice}${uiLabelMap.EcommerceUnitPrice} ${uiLabelMap.OrderQuantity}${uiLabelMap.EcommerceAdjustments}${uiLabelMap.EcommerceItemTotal}${uiLabelMap.EcommerceAdjustments}${uiLabelMap.EcommerceItemTotal} ${uiLabelMap.FormFieldTitle_removeButton}
Summary
${uiLabelMap.CommonSubtotal} + ${uiLabelMap.CommonSubtotal} <@ofbizCurrency amount=shoppingCart.getSubTotal() isoCode=shoppingCart.getCurrency() />  
${uiLabelMap.ProductDiscount} + ${uiLabelMap.ProductDiscount} <#assign orderAdjustmentsTotal = 0 /> <#list shoppingCart.getAdjustments() as cartAdjustment> <#assign orderAdjustmentsTotal = orderAdjustmentsTotal + @@ -142,24 +145,28 @@ under the License. <@ofbizCurrency amount=orderAdjustmentsTotal isoCode=shoppingCart.getCurrency() />  
${uiLabelMap.OrderShippingAndHandling} + ${uiLabelMap.OrderShippingAndHandling} <@ofbizCurrency amount=shoppingCart.getTotalShipping() isoCode=shoppingCart.getCurrency() />  
${uiLabelMap.OrderSalesTax} + ${uiLabelMap.OrderSalesTax} <@ofbizCurrency amount=shoppingCart.getTotalSalesTax() isoCode=shoppingCart.getCurrency() />  
${uiLabelMap.OrderGrandTotal} - <@ofbizCurrency amount=shoppingCart.getDisplayGrandTotal() isoCode=shoppingCart.getCurrency() /> + ${uiLabelMap.OrderGrandTotal} + <@ofbizCurrency amount=shoppingCart.getDisplayGrandTotal() isoCode=shoppingCart.getCurrency() />  
${cartLine.getName(dispatcher)!} + <@ofbizCurrency amount=cartLine.getDisplayPrice() isoCode=shoppingCart.getCurrency() /> @@ -203,15 +210,15 @@ under the License. + <@ofbizCurrency amount=cartLine.getOtherAdjustments() isoCode=shoppingCart.getCurrency() /> + <@ofbizCurrency amount=cartLine.getOtherAdjustments() isoCode=shoppingCart.getCurrency() /> + <@ofbizCurrency amount=cartLine.getDisplayItemSubTotal() isoCode=shoppingCart.getCurrency() />
-
-
-
- - +
+ +
-
-
- + ${uiLabelMap.EcommerceContinueToStep} 2 -
+
+
diff --git a/ecommerce/template/order/OnePageCheckoutProcess.ftl b/ecommerce/template/order/OnePageCheckoutProcess.ftl index c18d9ac15..587bea2a1 100644 --- a/ecommerce/template/order/OnePageCheckoutProcess.ftl +++ b/ecommerce/template/order/OnePageCheckoutProcess.ftl @@ -19,7 +19,7 @@ under the License.
<#assign shoppingCart = sessionAttributes.shoppingCart! /> -

${uiLabelMap.OrderCheckout}

+

${uiLabelMap.EcommerceOnePageCheckout}

<#if shoppingCart?has_content && shoppingCart.size() > 0>
@@ -29,38 +29,31 @@ under the License.
<#-- ========================================================================================================================== --> -
-

${uiLabelMap.EcommerceStep} 2: ${uiLabelMap.FacilityShipping}

-