📄 configproductdetail.ftl
字号:
<#-- * Copyright (c) 2003-2005 The Open For Business Project - www.ofbiz.org * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * *@author Jacopo Cappellato *@version $Rev: 6358 $ *@since 2.1--><#-- variable setup --><#assign productContentWrapper = productContentWrapper?if_exists><#assign price = priceMap?if_exists><#-- end variable setup --><#-- virtual product javascript -->${virtualJavaScript?if_exists}<script language="JavaScript" type="text/javascript"><!-- var detailImageUrl = null; function setAddProductId(name) { document.addform.add_product_id.value = name; if (document.addform.quantity == null) return; if (name == 'NULL' || isVirtual(name) == true) { document.addform.quantity.disabled = true; } else { document.addform.quantity.disabled = false; } } function isVirtual(product) { var isVirtual = false; <#if virtualJavaScript?exists> for (i = 0; i < VIR.length; i++) { if (VIR[i] == product) { isVirtual = true; } } </#if> return isVirtual; } function addItem() { document.configform.action = document.addform.action; document.configform.quantity.value = document.addform.quantity.value; document.configform.submit(); } function verifyConfig() { document.configform.submit(); } function popupDetail() { var defaultDetailImage = "${firstDetailImage?default(mainDetailImageUrl?default("_NONE_"))}"; if (defaultDetailImage == null || defaultDetailImage == "null") { defaultDetailImage = "_NONE_"; } if (detailImageUrl == null || detailImageUrl == "null") { detailImageUrl = defaultDetailImage; } if (detailImageUrl == "_NONE_") { alert("No detail image available to display."); return; } popUp("<@ofbizUrl>detailImage?detail=" + detailImageUrl + "</@ofbizUrl>", 'detailImage', '400', '550'); } function toggleAmt(toggle) { if (toggle == 'Y') { changeObjectVisibility("add_amount", "visible"); } if (toggle == 'N') { changeObjectVisibility("add_amount", "hidden"); } } function findIndex(name) { for (i = 0; i < OPT.length; i++) { if (OPT[i] == name) { return i; } } return -1; } function getList(name, index, src) { currentFeatureIndex = findIndex(name); if (currentFeatureIndex == 0) { // set the images for the first selection if (IMG[index] != null) { if (document.images['mainImage'] != null) { document.images['mainImage'].src = IMG[index]; detailImageUrl = DET[index]; } } // set the drop down index for swatch selection document.forms["addform"].elements[name].selectedIndex = (index*1)+1; } if (currentFeatureIndex < (OPT.length-1)) { // eval the next list if there are more var selectedValue = document.forms["addform"].elements[name].options[(index*1)+1].value; eval("list" + OPT[(currentFeatureIndex+1)] + selectedValue + "()"); // set the product ID to NULL to trigger the alerts setAddProductId('NULL'); } else { // this is the final selection -- locate the selected index of the last selection var indexSelected = document.forms["addform"].elements[name].selectedIndex; // using the selected index locate the sku var sku = document.forms["addform"].elements[name].options[indexSelected].value; // set the product ID setAddProductId(sku); // check for amount box toggleAmt(checkAmtReq(sku)); } } //--> </script><script language="JavaScript" type="text/javascript"><!-- function resetTotalPrice(name) { }--></script><table border="0" cellpadding="2" cellspacing='0'> <#-- Category next/previous --> <#if category?exists> <tr> <td colspan="2" align="right"> <#if previousProductId?exists> <a href='<@ofbizUrl>product/~category_id=${categoryId?if_exists}/~product_id=${previousProductId?if_exists}</@ofbizUrl>' class="buttontext">[${uiLabelMap.CommonPrevious}]</a> | </#if> <a href="<@ofbizUrl>category/~category_id=${categoryId?if_exists}</@ofbizUrl>" class="buttontext">${category.description?if_exists}</a> <#if nextProductId?exists> | <a href='<@ofbizUrl>product/~category_id=${categoryId?if_exists}/~product_id=${nextProductId?if_exists}</@ofbizUrl>' class="buttontext">[${uiLabelMap.CommonNext}]</a> </#if> </td> </tr> </#if> <tr><td colspan="2"><hr class='sepbar'></td></tr> <#-- Product image/name/price --> <tr> <td align="left" valign="top" width="0"> <#assign productLargeImageUrl = productContentWrapper.get("LARGE_IMAGE_URL")?if_exists> <#-- remove the next two lines to always display the virtual image first (virtual images must exist) --> <#if firstLargeImage?has_content> <#assign productLargeImageUrl = firstLargeImage> </#if> <#if productLargeImageUrl?has_content> <a href="javascript:popupDetail();"><img src='<@ofbizContentUrl>${contentPathPrefix?if_exists}${productLargeImageUrl?if_exists}</@ofbizContentUrl>' name='mainImage' vspace='5' hspace='5' border='0' width='200' align='left'></a> </#if> </td> <td align="right" valign="top"> <div class="head2">${productContentWrapper.get("PRODUCT_NAME")?if_exists}</div> <div class="tabletext">${productContentWrapper.get("DESCRIPTION")?if_exists}</div> <div class="tabletext"><b>${product.productId?if_exists}</b></div> <#-- example of showing a certain type of feature with the product --> <#if sizeProductFeatureAndAppls?has_content> <div class="tabletext"> <#if (sizeProductFeatureAndAppls?size == 1)> Size: <#else> Sizes Available: </#if> <#list sizeProductFeatureAndAppls as sizeProductFeatureAndAppl> ${sizeProductFeatureAndAppl.description?default(sizeProductFeatureAndAppl.abbrev?default(sizeProductFeatureAndAppl.productFeatureId))}<#if sizeProductFeatureAndAppl_has_next>,</#if> </#list> </div> </#if> <#-- for prices: - if totalPrice is present, use it (totalPrice is the price calculated from the parts) - if price < competitivePrice, show competitive or "Compare At" price - if price < listPrice, show list price - if price < defaultPrice and defaultPrice < listPrice, show default - if isSale show price with salePrice style and print "On Sale!" --> <#if totalPrice?exists> <div class="tabletext">${uiLabelMap.ProductAggregatedPrice}: <span class='basePrice'><@ofbizCurrency amount=totalPrice isoCode=price.currencyUsed/></span></div> <#else> <#if price.competitivePrice?exists && price.price?exists && price.price?double < price.competitivePrice?double> <div class="tabletext">${uiLabelMap.ProductCompareAtPrice}: <span class='basePrice'><@ofbizCurrency amount=price.competitivePrice isoCode=price.currencyUsed/></span></div> </#if> <#if price.listPrice?exists && price.price?exists && price.price?double < price.listPrice?double> <div class="tabletext">${uiLabelMap.ProductListPrice}: <span class='basePrice'><@ofbizCurrency amount=price.listPrice isoCode=price.currencyUsed/></span></div> </#if> <#if price.listPrice?exists && price.defaultPrice?exists && price.price?exists && price.price?double < price.defaultPrice?double && price.defaultPrice?double < price.listPrice?double> <div class="tabletext">${uiLabelMap.ProductRegularPrice}: <span class='basePrice'><@ofbizCurrency amount=price.defaultPrice isoCode=price.currencyUsed/></span></div> </#if> <div class="tabletext"> <b> <#if price.isSale?exists && price.isSale> <span class='salePrice'>${uiLabelMap.EcommerceOnSale}!</span> <#assign priceStyle = "salePrice"> <#else> <#assign priceStyle = "regularPrice"> </#if> ${uiLabelMap.EcommerceYourPrice}: <#if "Y" = product.isVirtual?if_exists> from </#if><span class='${priceStyle}'><@ofbizCurrency amount=price.price isoCode=price.currencyUsed/></span> </b>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -