From f4afbada652e0fad251ff2fa4b3fe3ba5fe1e974 Mon Sep 17 00:00:00 2001 From: Deepak Dixit Date: Sat, 23 Dec 2017 10:40:15 +0000 Subject: [PATCH] Improved: Update markup of Shopping Cart page according to standard markup given by Bootstrap v4.0.s (OFBIZ-10104) Thanks Mayank Lambhate for your contribution git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1819135 13f79535-47bb-0310-9956-ffa450edef68 --- .../template/cart/PromoUseDetailsInline.ftl | 80 +++++++++++++++++++ ecommerce/template/cart/ShowCart.ftl | 60 +++++++------- ecommerce/webapp/ecommerce/css/custom.css | 4 + 3 files changed, 113 insertions(+), 31 deletions(-) diff --git a/ecommerce/template/cart/PromoUseDetailsInline.ftl b/ecommerce/template/cart/PromoUseDetailsInline.ftl index 9968f3fed..9181f6a0f 100644 --- a/ecommerce/template/cart/PromoUseDetailsInline.ftl +++ b/ecommerce/template/cart/PromoUseDetailsInline.ftl @@ -9,6 +9,86 @@ 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 022eb3bb7..a313f2fc2 100644 --- a/ecommerce/template/cart/ShowCart.ftl +++ b/ecommerce/template/cart/ShowCart.ftl @@ -222,10 +222,10 @@ under the License. <#else> ${uiLabelMap.CommonQuantity} - ${uiLabelMap.EcommerceUnitPrice} - ${uiLabelMap.EcommerceAdjustments} - ${uiLabelMap.EcommerceItemTotal} - + ${uiLabelMap.EcommerceUnitPrice} + ${uiLabelMap.EcommerceAdjustments} + ${uiLabelMap.EcommerceItemTotal} + @@ -458,9 +458,9 @@ under the License. - <@ofbizCurrency amount=cartLine.getDisplayPrice() isoCode=shoppingCart.getCurrency()/> - <@ofbizCurrency amount=cartLine.getOtherAdjustments() isoCode=shoppingCart.getCurrency()/> - <@ofbizCurrency amount=cartLine.getDisplayItemSubTotal() isoCode=shoppingCart.getCurrency()/> + <@ofbizCurrency amount=cartLine.getDisplayPrice() isoCode=shoppingCart.getCurrency()/> + <@ofbizCurrency amount=cartLine.getOtherAdjustments() isoCode=shoppingCart.getCurrency()/> + <@ofbizCurrency amount=cartLine.getDisplayItemSubTotal() isoCode=shoppingCart.getCurrency()/> <#if !cartLine.getIsPromo()> @@ -471,26 +471,23 @@ under the License. - - - - - - - + + + + <#if shoppingCart.getAdjustments()?has_content> - - + <#if (shoppingCart.getDisplayTaxIncluded() > 0.0)> - - + @@ -498,7 +495,7 @@ under the License. <#list shoppingCart.getAdjustments() as cartAdjustment> <#assign adjustmentType = cartAdjustment.getRelatedOne("OrderAdjustmentType", true) /> - - - - + <#if itemsFromList> - + <#if promoItems> - + <#if !itemsFromList && !promoItems> - + - - - -
- Summary: -
+ Summary: +
${uiLabelMap.CommonSubTotal}: + ${uiLabelMap.CommonSubTotal}: <@ofbizCurrency amount=shoppingCart.getDisplaySubTotal() isoCode=shoppingCart.getCurrency()/>
${uiLabelMap.OrderSalesTaxIncluded}: + ${uiLabelMap.OrderSalesTaxIncluded}: <@ofbizCurrency amount=shoppingCart.getDisplayTaxIncluded() isoCode=shoppingCart.getCurrency()/>
+ ${uiLabelMap.EcommerceAdjustment} - ${adjustmentType.get("description",locale)!} <#if cartAdjustment.productPromoId?has_content> @@ -506,7 +503,7 @@ under the License. : + <@ofbizCurrency amount=Static["org.apache.ofbiz.order.order.OrderReadHelper"] .calcOrderAdjustment(cartAdjustment, shoppingCart.getSubTotal()) isoCode=shoppingCart.getCurrency()/> @@ -515,28 +512,28 @@ under the License.
${uiLabelMap.EcommerceCartTotal}: + ${uiLabelMap.EcommerceCartTotal}: <@ofbizCurrency amount=shoppingCart.getDisplayGrandTotal() isoCode=shoppingCart.getCurrency()/>
L - ${uiLabelMap.EcommerceItemsfromShopingList}.L - ${uiLabelMap.EcommerceItemsfromShopingList}.
P - ${uiLabelMap.EcommercePromotionalItems}.P - ${uiLabelMap.EcommercePromotionalItems}.
  
+ <#if sessionAttributes.userLogin?has_content && sessionAttributes.userLogin.userLoginId != "anonymous">
+ <#if sessionAttributes.userLogin?has_content && sessionAttributes.userLogin.userLoginId != "anonymous">    @@ -579,7 +576,7 @@ under the License.
+
+ + <#else>

${uiLabelMap.EcommerceYourShoppingCartEmpty}.

diff --git a/ecommerce/webapp/ecommerce/css/custom.css b/ecommerce/webapp/ecommerce/css/custom.css index acfcbf614..7e43ee1b8 100644 --- a/ecommerce/webapp/ecommerce/css/custom.css +++ b/ecommerce/webapp/ecommerce/css/custom.css @@ -71,4 +71,8 @@ label.required:after { /*TODO: We will remove this when we eliminate ecommain.css.*/ .card .card-body dl.row > dd { margin-left: 0; +} + +.amount { + text-align:right; } \ No newline at end of file