svn commit: r1851185 - in /ofbiz/ofbiz-plugins/trunk/ecommerce: template/cart/PromotionCategories.ftl template/cart/PromotionDetails.ftl template/cart/PromotionProducts.ftl template/cart/ShowAllPromotions.ftl widget/CartScreens.xml

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

svn commit: r1851185 - in /ofbiz/ofbiz-plugins/trunk/ecommerce: template/cart/PromotionCategories.ftl template/cart/PromotionDetails.ftl template/cart/PromotionProducts.ftl template/cart/ShowAllPromotions.ftl widget/CartScreens.xml

Deepak Dixit-5
Author: deepak
Date: Sat Jan 12 19:15:09 2019
New Revision: 1851185

URL: http://svn.apache.org/viewvc?rev=1851185&view=rev
Log:
Improved: Convert Promotion Screen of e-commerce as per Bootstrap Styling
(OFBIZ-10793)
Thanks  Nitish Mishra for your contribution

Added:
    ofbiz/ofbiz-plugins/trunk/ecommerce/template/cart/PromotionCategories.ftl   (with props)
    ofbiz/ofbiz-plugins/trunk/ecommerce/template/cart/PromotionDetails.ftl   (with props)
    ofbiz/ofbiz-plugins/trunk/ecommerce/template/cart/PromotionProducts.ftl   (with props)
    ofbiz/ofbiz-plugins/trunk/ecommerce/template/cart/ShowAllPromotions.ftl   (with props)
Modified:
    ofbiz/ofbiz-plugins/trunk/ecommerce/widget/CartScreens.xml

Added: ofbiz/ofbiz-plugins/trunk/ecommerce/template/cart/PromotionCategories.ftl
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/ecommerce/template/cart/PromotionCategories.ftl?rev=1851185&view=auto
==============================================================================
--- ofbiz/ofbiz-plugins/trunk/ecommerce/template/cart/PromotionCategories.ftl (added)
+++ ofbiz/ofbiz-plugins/trunk/ecommerce/template/cart/PromotionCategories.ftl Sat Jan 12 19:15:09 2019
@@ -0,0 +1,57 @@
+<#--
+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.
+-->
+<#if productPromoCategoryIncludeList?has_content || productPromoCategoryExcludeList?has_content || productPromoCategoryAlwaysList?has_content>
+<div class="card">
+    <div class="card-header">
+        ${uiLabelMap.OrderPromotionCategories}
+    </div>
+    <div class="card-body">
+        <#if productPromoCategoryIncludeList?has_content>
+          <div>${uiLabelMap.OrderPromotionProductsInCategories}:</div>
+          <#list productPromoCategoryIncludeList as productPromoCategory>
+            <#assign productCategory = productPromoCategory.getRelatedOne("ProductCategory", true)>
+            <div>
+                -&nbsp;<a href="<@ofbizUrl>category/~category_id=${productPromoCategory.productCategoryId}</@ofbizUrl>" class="buttontext">${(productCategory.description)?default(productPromoCategory.productCategoryId)}</a>
+                <#if productPromoCategory.includeSubCategories! = "Y">(${uiLabelMap.OrderIncludeSubCategories})</#if>
+            </div>
+          </#list>
+        </#if>
+        <#if productPromoCategoryExcludeList?has_content>
+          <div>${uiLabelMap.OrderExcludeCategories}</div>
+          <#list productPromoCategoryExcludeList as productPromoCategory>
+            <#assign productCategory = productPromoCategory.getRelatedOne("ProductCategory", true)>
+            <div>
+                -&nbsp;<a href="<@ofbizUrl>category/~category_id=${productPromoCategory.productCategoryId}</@ofbizUrl>" class="buttontext">${(productCategory.description)?default(productPromoCategory.productCategoryId)}</a>
+                <#if productPromoCategory.includeSubCategories! = "Y">(${uiLabelMap.OrderIncludeSubCategories})</#if>
+            </div>
+          </#list>
+        </#if>
+        <#if productPromoCategoryAlwaysList?has_content>
+          <div>${uiLabelMap.OrderAlwaysList}</div>
+          <#list productPromoCategoryAlwaysList as productPromoCategory>
+            <#assign productCategory = productPromoCategory.getRelatedOne("ProductCategory", true)>
+            <div>
+                -&nbsp;<a href="<@ofbizUrl>category/~category_id=${productPromoCategory.productCategoryId}</@ofbizUrl>" class="buttontext">${(productCategory.description)?default(productPromoCategory.productCategoryId)}</a>
+                <#if productPromoCategory.includeSubCategories! = "Y">(${uiLabelMap.OrderIncludeSubCategories})</#if>
+            </div>
+          </#list>
+        </#if>
+    </div>
+</div>
+</#if>
\ No newline at end of file

Propchange: ofbiz/ofbiz-plugins/trunk/ecommerce/template/cart/PromotionCategories.ftl
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/ofbiz-plugins/trunk/ecommerce/template/cart/PromotionCategories.ftl
------------------------------------------------------------------------------
    svn:keywords = Date Rev Author URL Id

Propchange: ofbiz/ofbiz-plugins/trunk/ecommerce/template/cart/PromotionCategories.ftl
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: ofbiz/ofbiz-plugins/trunk/ecommerce/template/cart/PromotionDetails.ftl
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/ecommerce/template/cart/PromotionDetails.ftl?rev=1851185&view=auto
==============================================================================
--- ofbiz/ofbiz-plugins/trunk/ecommerce/template/cart/PromotionDetails.ftl (added)
+++ ofbiz/ofbiz-plugins/trunk/ecommerce/template/cart/PromotionDetails.ftl Sat Jan 12 19:15:09 2019
@@ -0,0 +1,28 @@
+<#--
+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.
+-->
+
+<div class="card">
+    <div class="card-header">
+        ${uiLabelMap.OrderPromotionDetails}
+    </div>
+    <div class="card-body">
+        <div>${StringUtil.wrapString(productPromo.promoText!)}</div>
+        <div>${uiLabelMap.OrderGeneratedDescription} ${promoAutoDescription!}</div>
+    </div>
+</div>
\ No newline at end of file

Propchange: ofbiz/ofbiz-plugins/trunk/ecommerce/template/cart/PromotionDetails.ftl
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/ofbiz-plugins/trunk/ecommerce/template/cart/PromotionDetails.ftl
------------------------------------------------------------------------------
    svn:keywords = Date Rev Author URL Id

