📄 productdetail.ftl
字号:
<#-- * Copyright (c) 2003-2006 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 David E. Jones (jonesde@ofbiz.org) *@author Andy Zeneski (jaz@ofbiz.org) *@version $Rev: 7275 $ *@since 2.1--><#-- variable setup --><#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() { if (document.addform.add_product_id.value == 'NULL') { alert("Please select all of the required options."); return; } else { if (isVirtual(document.addform.add_product_id.value)) { document.location = '<@ofbizUrl>product?category_id=${categoryId?if_exists}&product_id=</@ofbizUrl>' + document.addform.add_product_id.value; return; } else { document.addform.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)); } } function validate(x){ var msg=new Array(); msg[0]="Please use correct date format [yyyy-mm-dd]"; var y=x.split("-"); if(y.length!=3){ alert(msg[0]);return false; } if((y[2].length>2)||(parseInt(y[2])>31)) { alert(msg[0]); return false; } if(y[2].length==1){ y[2]="0"+y[2]; } if((y[1].length>2)||(parseInt(y[1])>12)){ alert(msg[0]); return false; } if(y[1].length==1){ y[1]="0"+y[1]; } if(y[0].length>4){ alert(msg[0]); return false; } if(y[0].length<4) { if(y[0].length==2) { y[0]="20"+y[0]; } else { alert(msg[0]); return false; } } return (y[0]+"-"+y[1]+"-"+y[2]); } function additemSubmit(){ <#if product.productTypeId?if_exists == "ASSET_USAGE"> newdatevalue = validate(document.addform.reservStart.value); if (newdatevalue == false) { document.addform.reservStart.focus(); } else { document.addform.reservStart.value = newdatevalue; document.addform.submit(); } <#else> document.addform.submit(); </#if> } function addShoplistSubmit(){ <#if product.productTypeId?if_exists == "ASSET_USAGE"> if (document.addToShoppingList.reservStartStr.value == "") { document.addToShoppingList.submit(); } else { newdatevalue = validate(document.addToShoppingList.reservStartStr.value); if (newdatevalue == false) { document.addToShoppingList.reservStartStr.focus(); } else { document.addToShoppingList.reservStartStr.value = newdatevalue; // document.addToShoppingList.reservStart.value = ; document.addToShoppingList.reservStartStr.value.slice(0,9)+" 00:00:00.000000000"; document.addToShoppingList.submit(); } } <#else> document.addToShoppingList.submit(); </#if> } //--> </script><div id="productdetail"><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>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -