Author: deepak
Date: Sat Dec 23 10:40:15 2017
New Revision: 1819135

URL: http://svn.apache.org/viewvc?rev=1819135&view=rev
Log:
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

Modified:
    ofbiz/ofbiz-plugins/trunk/ecommerce/template/cart/PromoUseDetailsInline.ftl
    ofbiz/ofbiz-plugins/trunk/ecommerce/template/cart/ShowCart.ftl
    ofbiz/ofbiz-plugins/trunk/ecommerce/webapp/ecommerce/css/custom.css

Modified: 
ofbiz/ofbiz-plugins/trunk/ecommerce/template/cart/PromoUseDetailsInline.ftl
URL: 
http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/ecommerce/template/cart/PromoUseDetailsInline.ftl?rev=1819135&r1=1819134&r2=1819135&view=diff
==============================================================================
--- ofbiz/ofbiz-plugins/trunk/ecommerce/template/cart/PromoUseDetailsInline.ftl 
(original)
+++ ofbiz/ofbiz-plugins/trunk/ecommerce/template/cart/PromoUseDetailsInline.ftl 
Sat Dec 23 10:40:15 2017
@@ -77,4 +77,84 @@ under the License.
         </#list>
     </ul>
   </div>
+</div>
+<#--
+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
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<h2>${uiLabelMap.OrderPromotionInformation}:</h2>
+<div class="row">
+  <div class="col-xl-6">
+    <h3>${uiLabelMap.OrderPromotionsApplied}:</h3>
+        <ul>
+            <#list shoppingCart.getProductPromoUseInfoIter() as 
productPromoUseInfo>
+                <li>
+                    <#-- TODO: when promo pretty print is done show promo 
short description here -->
+                    <a 
href="<@ofbizUrl>showPromotionDetails?productPromoId=${productPromoUseInfo.productPromoId!}</@ofbizUrl>">${uiLabelMap.OrderPromotion}
 ${uiLabelMap.CommonDetails}</a>
+                    <#if productPromoUseInfo.productPromoCodeId?has_content> - 
${uiLabelMap.OrderWithPromoCode} 
[${productPromoUseInfo.productPromoCodeId}]</#if>
+                    <#if (productPromoUseInfo.totalDiscountAmount != 0)> - 
${uiLabelMap.CommonTotalValue} <@ofbizCurrency 
amount=(-1*productPromoUseInfo.totalDiscountAmount) 
isoCode=shoppingCart.getCurrency()/></#if>
+                    <#if productPromoUseInfo.productPromoCodeId?has_content>
+                        <a 
href="<@ofbizUrl>removePromotion?promoCode=${productPromoUseInfo.productPromoCodeId!}</@ofbizUrl>">${uiLabelMap.OrderRemovePromotion}</a>
+                    </#if>
+                </li>
+                <#if (productPromoUseInfo.quantityLeftInActions > 0)>
+                    <li>- Could be used for 
${productPromoUseInfo.quantityLeftInActions} more discounted item<#if 
(productPromoUseInfo.quantityLeftInActions > 1)>s</#if> if added to your 
cart.</li>
+                </#if>
+            </#list>
+        </ul>
+  </div>
+
+  <div class="col-xl-6">
+    <h3>${uiLabelMap.OrderCartItemUseinPromotions}:</h3>
+    <ul>
+        <#list shoppingCart.items() as cartLine>
+            <#assign cartLineIndex = shoppingCart.getItemIndex(cartLine)>
+            <#if cartLine.getIsPromo()>
+                <li>${uiLabelMap.OrderItemN} ${cartLineIndex+1} 
[${cartLine.getProductId()!}] - ${uiLabelMap.OrderIsAPromotionalItem}</li>
+            <#else>
+                <li>${uiLabelMap.OrderItemN} ${cartLineIndex+1} 
[${cartLine.getProductId()!}] - 
${cartLine.getPromoQuantityUsed()?string.number}/${cartLine.getQuantity()?string.number}
 ${uiLabelMap.CommonUsed} - 
${cartLine.getPromoQuantityAvailable()?string.number} 
${uiLabelMap.CommonAvailable}
+                    <ul>
+                        <#list cartLine.getQuantityUsedPerPromoActualIter() as 
quantityUsedPerPromoActualEntry>
+                            <#assign productPromoActualPK = 
quantityUsedPerPromoActualEntry.getKey()>
+                            <#assign actualQuantityUsed = 
quantityUsedPerPromoActualEntry.getValue()>
+                            <#assign isQualifier = "ProductPromoCond" == 
productPromoActualPK.getEntityName()>
+                            <li>&nbsp;&nbsp;-&nbsp;${actualQuantityUsed} 
${uiLabelMap.CommonUsedAs} <#if 
isQualifier>${uiLabelMap.CommonQualifier}<#else>${uiLabelMap.CommonBenefit}</#if>
 ${uiLabelMap.OrderOfPromotion} <a 
href="<@ofbizUrl>showPromotionDetails?productPromoId=${productPromoActualPK.productPromoId}</@ofbizUrl>">${uiLabelMap.CommonDetails}</a></li>
+                            <!-- productPromoActualPK 
${productPromoActualPK.toString()} -->
+                        </#list>
+                    </ul>
+                    <ul>
+                        <#list cartLine.getQuantityUsedPerPromoFailedIter() as 
quantityUsedPerPromoFailedEntry>
+                            <#assign productPromoFailedPK = 
quantityUsedPerPromoFailedEntry.getKey()>
+                            <#assign failedQuantityUsed = 
quantityUsedPerPromoFailedEntry.getValue()>
+                            <#assign isQualifier = "ProductPromoCond" == 
productPromoFailedPK.getEntityName()>
+                            
<li>&nbsp;&nbsp;-&nbsp;${uiLabelMap.CommonCouldBeUsedAs} <#if 
isQualifier>${uiLabelMap.CommonQualifier}<#else>${uiLabelMap.CommonBenefit}</#if>
 ${uiLabelMap.OrderOfPromotion} <a 
href="<@ofbizUrl>showPromotionDetails?productPromoId=${productPromoFailedPK.productPromoId}</@ofbizUrl>">${uiLabelMap.CommonDetails}</a></li>
+                            <!-- Total times checked but failed: 
${failedQuantityUsed}, productPromoFailedPK ${productPromoFailedPK.toString()} 
-->
+                        </#list>
+                    </ul>
+                    <#list cartLine.getQuantityUsedPerPromoCandidateIter() as 
quantityUsedPerPromoCandidateEntry>
+                        <#assign productPromoCandidatePK = 
quantityUsedPerPromoCandidateEntry.getKey()>
+                        <#assign candidateQuantityUsed = 
quantityUsedPerPromoCandidateEntry.getValue()>
+                        <#assign isQualifier = "ProductPromoCond" == 
productPromoCandidatePK.getEntityName()>
+                        <!-- Left over not reset or confirmed, shouldn't 
happen: ${candidateQuantityUsed} Might be Used (Candidate) as <#if 
isQualifier>${uiLabelMap.CommonQualifier}<#else>${uiLabelMap.CommonBenefit}</#if>
 ${uiLabelMap.OrderOfPromotion} [${productPromoCandidatePK.productPromoId}] -->
+                        <!-- productPromoCandidatePK 
${productPromoCandidatePK.toString()} -->
+                    </#list>
+                </li>
+            </#if>
+        </#list>
+    </ul>
+  </div>
 </div>
\ No newline at end of file

Modified: ofbiz/ofbiz-plugins/trunk/ecommerce/template/cart/ShowCart.ftl
URL: 
http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/ecommerce/template/cart/ShowCart.ftl?rev=1819135&r1=1819134&r2=1819135&view=diff
==============================================================================
--- ofbiz/ofbiz-plugins/trunk/ecommerce/template/cart/ShowCart.ftl (original)
+++ ofbiz/ofbiz-plugins/trunk/ecommerce/template/cart/ShowCart.ftl Sat Dec 23 
10:40:15 2017
@@ -222,10 +222,10 @@ under the License.
                 <#else>
                   <th scope="row">${uiLabelMap.CommonQuantity}</th>
                 </#if>