Propchange: ofbiz/ofbiz-plugins/trunk/ecommerce/template/cart/PromotionDetails.ftl
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: ofbiz/ofbiz-plugins/trunk/ecommerce/template/cart/PromotionProducts.ftl
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/ecommerce/template/cart/PromotionProducts.ftl?rev=1851185&view=auto
==============================================================================
--- ofbiz/ofbiz-plugins/trunk/ecommerce/template/cart/PromotionProducts.ftl (added)
+++ ofbiz/ofbiz-plugins/trunk/ecommerce/template/cart/PromotionProducts.ftl Sat Jan 12 19:15:09 2019
@@ -0,0 +1,63 @@
+<#--
+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.
+-->
+
+<#if productIds?has_content>
+<div class="card">
+    <div class="card-header">
+        ${uiLabelMap.OrderProductsForPromotion}
+    </div>
+    <div class="card-body">
+        <table class="table table-responsive-sm">
+          <thead>
+          <tr>
+            <th>${uiLabelMap.CommonQualifier}</th>
+            <th>${uiLabelMap.CommonBenefit}</th>
+            <th class="text-right">
+              <#if (listSize > 0)>
+                <#if (viewIndex > 0)>
+                <a href="<@ofbizUrl>showPromotionDetails?productPromoId=${productPromoId!}&amp;VIEW_SIZE=${viewSize}&amp;VIEW_INDEX=${viewIndex-1}</@ofbizUrl>" class="buttontext">${uiLabelMap.CommonPrevious}</a> |
+                </#if>
+                ${lowIndex+1} - ${highIndex} ${uiLabelMap.CommonOf} ${listSize}
+                <#if (listSize > highIndex)>
+                | <a href="<@ofbizUrl>showPromotionDetails?productPromoId=${productPromoId!}&amp;VIEW_SIZE=${viewSize}&amp;VIEW_INDEX=${viewIndex+1}</@ofbizUrl>" class="buttontext">${uiLabelMap.CommonNext}</a>
+                </#if>
+                </b>
+              </#if>
+            </th>
+          </tr>
+          </thead>
+          <tbody>
+        <#if (listSize > 0)>
+          <#list productIds[lowIndex..highIndex-1] as productId>
+              <tr>
+                <td>[<#if productIdsCond.contains(productId)>x<#else>&nbsp;</#if>]</td>
+                <td>[<#if productIdsAction.contains(productId)>x<#else>&nbsp;</#if>]</td>
+                <td>
+                  ${setRequestAttribute("optProductId", productId)}
+                  ${setRequestAttribute("listIndex", productId_index)}
+                  ${screens.render(productsummaryScreen)}
+                </td>
+              </tr>
+          </#list>
+        </#if>
+        </tbody>
+        </table>
+    </div>
+</div>
+</#if>
\ No newline at end of file

Propchange: ofbiz/ofbiz-plugins/trunk/ecommerce/template/cart/PromotionProducts.ftl
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/ofbiz-plugins/trunk/ecommerce/template/cart/PromotionProducts.ftl
------------------------------------------------------------------------------
    svn:keywords = Date Rev Author URL Id

Propchange: ofbiz/ofbiz-plugins/trunk/ecommerce/template/cart/PromotionProducts.ftl
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: ofbiz/ofbiz-plugins/trunk/ecommerce/template/cart/ShowAllPromotions.ftl
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/ecommerce/template/cart/ShowAllPromotions.ftl?rev=1851185&view=auto
==============================================================================
--- ofbiz/ofbiz-plugins/trunk/ecommerce/template/cart/ShowAllPromotions.ftl (added)
+++ ofbiz/ofbiz-plugins/trunk/ecommerce/template/cart/ShowAllPromotions.ftl Sat Jan 12 19:15:09 2019
@@ -0,0 +1,38 @@
+<#--
+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.
+-->
+<div class="card">
+    <div class="card-header">${uiLabelMap.OrderSpecialOffers}</div>
+    <div class="card-body">
+        <table class="table table-responsive-sm">
+        <#-- show promotions text -->
+        <tbody>
+        <#list productPromosAllShowable as productPromo>
+            <tr>
+              <td><a href="<@ofbizUrl>showPromotionDetails?productPromoId=${productPromo.productPromoId}</@ofbizUrl>" class="button">${uiLabelMap.CommonDetails}</a></td>
+               <td>${StringUtil.wrapString(productPromo.promoText!)}</td>
+            </tr>
+        </#list>
+        </tbody>
+        </table>
+    </div>
+</div>
+
+<#if (shoppingCartSize > 0)>
+  ${screens.render(promoUseDetailsInlineScreen)}
+</#if>
\ No newline at end of file

Propchange: ofbiz/ofbiz-plugins/trunk/ecommerce/template/cart/ShowAllPromotions.ftl
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/ofbiz-plugins/trunk/ecommerce/template/cart/ShowAllPromotions.ftl
------------------------------------------------------------------------------
    svn:keywords = Date Rev Author URL Id

Propchange: ofbiz/ofbiz-plugins/trunk/ecommerce/template/cart/ShowAllPromotions.ftl
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: ofbiz/ofbiz-plugins/trunk/ecommerce/widget/CartScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/ecommerce/widget/CartScreens.xml?rev=1851185&r1=1851184&r2=1851185&view=diff
==============================================================================
--- ofbiz/ofbiz-plugins/trunk/ecommerce/widget/CartScreens.xml (original)
+++ ofbiz/ofbiz-plugins/trunk/ecommerce/widget/CartScreens.xml Sat Jan 12 19:15:09 2019
@@ -105,7 +105,7 @@ under the License.
                         <include-screen name="leftbar" location="component://ecommerce/widget/CommonScreens.xml"/>
                     </decorator-section>
                     <decorator-section name="body">
-                        <platform-specific><html><html-template location="component://order/template/entry/cart/ShowAllPromotions.ftl"/></html></platform-specific>
+                        <platform-specific><html><html-template location="component://ecommerce/template/cart/ShowAllPromotions.ftl"/></html></platform-specific>
                     </decorator-section>
                 </decorator-screen>
             </widgets>
@@ -125,7 +125,7 @@ under the License.
                         <include-screen name="leftbar" location="component://ecommerce/widget/CommonScreens.xml"/>
                     </decorator-section>
                     <decorator-section name="body">
-                        <include-screen name="promotion" location="component://order/widget/ordermgr/OrderEntryCartScreens.xml"/>
+                        <include-screen name="promotion"></include-screen>
                     </decorator-section>
                     <decorator-section name="right-column">
                         <include-screen name="rightbar" location="component://ecommerce/widget/CommonScreens.xml"/>
@@ -135,6 +135,22 @@ under the License.
         </section>
     </screen>
 
+    <screen name="promotion">
+        <section>
+            <condition>
+                <not><if-empty field="productPromo"/></not>
+            </condition>
+            <widgets>
+                <platform-specific><html><html-template location="component://ecommerce/template/cart/PromotionDetails.ftl"/></html></platform-specific>
+                <platform-specific><html><html-template location="component://ecommerce/template/cart/PromotionCategories.ftl"/></html></platform-specific>
+                <platform-specific><html><html-template location="component://ecommerce/template/cart/PromotionProducts.ftl"/></html></platform-specific>
+            </widgets>
+            <fail-widgets>
+                <label text="${uiLabelMap.OrderErrorNoPromotionFoundWithID} [${productPromoId?if_exists}]" style="h2"/>
+            </fail-widgets>
+        </section>
+    </screen>
+
     <screen name="UpdateCart">
         <section>
             <actions>