Author: deepak
Date: Wed Dec 20 11:08:53 2017 New Revision: 1818773 URL: http://svn.apache.org/viewvc?rev=1818773&view=rev Log: Improved: Update markup of Home page product summary section to standard markup given by Bootstrap v4.0.0 (OFBIZ-10055) Thanks Saurabh Dixit for your contribution Added: ofbiz/ofbiz-plugins/trunk/ecommerce/template/catalog/CategoryDetail.ftl (with props) ofbiz/ofbiz-plugins/trunk/ecommerce/template/catalog/ProductSummary.ftl (with props) Modified: ofbiz/ofbiz-plugins/trunk/ecommerce/template/catalog/ShowBestSellingCategory.ftl ofbiz/ofbiz-plugins/trunk/ecommerce/webapp/ecommerce/css/custom.css ofbiz/ofbiz-plugins/trunk/ecommerce/widget/CatalogScreens.xml Added: ofbiz/ofbiz-plugins/trunk/ecommerce/template/catalog/CategoryDetail.ftl URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/ecommerce/template/catalog/CategoryDetail.ftl?rev=1818773&view=auto ============================================================================== --- ofbiz/ofbiz-plugins/trunk/ecommerce/template/catalog/CategoryDetail.ftl (added) +++ ofbiz/ofbiz-plugins/trunk/ecommerce/template/catalog/CategoryDetail.ftl Wed Dec 20 11:08:53 2017 @@ -0,0 +1,187 @@ +<#-- + 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. + --> + <script type="text/javascript"> + function callDocumentByPaginate(info) { + var str = info.split('~'); + var checkUrl = '<@ofbizUrl>categoryAjaxFired</@ofbizUrl>'; + if(checkUrl.search("http")) + var ajaxUrl = '<@ofbizUrl>categoryAjaxFired</@ofbizUrl>'; + else + var ajaxUrl = '<@ofbizUrl>categoryAjaxFiredSecure</@ofbizUrl>'; + + //jQuerry Ajax Request + jQuery.ajax({ + url: ajaxUrl, + type: 'POST', + data: {"category_id" : str[0], "VIEW_SIZE" : str[1], "VIEW_INDEX" : str[2]}, + error: function(msg) { + alert("An error occurred loading content! : " + msg); + }, + success: function(msg) { + jQuery('#div3').html(msg); + } + }); + } +</script> + + <#macro paginationControls> + <#assign viewIndexMax = Static["java.lang.Math"].ceil((listSize)?double / viewSize?double)/> + <#if (viewIndexMax?int > 0)> + <div class="row"> + <div class="col-sm-2 offset-sm-10"> + <div class="product-prevnext px-2 py-1"> + <select name="pageSelect" onchange="callDocumentByPaginate(this[this.selectedIndex].value);" class="form-control"> + <option value="#">${uiLabelMap.CommonPage} ${viewIndex?int + 1} ${uiLabelMap.CommonOf} ${viewIndexMax}</option> + <#if (viewIndex?int > 1)> + <#list 1..viewIndexMax as curViewNum> + <option value="${productCategoryId}~${viewSize}~${curViewNum-1?int}">${uiLabelMap.CommonGotoPage} ${curViewNum}</option> + </#list> + </#if> + </select> + <#-- End Page Select Drop-Down --> + <#if (viewIndex?int > 0)> + <a href="javascript: void(0);" onclick="callDocumentByPaginate('${productCategoryId}~${viewSize}~${viewIndex?int - 1}');" class="buttontext">${uiLabelMap.CommonPrevious}</a> | + </#if> + <#if ((listSize?int - viewSize?int) > 0)> + <span>${lowIndex} - ${highIndex} ${uiLabelMap.CommonOf} ${listSize}</span> + </#if> + <#if highIndex?int < listSize?int> + | <a href="javascript: void(0);" onclick="callDocumentByPaginate('${productCategoryId}~${viewSize}~${viewIndex?int + 1}');" class="buttontext">${uiLabelMap.CommonNext}</a> + </#if> + </div> + </div> + </div> + </#if> + </#macro> + <br/> + + <#if productCategory??> + <#assign categoryName = categoryContentWrapper.get("CATEGORY_NAME", "html")!/> + <#assign categoryDescription = categoryContentWrapper.get("DESCRIPTION", "html")!/> + <#if categoryName?has_content> + <div class="card"> + <div class="card-header"> + <h4> + ${categoryName} <#if categoryDescription?has_content>${(categoryDescription)!}</#if> + </h4> + </div> + <div class="card-body"> + <#if hasQuantities??> + <form method="post" action="<@ofbizUrl>addCategoryDefaults<#if requestAttributes._CURRENT_VIEW_??>/${requestAttributes._CURRENT_VIEW_}</#if></@ofbizUrl>" name="thecategoryform" style='margin: 0;'> + <input type='hidden' name='add_category_id' value='${productCategory.productCategoryId}'/> + <#if requestParameters.product_id??><input type='hidden' name='product_id' value='${requestParameters.product_id}'/></#if> + <#if requestParameters.category_id??><input type='hidden' name='category_id' value='${requestParameters.category_id}'/></#if> + <#if requestParameters.VIEW_INDEX??><input type='hidden' name='VIEW_INDEX' value='${requestParameters.VIEW_INDEX}'/></#if> + <#if requestParameters.SEARCH_STRING??><input type='hidden' name='SEARCH_STRING' value='${requestParameters.SEARCH_STRING}'/></#if> + <#if requestParameters.SEARCH_CATEGORY_ID??><input type='hidden' name='SEARCH_CATEGORY_ID' value='${requestParameters.SEARCH_CATEGORY_ID}'/></#if> + <a href="javascript:document.thecategoryform.submit()" class="buttontext"><span style="white-space: nowrap;">${uiLabelMap.ProductAddProductsUsingDefaultQuantities}</span></a> + </form> + </#if> + <#if "Y" == searchInCategory?default("Y")> + <a href="<@ofbizUrl>advancedsearch?SEARCH_CATEGORY_ID=${productCategory.productCategoryId}</@ofbizUrl>" class="buttontext">${uiLabelMap.ProductSearchInCategory}</a> + </#if> + <#assign longDescription = categoryContentWrapper.get("LONG_DESCRIPTION", "html")!/> + <#assign categoryImageUrl = categoryContentWrapper.get("CATEGORY_IMAGE_URL", "url")!/> + <#if categoryImageUrl?string?has_content || longDescription?has_content> + <div> + <#if categoryImageUrl?string?has_content> + <#assign height=100/> + <img src='<@ofbizContentUrl>${categoryImageUrl}</@ofbizContentUrl>' vspace='5' hspace='5' align='left' class='cssImgLarge' /> + </#if> + <#if longDescription?has_content> + ${longDescription} + </#if> + </div> + </#if> + + <#if productCategoryLinkScreen?has_content && productCategoryLinks?has_content> + <div class="productcategorylink-container"> + <#list productCategoryLinks as productCategoryLink> + ${setRequestAttribute("productCategoryLink",productCategoryLink)} + ${screens.render(productCategoryLinkScreen)} + </#list> + </div> + </#if> + + + <#if productCategoryMembers?has_content> + <#-- Pagination --> + <#if paginateEcommerceStyle??> + <@paginationControls/> + <#else> + <#assign commonUrl = "category?category_id="+ (parameters.category_id!) + "&"/> + <#assign messageMap = Static["org.apache.ofbiz.base.util.UtilMisc"].toMap("lowCount", lowIndex, "highCount", highIndex, "total", listSize)/> + <#assign commonDisplaying = Static["org.apache.ofbiz.base.util.UtilProperties"].getMessage("CommonUiLabels", "CommonDisplaying", messageMap, locale)/> + <@htmlTemplate.nextPrev commonUrl=commonUrl ajaxEnabled=false javaScriptEnabled=false paginateStyle="nav-pager" paginateFirstStyle="nav-first" viewIndex=viewIndex highIndex=highIndex listSize=listSize viewSize=viewSize ajaxFirstUrl="" firstUrl="" paginateFirstLabel="" paginatePreviousStyle="nav-previous" ajaxPreviousUrl="" previousUrl="" paginatePreviousLabel="" pageLabel="" ajaxSelectUrl="" selectUrl="" ajaxSelectSizeUrl="" selectSizeUrl="" commonDisplaying=commonDisplaying paginateNextStyle="nav-next" ajaxNextUrl="" nextUrl="" paginateNextLabel="" paginateLastStyle="nav-last" ajaxLastUrl="" lastUrl="" paginateLastLabel="" paginateViewSizeLabel="" /> + </#if> + + <#assign numCol = numCol?default(1)/> + <#assign numCol = numCol?number/> + <#assign tabCol = 1/> + + + <div + <#if categoryImageUrl?string?has_content> + style="position: relative; margin-top: ${height}px;" + </#if> + class="productsummary-container<#if (numCol?int > 1)> matrix</#if>"> + + + <#if (numCol?int > 1)> + <!-- yaha table tag tha--> + </#if> + + <div class="row row-eq-height"> + + <#list productCategoryMembers as productCategoryMember> + <#if (numCol?int == 1)> + ${setRequestAttribute("optProductId", productCategoryMember.productId)} + ${setRequestAttribute("productCategoryMember", productCategoryMember)} + ${setRequestAttribute("listIndex", productCategoryMember_index)} + ${screens.render(productsummaryScreen)} + <#else> + <#if (tabCol?int = 1)><tr></#if> + + ${setRequestAttribute("optProductId", productCategoryMember.productId)} + ${setRequestAttribute("productCategoryMember", productCategoryMember)} + ${setRequestAttribute("listIndex", productCategoryMember_index)} + ${screens.render(productsummaryScreen)} + + <#if (tabCol?int = numCol)><!-- yaha tr tha--></#if> + <#assign tabCol = tabCol+1/><#if (tabCol?int > numCol)><#assign tabCol = 1/></#if> + </#if> + </#list> + + </div> + + <#if (numCol?int > 1)> + + </#if> + </div> + <#if paginateEcommerceStyle??> + <@paginationControls/> + </#if> + <#else> + <hr /> + <div>${uiLabelMap.ProductNoProductsInThisCategory}</div> + </#if> + </div> + </div> + </#if> + </#if> Propchange: ofbiz/ofbiz-plugins/trunk/ecommerce/template/catalog/CategoryDetail.ftl ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/ofbiz-plugins/trunk/ecommerce/template/catalog/CategoryDetail.ftl ------------------------------------------------------------------------------ svn:keywords = Date Rev Author URL Id Propchange: ofbiz/ofbiz-plugins/trunk/ecommerce/template/catalog/CategoryDetail.ftl ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: ofbiz/ofbiz-plugins/trunk/ecommerce/template/catalog/ProductSummary.ftl URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/ecommerce/template/catalog/ProductSummary.ftl?rev=1818773&view=auto ============================================================================== --- ofbiz/ofbiz-plugins/trunk/ecommerce/template/catalog/ProductSummary.ftl (added) +++ ofbiz/ofbiz-plugins/trunk/ecommerce/template/catalog/ProductSummary.ftl Wed Dec 20 11:08:53 2017 @@ -0,0 +1,241 @@ +<#-- + 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. + --> + ${virtualJavaScript!} + <script type="text/javascript"> +<!-- + function displayProductVirtualId(variantId, virtualProductId, pForm) { + if(variantId){ + pForm.product_id.value = variantId; + }else{ + pForm.product_id.value = ''; + variantId = ''; + } + var elem = document.getElementById('product_id_display'); + var txt = document.createTextNode(variantId); + if(elem.hasChildNodes()) { + elem.replaceChild(txt, elem.firstChild); + } else { + elem.appendChild(txt); + } + + var priceElem = document.getElementById('variant_price_display'); + var price = getVariantPrice(variantId); + var priceTxt = null; + if(price){ + priceTxt = document.createTextNode(price); + }else{ + priceTxt = document.createTextNode(''); + } + + if(priceElem.hasChildNodes()) { + priceElem.replaceChild(priceTxt, priceElem.firstChild); + } else { + priceElem.appendChild(priceTxt); + } + } +//--> +</script> + <#if product??> + <#-- variable setup --> + <#if "Y" == backendPath?default("N")> + <#assign productUrl><@ofbizCatalogUrl productId=product.productId productCategoryId=categoryId/></#assign> + <#else> + <#assign productUrl><@ofbizCatalogAltUrl productId=product.productId productCategoryId=categoryId/></#assign> + </#if> + + <#if requestAttributes.productCategoryMember??> + <#assign prodCatMem = requestAttributes.productCategoryMember> + </#if> + <#assign smallImageUrl = productContentWrapper.get("SMALL_IMAGE_URL", "url")!> + <#assign largeImageUrl = productContentWrapper.get("LARGE_IMAGE_URL", "url")!> + <#if !smallImageUrl?string?has_content><#assign smallImageUrl = "/images/defaultImage.jpg"></#if> + <#if !largeImageUrl?string?has_content><#assign largeImageUrl = "/images/defaultImage.jpg"></#if> + <#-- end variable setup --> + <#assign productInfoLinkId = "productInfoLink"> + <#assign productInfoLinkId = productInfoLinkId + product.productId/> + <#assign productDetailId = "productDetailId"/> + <#assign productDetailId = productDetailId + product.productId/> + + <div class="col-md-3 products-card"> + <div class="card text-center"> + <a href="${productUrl}"> + <img class="card-img-top" src="<@ofbizContentUrl>${contentPathPrefix!}${smallImageUrl}</@ofbizContentUrl>" alt="Small Image"> + </a> + <div class="card-body"> + <h4 class="card-title"><a href="${productUrl}" class="btn btn-link">${productContentWrapper.get("PRODUCT_NAME", "html")!}</a></h4> + <div class="cart-text"> + <div>${productContentWrapper.get("DESCRIPTION", "html")!}<#if daysToShip??> - ${uiLabelMap.ProductUsuallyShipsIn} <b>${daysToShip}</b> ${uiLabelMap.CommonDays}!</#if></div> + + <#-- Display category-specific product comments --> + <#if prodCatMem?? && prodCatMem.comments?has_content> + <p>${prodCatMem.comments}</p> + </#if> + + <#-- example of showing a certain type of feature with the product --> + <#if sizeProductFeatureAndAppls?has_content> + <div> + <#if (sizeProductFeatureAndAppls?size == 1)> + <p>${uiLabelMap.OrderSizeAvailableSingle}:</p> + <#else> + ${uiLabelMap.OrderSizeAvailableMultiple}: + </#if> + <div> + <#list sizeProductFeatureAndAppls as sizeProductFeatureAndAppl> + ${sizeProductFeatureAndAppl.abbrev?default(sizeProductFeatureAndAppl.description?default(sizeProductFeatureAndAppl.productFeatureId))}<#if sizeProductFeatureAndAppl_has_next>,</#if> + </#list> + </div> + </div> + </#if> + <div> + <p><strong>${product.productId!}</strong></p> + <dl> + <dt></dt> + <dd></dd> + </dl> + <#if totalPrice??> + <p>${uiLabelMap.ProductAggregatedPrice}: <span class='basePrice'><@ofbizCurrency amount=totalPrice isoCode=totalPrice.currencyUsed/></span></p> + <#else> + <#if price.competitivePrice?? && price.price?? && price.price?double < price.competitivePrice?double> + ${uiLabelMap.ProductCompareAtPrice}: <span class='basePrice'><@ofbizCurrency amount=price.competitivePrice isoCode=price.currencyUsed/></span> + </#if> + <#if price.listPrice?? && price.price?? && price.price?double < price.listPrice?double> + <p> + ${uiLabelMap.ProductListPrice}: <span class="basePrice"><@ofbizCurrency amount=price.listPrice isoCode=price.currencyUsed/></span> + </p> + </#if> + <b> + <#if price.isSale?? && price.isSale> + <p class="badge badge-info">${uiLabelMap.OrderOnSale}!</p> + <#assign priceStyle = "salePrice"> + <#else> + <#assign priceStyle = "regularPrice"> + </#if> + + <#if (price.price?default(0) > 0 && "N" == product.requireAmount?default("N"))> + <p>${uiLabelMap.OrderYourPrice}: <#if "Y" = product.isVirtual!> ${uiLabelMap.CommonFrom} </#if><span class="${priceStyle}"><@ofbizCurrency amount=price.price isoCode=price.currencyUsed/></span></p> + </#if> + </b> + <#if price.listPrice?? && price.price?? && price.price?double < price.listPrice?double> + <#assign priceSaved = price.listPrice?double - price.price?double> + <#assign percentSaved = (priceSaved?double / price.listPrice?double) * 100> + <p> + ${uiLabelMap.OrderSave}: <span class="basePrice"><@ofbizCurrency amount=priceSaved isoCode=price.currencyUsed/> (${percentSaved?int}%)</span> + </p> + </#if> + </#if> + <#-- show price details ("showPriceDetails" field can be set in the screen definition) --> + <#if (showPriceDetails?? && "Y" == showPriceDetails?default("N"))> + <#if price.orderItemPriceInfos??> + <#list price.orderItemPriceInfos as orderItemPriceInfo> + <div>${orderItemPriceInfo.description!}</div> + </#list> + </#if> + </#if> + </div> + <#if averageRating?? && (averageRating?double > 0) && numRatings?? && (numRatings?long > 2)> + <div>${uiLabelMap.OrderAverageRating}: ${averageRating} (${uiLabelMap.CommonFrom} ${numRatings} ${uiLabelMap.OrderRatings})</div> + </#if> + <form method="post" action="<@ofbizUrl secure="${request.isSecure()?string}">addToCompare</@ofbizUrl>" name="addToCompare${requestAttributes.listIndex!}form"> + <input type="hidden" name="productId" value="${product.productId}"/> + <input type="hidden" name="mainSubmitted" value="Y"/> + </form> + + </div> + <div id="${productDetailId}" style="display:none;"> + <img src="<@ofbizContentUrl>${contentPathPrefix!}${largeImageUrl}</@ofbizContentUrl>" alt="Large Image"/> + ${uiLabelMap.ProductProductId} ${product.productId!} + ${uiLabelMap.ProductProductName} ${productContentWrapper.get("PRODUCT_NAME", "html")!} + ${uiLabelMap.CommonDescription} ${productContentWrapper.get("DESCRIPTION", "html")!} + </div> + <div class="productbuy"> + <#-- check to see if introductionDate hasn't passed yet --> + <#if product.introductionDate?? && nowTimestamp.before(product.introductionDate)> + <div style="color: red;">${uiLabelMap.ProductNotYetAvailable}</div> + <#-- check to see if salesDiscontinuationDate has passed --> + <#elseif product.salesDiscontinuationDate?? && nowTimestamp.after(product.salesDiscontinuationDate)> + <div style="color: red;">${uiLabelMap.ProductNoLongerAvailable}</div> + <#-- check to see if it is a rental item; will enter parameters on the detail screen--> + <#elseif "ASSET_USAGE" == product.productTypeId!> + <a href="${productUrl}" class="btn btn-outline-secondary btn-sm">${uiLabelMap.OrderMakeBooking}...</a> + <#-- check to see if it is an aggregated or configurable product; will enter parameters on the detail screen--> + <#elseif "AGGREGATED" == product.productTypeId! || "AGGREGATED_SERVICE" == product.productTypeId!> + <a href="${productUrl}" class="btn btn-outline-secondary btn-sm">${uiLabelMap.OrderConfigure}...</a> + <#-- check to see if the product is a virtual product --> + <#elseif product.isVirtual?? && "Y" == product.isVirtual> + <a href="${productUrl}" class="btn btn-outline-secondary btn-sm">${uiLabelMap.OrderChooseVariations}...</a> + <#-- check to see if the product requires an amount --> + <#elseif product.requireAmount?? && "Y" == product.requireAmount> + <a href="${productUrl}" class="btn btn-outline-secondary btn-sm">${uiLabelMap.OrderChooseAmount}...</a> + <#elseif "ASSET_USAGE_OUT_IN" == product.productTypeId!> + <a href="${productUrl}" class="btn btn-outline-secondary btn-sm">${uiLabelMap.OrderRent}...</a> + <#else> + <form method="post" action="<@ofbizUrl>additem</@ofbizUrl>" name="the${requestAttributes.formNamePrefix!}${requestAttributes.listIndex!}form" style="margin: 0;"> + <div class="form-group"> + <input type="hidden" name="add_product_id" value="${product.productId}"/> + <input type="hidden" name="clearSearch" value="N"/> + <input type="hidden" name="mainSubmitted" value="Y"/> + <div class="input-group"> + <input type="text" class="form-control form-control-sm" name="quantity" value="1"/> + <a href="javascript:document.the${requestAttributes.formNamePrefix!}${requestAttributes.listIndex!}form.submit()" class="btn btn-outline-secondary btn-sm">${uiLabelMap.OrderAddToCart}</a> + </div> + <#if mainProducts?has_content> + <input type="hidden" name="product_id" value=""/> + <select name="productVariantId" onchange="javascript:displayProductVirtualId(this.value, '${product.productId}', this.form);"> + <option value="">Select Unit Of Measure</option> + <#list mainProducts as mainProduct> + <option value="${mainProduct.productId}">${mainProduct.uomDesc} : ${mainProduct.piecesIncluded}</option> + </#list> + </select> + <div style="display: inline-block;"> + <strong><span id="product_id_display"> </span></strong> + <strong><span id="variant_price_display"> </span></strong> + </div> + </#if> + </div> + </form> + <a href="javascript:document.addToCompare${requestAttributes.listIndex!}form.submit()" class="btn btn-link btn-sm">${uiLabelMap.ProductAddToCompare}</a> + <#if prodCatMem?? && prodCatMem.quantity?? && 0.00 < prodCatMem.quantity?double> + <form method="post" action="<@ofbizUrl>additem</@ofbizUrl>" name="the${requestAttributes.formNamePrefix!}${requestAttributes.listIndex!}defaultform" style="margin: 0;"> + <input type="hidden" name="add_product_id" value="${prodCatMem.productId!}"/> + <input type="hidden" name="quantity" value="${prodCatMem.quantity!}"/> + <input type="hidden" name="clearSearch" value="N"/> + <input type="hidden" name="mainSubmitted" value="Y"/> + <a href="javascript:document.the${requestAttributes.formNamePrefix!}${requestAttributes.listIndex!}defaultform.submit()" class="btn btn-outline-secondary btn-sm">${uiLabelMap.CommonAddDefault}(${prodCatMem.quantity?string.number}) ${uiLabelMap.OrderToCart}</a> + </form> + <#assign productCategory = delegator.findOne("ProductCategory", Static["org.apache.ofbiz.base.util.UtilMisc"].toMap("productCategoryId", prodCatMem.productCategoryId), false)/> + <#if productCategory.productCategoryTypeId != "BEST_SELL_CATEGORY"> + <form method="post" action="<@ofbizUrl>additem</@ofbizUrl>" name="the${requestAttributes.formNamePrefix!}${requestAttributes.listIndex!}defaultform" style="margin: 0;"> + <input type="hidden" name="add_product_id" value="${prodCatMem.productId!}"/> + <input type="hidden" name="quantity" value="${prodCatMem.quantity!}"/> + <input type="hidden" name="clearSearch" value="N"/> + <input type="hidden" name="mainSubmitted" value="Y"/> + <a href="javascript:document.the${requestAttributes.formNamePrefix!}${requestAttributes.listIndex!}defaultform.submit()" class="btn btn-outline-secondary btn-sm">${uiLabelMap.CommonAddDefault}(${prodCatMem.quantity?string.number}) ${uiLabelMap.OrderToCart}</a> + </form> + </#if> + </#if> + </#if> + </div> + <#else> + ${uiLabelMap.ProductErrorProductNotFound}.<br /> + </#if> + </div> + </div> +</div> + + Propchange: ofbiz/ofbiz-plugins/trunk/ecommerce/template/catalog/ProductSummary.ftl ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/ofbiz-plugins/trunk/ecommerce/template/catalog/ProductSummary.ftl ------------------------------------------------------------------------------ svn:keywords = Date Rev Author URL Id Propchange: ofbiz/ofbiz-plugins/trunk/ecommerce/template/catalog/ProductSummary.ftl ------------------------------------------------------------------------------ svn:mime-type = text/plain Modified: ofbiz/ofbiz-plugins/trunk/ecommerce/template/catalog/ShowBestSellingCategory.ftl URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/ecommerce/template/catalog/ShowBestSellingCategory.ftl?rev=1818773&r1=1818772&r2=1818773&view=diff ============================================================================== --- ofbiz/ofbiz-plugins/trunk/ecommerce/template/catalog/ShowBestSellingCategory.ftl (original) +++ ofbiz/ofbiz-plugins/trunk/ecommerce/template/catalog/ShowBestSellingCategory.ftl Wed Dec 20 11:08:53 2017 @@ -17,52 +17,54 @@ specific language governing permissions under the License. --> -<#if productCategoryList?has_content> - <h1>Popular Categories</h1> - <div class="productsummary-container matrix"> - <table> - <tbody> - <#list productCategoryList as childCategoryList> - <tr> +<div class="card"> + <h4 class="card-header"> + Popular Categories + </h4> + <div class="card-body"> + <p class="card-text"> + <div class="row"> + + <#list productCategoryList as childCategoryList> + <#assign cateCount = 0/> + <#list childCategoryList as productCategory> - <#if (cateCount > 2)> - <tr> - <#assign cateCount = 0/> - </#if> - <#assign productCategoryId = productCategory.productCategoryId/> - <#assign categoryImageUrl = "/images/defaultImage.jpg"> - <#assign productCategoryMembers = delegator - .findByAnd("ProductCategoryAndMember", Static["org.apache.ofbiz.base.util.UtilMisc"] - .toMap("productCategoryId", productCategoryId), - Static["org.apache.ofbiz.base.util.UtilMisc"].toList("-quantity"), false)> - <#if productCategory.categoryImageUrl?has_content> - <#assign categoryImageUrl = productCategory.categoryImageUrl/> + <div class="products-card col-md-3"> + <#if (cateCount > 2)> + <#assign cateCount = 0/> + </#if> + <#assign productCategoryId = productCategory.productCategoryId/> + <#assign categoryImageUrl = "/images/defaultImage.jpg"/> + <#assign productCategoryMembers = delegator + .findByAnd("ProductCategoryAndMember", Static["org.apache.ofbiz.base.util.UtilMisc"] + .toMap("productCategoryId", productCategoryId), + Static["org.apache.ofbiz.base.util.UtilMisc"].toList("-quantity"), false)/> + <#if productCategory.categoryImageUrl?has_content> + <#assign categoryImageUrl = productCategory.categoryImageUrl/> <#elseif productCategoryMembers?has_content> <#assign productCategoryMember = - Static["org.apache.ofbiz.entity.util.EntityUtil"].getFirst(productCategoryMembers)/> + Static["org.apache.ofbiz.entity.util.EntityUtil"].getFirst(productCategoryMembers)/> <#assign product = delegator.findOne("Product", - Static["org.apache.ofbiz.base.util.UtilMisc"] - .toMap("productId", productCategoryMember.productId), false)/> + Static["org.apache.ofbiz.base.util.UtilMisc"] + .toMap("productId", productCategoryMember.productId), false)/> <#if product.smallImageUrl?has_content> <#assign categoryImageUrl = product.smallImageUrl/> </#if> - </#if> - <td> - <div class="productsummary"> - <div class="smallimage"> - <a href="<@ofbizCatalogAltUrl productCategoryId=productCategoryId/>"> - <span class="popup_link"><img alt="Small Image" src="${categoryImageUrl}"></span> - </a> - </div> - <div class="productbuy"> - <a class="linktext" style="font-size:12px" - href="<@ofbizCatalogAltUrl productCategoryId=productCategoryId/>"> + </#if> + + <div class="card"> + <a href="<@ofbizCatalogAltUrl productCategoryId=productCategoryId/>" class="text-center"> + <img class="card-img-top" src="${categoryImageUrl}" alt="Card image cap"/> + </a> + <div class="card-body"> + <h4 class="card-title"> + <a style="font-size:12px" href="<@ofbizCatalogAltUrl productCategoryId=productCategoryId/>"> ${productCategory.categoryName!productCategoryId} </a> - </div> - <div class="productinfo"> - <ul> + </h4> + <p class="card-text"> + <ul class=""> <#if productCategoryMembers??> <#assign i = 0/> <#list productCategoryMembers as productCategoryMember> @@ -76,28 +78,29 @@ under the License. </#if> <#if productCategoryMember?has_content> <#assign product = delegator.findOne("Product", - Static["org.apache.ofbiz.base.util.UtilMisc"].toMap("productId", - productCategoryMember.productId), false)> - <li class="browsecategorytext"> - <a class="linktext" - href="<@ofbizCatalogAltUrl productCategoryId="PROMOTIONS" - productId="${product.productId}"/>"> + Static["org.apache.ofbiz.base.util.UtilMisc"].toMap("productId", + productCategoryMember.productId), false)> + <li> + <a class="linktext" + href="<@ofbizCatalogAltUrl productCategoryId="PROMOTIONS" + productId="${product.productId}"/>"> ${product.productName!product.productId} - </a> - </li> + </a> + </li> </#if> <#assign i = i+1/> </#list> </#if> </ul> - </div> + </p> </div> - </td> - <#assign cateCount = cateCount + 1/> - </#list> - <tr/> + </div> + <#assign cateCount = cateCount + 1/> + </div> + </#list> + </div> </#list> - </tbody> - </table> + </p> </div> -</#if> +</div> + 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=1818773&r1=1818772&r2=1818773&view=diff ============================================================================== --- ofbiz/ofbiz-plugins/trunk/ecommerce/webapp/ecommerce/css/custom.css (original) +++ ofbiz/ofbiz-plugins/trunk/ecommerce/webapp/ecommerce/css/custom.css Wed Dec 20 11:08:53 2017 @@ -26,4 +26,21 @@ } .d-flex.justify-content-center a { margin-bottom: 10px; +} + +.card .card-img-top { + width: auto; + height: 140px; +} + +.card { + height: 100%; +} + +.products-card.col-md-3 { + margin-bottom: 30px !important; +} + +.products-card .card-title a { + white-space: normal; } \ No newline at end of file Modified: ofbiz/ofbiz-plugins/trunk/ecommerce/widget/CatalogScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/ecommerce/widget/CatalogScreens.xml?rev=1818773&r1=1818772&r2=1818773&view=diff ============================================================================== --- ofbiz/ofbiz-plugins/trunk/ecommerce/widget/CatalogScreens.xml (original) +++ ofbiz/ofbiz-plugins/trunk/ecommerce/widget/CatalogScreens.xml Wed Dec 20 11:08:53 2017 @@ -143,7 +143,7 @@ under the License. <script location="component://order/groovyScripts/entry/catalog/ProductSummary.groovy"/> </actions> <widgets> - <platform-specific><html><html-template location="component://order/template/entry/catalog/ProductSummary.ftl"/></html></platform-specific> + <platform-specific><html><html-template location="component://ecommerce/template/catalog/ProductSummary.ftl"/></html></platform-specific> </widgets> </section> </screen> @@ -222,7 +222,7 @@ under the License. <set field="paginateEcommerceStyle" value="Y"/> </actions> <widgets> - <platform-specific><html><html-template location="component://order/template/entry/catalog/CategoryDetail.ftl"/></html></platform-specific> + <platform-specific><html><html-template location="component://ecommerce/template/catalog/CategoryDetail.ftl"/></html></platform-specific> </widgets> </section> </screen> |
Free forum by Nabble | Edit this page |