-                <th scope="row">${uiLabelMap.EcommerceUnitPrice}</th>
-                <th scope="row">${uiLabelMap.EcommerceAdjustments}</th>
-                <th scope="row">${uiLabelMap.EcommerceItemTotal}</th>
-                <th scope="row">
+                <th class="amount">${uiLabelMap.EcommerceUnitPrice}</th>
+                <th class="amount">${uiLabelMap.EcommerceAdjustments}</th>
+                <th class="amount">${uiLabelMap.EcommerceItemTotal}</th>
+                <th>
                   <input type="checkbox" name="selectAll" value="0" 
class="selectAll"/>
                 </th>
               </tr>
@@ -458,9 +458,9 @@ under the License.
                         </#if>
                     </#if>
                   </td>
-                  <td><@ofbizCurrency amount=cartLine.getDisplayPrice() 
isoCode=shoppingCart.getCurrency()/></td>
-                  <td><@ofbizCurrency amount=cartLine.getOtherAdjustments() 
isoCode=shoppingCart.getCurrency()/></td>
-                  <td><@ofbizCurrency amount=cartLine.getDisplayItemSubTotal() 
isoCode=shoppingCart.getCurrency()/></td>
+                  <td class="amount"><@ofbizCurrency 
amount=cartLine.getDisplayPrice() isoCode=shoppingCart.getCurrency()/></td>
+                  <td class="amount"><@ofbizCurrency 
amount=cartLine.getOtherAdjustments() isoCode=shoppingCart.getCurrency()/></td>
+                  <td class="amount"><@ofbizCurrency 
amount=cartLine.getDisplayItemSubTotal() 
isoCode=shoppingCart.getCurrency()/></td>
                   <td>
                     <#if !cartLine.getIsPromo()>
                       <input type="checkbox" name="selectedItem" 
value="${cartLineIndex}" class="selectAllChild"/>
@@ -471,26 +471,23 @@ under the License.
                 </tr>
               </#list>
             </tbody>
-          </table>
-          <table class="table table-responsive-sm">
-            <thead class="thead-light">
-             <tr>
-               <th colspan="3">
-                 Summary:
-               </th>
-             </tr>
-            </thead>
+          <tfoot>
+            <tr class="table-primary">
+              <th colspan="8">
+                Summary:
+              </th>
+            </tr>
             <#if shoppingCart.getAdjustments()?has_content>
               <tr>
-                <th>${uiLabelMap.CommonSubTotal}:</th>
-                <td colspan="3">
+                <th colspan="6">${uiLabelMap.CommonSubTotal}:</th>
+                <td class="amount" colspan="1">
                   <@ofbizCurrency amount=shoppingCart.getDisplaySubTotal() 
isoCode=shoppingCart.getCurrency()/>
                 </td>
               </tr>
               <#if (shoppingCart.getDisplayTaxIncluded() > 0.0)>
                 <tr>
-                  <th>${uiLabelMap.OrderSalesTaxIncluded}:</th>
-                  <td colspan="3">
+                  <th colspan="6">${uiLabelMap.OrderSalesTaxIncluded}:</th>
+                  <td class="amount" colspan="1">
                     <@ofbizCurrency 
amount=shoppingCart.getDisplayTaxIncluded() isoCode=shoppingCart.getCurrency()/>
                   </td>
                 </tr>
@@ -498,7 +495,7 @@ under the License.
               <#list shoppingCart.getAdjustments() as cartAdjustment>
                 <#assign adjustmentType = 
cartAdjustment.getRelatedOne("OrderAdjustmentType", true) />
                 <tr>
-                  <th>
+                  <th colspan="6">
                     ${uiLabelMap.EcommerceAdjustment} - 
${adjustmentType.get("description",locale)!}
                     <#if cartAdjustment.productPromoId?has_content>
                       <a 
href="<@ofbizUrl>showPromotionDetails?productPromoId=${cartAdjustment.productPromoId}</@ofbizUrl>">
@@ -506,7 +503,7 @@ under the License.
                       </a>
                     </#if>:
                   </th>
-                  <td colspan="2">
+                  <td class="amount" colspan="1">
                     <@ofbizCurrency 
amount=Static["org.apache.ofbiz.order.order.OrderReadHelper"]
                         .calcOrderAdjustment(cartAdjustment,
                         shoppingCart.getSubTotal()) 
isoCode=shoppingCart.getCurrency()/>
@@ -515,28 +512,28 @@ under the License.
               </#list>
             </#if>
             <tr>
-              <th colspan="2">${uiLabelMap.EcommerceCartTotal}:</th>
-              <td>
+              <th colspan="6">${uiLabelMap.EcommerceCartTotal}:</th>
+              <td class="amount" colspan="1">
                 <@ofbizCurrency amount=shoppingCart.getDisplayGrandTotal() 
isoCode=shoppingCart.getCurrency()/>
               </td>
             </tr>
             <#if itemsFromList>
               <tr>
-                <td colspan="3">L - 
${uiLabelMap.EcommerceItemsfromShopingList}.</td>
+                <td colspan="8">L - 
${uiLabelMap.EcommerceItemsfromShopingList}.</td>
               </tr>
             </#if>
             <#if promoItems>
               <tr>
-                <td colspan="3"><span class="badge badge-success">P</span> - 
${uiLabelMap.EcommercePromotionalItems}.</td>
+                <td colspan="8"><span class="badge badge-success">P</span> - 
${uiLabelMap.EcommercePromotionalItems}.</td>
               </tr>
             </#if>
             <#if !itemsFromList && !promoItems>
               <tr>
-                <td colspan="3">&nbsp;</td>
+                <td colspan="8">&nbsp;</td>
               </tr>
             </#if>
             <tr>
-              <td colspan="3">
+              <td colspan="8">
                 <#if sessionAttributes.userLogin?has_content && 
sessionAttributes.userLogin.userLoginId != "anonymous">
                   <select name="shoppingListId" class="selectBox">
                     <#if shoppingLists?has_content>
@@ -561,7 +558,7 @@ under the License.
               </td>
             </tr>
             <tr>
-              <td colspan="3">
+              <td colspan="8">
                 <#if sessionAttributes.userLogin?has_content && 
sessionAttributes.userLogin.userLoginId != "anonymous">
                   &nbsp;&nbsp;
                   <a href="<@ofbizUrl>createCustRequestFromCart</@ofbizUrl>" 
class="btn btn-outline-secondary btn-sm">
@@ -579,7 +576,7 @@ under the License.
               </td>
             </tr>
             <tr>
-              <td>
+              <td colspan="8">
               <label class="form-check-label">
                 <input type="checkbox" 
onclick="javascript:document.cartform.submit()"
                     name="alwaysShowcart" <#if 
shoppingCart.viewCartOnAdd()>checked="checked"</#if>/>
@@ -587,7 +584,8 @@ under the License.
               </label>
               </td>
             </tr>
-          </table>
+          </tfoot>
+        </table>
       </form>
     <#else>
       <h2>${uiLabelMap.EcommerceYourShoppingCartEmpty}.</h2>

Modified: ofbiz/ofbiz-plugins/trunk/ecommerce/webapp/ecommerce/css/custom.css
URL: 
http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/ecommerce/webapp/ecommerce/css/custom.css?rev=1819135&r1=1819134&r2=1819135&view=diff
==============================================================================
--- ofbiz/ofbiz-plugins/trunk/ecommerce/webapp/ecommerce/css/custom.css 
(original)
+++ ofbiz/ofbiz-plugins/trunk/ecommerce/webapp/ecommerce/css/custom.css Sat Dec 
23 10:40:15 2017
@@ -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


Reply via email to