svn commit: r1073639 - /ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/catalog/productdetail.ftl

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

svn commit: r1073639 - /ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/catalog/productdetail.ftl

jleroux@apache.org
Author: jleroux
Date: Wed Feb 23 08:38:05 2011
New Revision: 1073639

URL: http://svn.apache.org/viewvc?rev=1073639&view=rev
Log:
Adds a div at EOF, thanks to Mike at OFBIZ-4184

I figured out the problem with the footer appearing in
the center (below product) on ProductDetail. There was a </div>
missing at the very bottom of:

OFBIZ_HOME/specialpurpose/ecommerce/webapp/ecommerce/catalog/productdetail.ftl

</div>
</div> <----- ADD additional closing DIV.

Product detail now correctly renders.

Modified:
    ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/catalog/productdetail.ftl

Modified: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/catalog/productdetail.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/catalog/productdetail.ftl?rev=1073639&r1=1073638&r2=1073639&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/catalog/productdetail.ftl (original)
+++ ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/catalog/productdetail.ftl Wed Feb 23 08:38:05 2011
@@ -323,544 +323,545 @@ ${virtualVariantJavaScript?if_exists}
 </#macro>
 
 <div id="productdetail">
-<#assign productAdditionalImage1 = productContentWrapper.get("ADDITIONAL_IMAGE_1")?if_exists />
-<#assign productAdditionalImage2 = productContentWrapper.get("ADDITIONAL_IMAGE_2")?if_exists />
-<#assign productAdditionalImage3 = productContentWrapper.get("ADDITIONAL_IMAGE_3")?if_exists />
-<#assign productAdditionalImage4 = productContentWrapper.get("ADDITIONAL_IMAGE_4")?if_exists />
-
-  <#-- Category next/previous -->
-  <#if category?exists>
-      <div id="paginationBox">
-        <#if previousProductId?exists>
-          <a href="<@ofbizUrl>product/~category_id=${categoryId?if_exists}/~product_id=${previousProductId?if_exists}</@ofbizUrl>" class="buttontext">${uiLabelMap.CommonPrevious}</a>&nbsp;|&nbsp;
-        </#if>
-        <a href="<@ofbizUrl>category/~category_id=${categoryId?if_exists}</@ofbizUrl>" class="linktext">${(category.categoryName)?default(category.description)?if_exists}</a>
-        <#if nextProductId?exists>
-          &nbsp;|&nbsp;<a href="<@ofbizUrl>product/~category_id=${categoryId?if_exists}/~product_id=${nextProductId?if_exists}</@ofbizUrl>" class="buttontext">${uiLabelMap.CommonNext}</a>
-        </#if>
-      </div>
-  </#if>
-
-<hr />
-<div id="productImageBox">
-    <#assign userLoginSecurityGroup = delegator.findByAnd("UserLoginSecurityGroup", Static["org.ofbiz.base.util.UtilMisc"].toMap("groupId", "IMAGEADMIN"))>
-    <#if userLoginSecurityGroup != null && userLoginSecurityGroup?has_content>
-        <#-- Product image/name/price -->
-        <div id="detailImageBox">
-            <#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?string?has_content>
-                <a href="javascript:popupDetail();"><img id="detailImage" src="<@ofbizContentUrl>${contentPathPrefix?if_exists}${productLargeImageUrl?if_exists}</@ofbizContentUrl>" name="mainImage" vspace="5" hspace="5" width="200" alt="" /></a>
-                <input type="hidden" id="originalImage" name="originalImage" value="<@ofbizContentUrl>${contentPathPrefix?if_exists}${productLargeImageUrl?if_exists}</@ofbizContentUrl>" />
-            </#if>
-            <#if !productLargeImageUrl?string?has_content>
-                <img id="detailImage" src="/images/defaultImage.jpg" name="mainImage" alt="" />
-            </#if>
-        </div>
-        <#-- Show Image Approved -->
-        <#assign productContentAndInfos = delegator.findByAnd("ProductContentAndInfo", {"productId", product.productId?if_exists, "productContentTypeId", "IMAGE", "statusId", "IM_APPROVED", "drIsPublic", "Y"}, Static["org.ofbiz.base.util.UtilMisc"].toList("sequenceNum"))>
-        <div id="additionalImageBox">
-            <#if productContentAndInfos?has_content>
-                <#list productContentAndInfos as productContentAndInfo>
-                    <#assign contentAssocs  = delegator.findByAnd("ContentAssoc",Static["org.ofbiz.base.util.UtilMisc"].toMap("contentId", productContentAndInfo.contentId?if_exists, "contentAssocTypeId", "IMAGE_THUMBNAIL"))/>
-                    <#if contentAssocs?has_content>
-                        <#list contentAssocs as contentAssoc>
-                            <#assign ImageContent = delegator.findByPrimaryKey("Content", Static["org.ofbiz.base.util.UtilMisc"].toMap("contentId", contentAssoc.contentIdTo))?if_exists>
-                            <#assign contentDataResourceView = delegator.findByPrimaryKey("ContentDataResourceView", Static["org.ofbiz.base.util.UtilMisc"].toMap("contentId", contentAssoc.contentIdTo, "drDataResourceId", ImageContent.dataResourceId))?if_exists>
-                            <div class="additionalImage">
-                                <a href="javascript:void(0);" swapDetail="<@ofbizContentUrl>${productContentAndInfo.drObjectInfo}</@ofbizContentUrl>"><img src="<@ofbizContentUrl>${contentDataResourceView.drObjectInfo}</@ofbizContentUrl>" vspace="5" hspace="5" alt="" /></a>
-                            </div>
-                        </#list>
-                    </#if>
-                </#list>
-            </#if>
-        </div>
-    <#else>
-        <#-- Product image/name/price -->
-        <div id="detailImageBox">
-            <#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?string?has_content>
-                <a href="javascript:popupDetail();"><img id="detailImage" src="<@ofbizContentUrl>${contentPathPrefix?if_exists}${productLargeImageUrl?if_exists}</@ofbizContentUrl>" name="mainImage" vspace="5" hspace="5" width="200" alt="" /></a>
-                <input type="hidden" id="originalImage" name="originalImage" value="<@ofbizContentUrl>${contentPathPrefix?if_exists}${productLargeImageUrl?if_exists}</@ofbizContentUrl>" />
-            </#if>
-            <#if !productLargeImageUrl?string?has_content>
-                <img id="detailImage" src="/images/defaultImage.jpg" name="mainImage" alt="" />
-            </#if>
-        </div>
-        <div id="additionalImageBox">
-            <#if productAdditionalImage1?string?has_content>
-                <div class="additionalImage">
-                    <a href="javascript:void(0);" swapDetail="<@ofbizContentUrl>${productAdditionalImage1}</@ofbizContentUrl>"><img src="<@ofbizContentUrl>${productAdditionalImage1}</@ofbizContentUrl>" vspace="5" hspace="5" width="200" alt="" /></a>
-                </div>
-            </#if>
-            <#if productAdditionalImage2?string?has_content>
-                <div class="additionalImage">
-                    <a href="javascript:void(0);" swapDetail="<@ofbizContentUrl>${productAdditionalImage2}</@ofbizContentUrl>"><img src="<@ofbizContentUrl>${productAdditionalImage2}</@ofbizContentUrl>" vspace="5" hspace="5" width="200" alt="" /></a>
-                </div>
-            </#if>
-            <#if productAdditionalImage3?string?has_content>
-                <div class="additionalImage">
-                    <a href="javascript:void(0);" swapDetail="<@ofbizContentUrl>${productAdditionalImage3}</@ofbizContentUrl>"><img src="<@ofbizContentUrl>${productAdditionalImage3}</@ofbizContentUrl>" vspace="5" hspace="5" width="200" alt="" /></a>
-                </div>
-            </#if>
-            <#if productAdditionalImage4?string?has_content>
-                <div class="additionalImage">
-                    <a href="javascript:void(0);" swapDetail="<@ofbizContentUrl>${productAdditionalImage4}</@ofbizContentUrl>"><img src="<@ofbizContentUrl>${productAdditionalImage4}</@ofbizContentUrl>" vspace="5" hspace="5" width="200" alt="" /></a>
-                </div>
+    <#assign productAdditionalImage1 = productContentWrapper.get("ADDITIONAL_IMAGE_1")?if_exists />
+    <#assign productAdditionalImage2 = productContentWrapper.get("ADDITIONAL_IMAGE_2")?if_exists />
+    <#assign productAdditionalImage3 = productContentWrapper.get("ADDITIONAL_IMAGE_3")?if_exists />
+    <#assign productAdditionalImage4 = productContentWrapper.get("ADDITIONAL_IMAGE_4")?if_exists />
+    
+      <#-- Category next/previous -->
+      <#if category?exists>
+          <div id="paginationBox">
+            <#if previousProductId?exists>
+              <a href="<@ofbizUrl>product/~category_id=${categoryId?if_exists}/~product_id=${previousProductId?if_exists}</@ofbizUrl>" class="buttontext">${uiLabelMap.CommonPrevious}</a>&nbsp;|&nbsp;
+            </#if>
+            <a href="<@ofbizUrl>category/~category_id=${categoryId?if_exists}</@ofbizUrl>" class="linktext">${(category.categoryName)?default(category.description)?if_exists}</a>
+            <#if nextProductId?exists>
+              &nbsp;|&nbsp;<a href="<@ofbizUrl>product/~category_id=${categoryId?if_exists}/~product_id=${nextProductId?if_exists}</@ofbizUrl>" class="buttontext">${uiLabelMap.CommonNext}</a>
             </#if>
-        </div>
-    </#if>
+          </div>
+      </#if>
     
-    <div id="productDetailBox">
-      <h2>${productContentWrapper.get("PRODUCT_NAME")?if_exists}</h2>
-      <div>${productContentWrapper.get("DESCRIPTION")?if_exists}</div>
-      <div>${product.productId?if_exists}</div>
-      <#-- example of showing a certain type of feature with the product -->
-      <#if sizeProductFeatureAndAppls?has_content>
-        <div>
-          <#if (sizeProductFeatureAndAppls?size == 1)>
-            <#-- TODO : i18n -->
-            Size:
-          <#else>
-            Sizes Available:
+    <hr />
+    <div id="productImageBox">
+        <#assign userLoginSecurityGroup = delegator.findByAnd("UserLoginSecurityGroup", Static["org.ofbiz.base.util.UtilMisc"].toMap("groupId", "IMAGEADMIN"))>
+        <#if userLoginSecurityGroup != null && userLoginSecurityGroup?has_content>
+            <#-- Product image/name/price -->
+            <div id="detailImageBox">
+                <#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?string?has_content>
+                    <a href="javascript:popupDetail();"><img id="detailImage" src="<@ofbizContentUrl>${contentPathPrefix?if_exists}${productLargeImageUrl?if_exists}</@ofbizContentUrl>" name="mainImage" vspace="5" hspace="5" width="200" alt="" /></a>
+                    <input type="hidden" id="originalImage" name="originalImage" value="<@ofbizContentUrl>${contentPathPrefix?if_exists}${productLargeImageUrl?if_exists}</@ofbizContentUrl>" />
+                </#if>
+                <#if !productLargeImageUrl?string?has_content>
+                    <img id="detailImage" src="/images/defaultImage.jpg" name="mainImage" alt="" />
+                </#if>
+            </div>
+            <#-- Show Image Approved -->
+            <#assign productContentAndInfos = delegator.findByAnd("ProductContentAndInfo", {"productId", product.productId?if_exists, "productContentTypeId", "IMAGE", "statusId", "IM_APPROVED", "drIsPublic", "Y"}, Static["org.ofbiz.base.util.UtilMisc"].toList("sequenceNum"))>
+            <div id="additionalImageBox">
+                <#if productContentAndInfos?has_content>
+                    <#list productContentAndInfos as productContentAndInfo>
+                        <#assign contentAssocs  = delegator.findByAnd("ContentAssoc",Static["org.ofbiz.base.util.UtilMisc"].toMap("contentId", productContentAndInfo.contentId?if_exists, "contentAssocTypeId", "IMAGE_THUMBNAIL"))/>
+                        <#if contentAssocs?has_content>
+                            <#list contentAssocs as contentAssoc>
+                                <#assign ImageContent = delegator.findByPrimaryKey("Content", Static["org.ofbiz.base.util.UtilMisc"].toMap("contentId", contentAssoc.contentIdTo))?if_exists>
+                                <#assign contentDataResourceView = delegator.findByPrimaryKey("ContentDataResourceView", Static["org.ofbiz.base.util.UtilMisc"].toMap("contentId", contentAssoc.contentIdTo, "drDataResourceId", ImageContent.dataResourceId))?if_exists>
+                                <div class="additionalImage">
+                                    <a href="javascript:void(0);" swapDetail="<@ofbizContentUrl>${productContentAndInfo.drObjectInfo}</@ofbizContentUrl>"><img src="<@ofbizContentUrl>${contentDataResourceView.drObjectInfo}</@ofbizContentUrl>" vspace="5" hspace="5" alt="" /></a>
+                                </div>
+                            </#list>  
+                        </#if>
+                    </#list>
+                </#if>
+            </div>
+        <#else>
+            <#-- Product image/name/price -->
+            <div id="detailImageBox">
+                <#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?string?has_content>
+                    <a href="javascript:popupDetail();"><img id="detailImage" src="<@ofbizContentUrl>${contentPathPrefix?if_exists}${productLargeImageUrl?if_exists}</@ofbizContentUrl>" name="mainImage" vspace="5" hspace="5" width="200" alt="" /></a>
+                    <input type="hidden" id="originalImage" name="originalImage" value="<@ofbizContentUrl>${contentPathPrefix?if_exists}${productLargeImageUrl?if_exists}</@ofbizContentUrl>" />
+                </#if>
+                <#if !productLargeImageUrl?string?has_content>
+                    <img id="detailImage" src="/images/defaultImage.jpg" name="mainImage" alt="" />
+                </#if>
+            </div>
+            <div id="additionalImageBox">
+                <#if productAdditionalImage1?string?has_content>
+                    <div class="additionalImage">
+                        <a href="javascript:void(0);" swapDetail="<@ofbizContentUrl>${productAdditionalImage1}</@ofbizContentUrl>"><img src="<@ofbizContentUrl>${productAdditionalImage1}</@ofbizContentUrl>" vspace="5" hspace="5" width="200" alt="" /></a>
+                    </div>
+                </#if>
+                <#if productAdditionalImage2?string?has_content>
+                    <div class="additionalImage">
+                        <a href="javascript:void(0);" swapDetail="<@ofbizContentUrl>${productAdditionalImage2}</@ofbizContentUrl>"><img src="<@ofbizContentUrl>${productAdditionalImage2}</@ofbizContentUrl>" vspace="5" hspace="5" width="200" alt="" /></a>
+                    </div>
+                </#if>
+                <#if productAdditionalImage3?string?has_content>
+                    <div class="additionalImage">
+                        <a href="javascript:void(0);" swapDetail="<@ofbizContentUrl>${productAdditionalImage3}</@ofbizContentUrl>"><img src="<@ofbizContentUrl>${productAdditionalImage3}</@ofbizContentUrl>" vspace="5" hspace="5" width="200" alt="" /></a>
+                    </div>
+                </#if>
+                <#if productAdditionalImage4?string?has_content>
+                    <div class="additionalImage">
+                        <a href="javascript:void(0);" swapDetail="<@ofbizContentUrl>${productAdditionalImage4}</@ofbizContentUrl>"><img src="<@ofbizContentUrl>${productAdditionalImage4}</@ofbizContentUrl>" vspace="5" hspace="5" width="200" alt="" /></a>
+                    </div>
+                </#if>
+            </div>
+        </#if>
+        
+        <div id="productDetailBox">
+          <h2>${productContentWrapper.get("PRODUCT_NAME")?if_exists}</h2>
+          <div>${productContentWrapper.get("DESCRIPTION")?if_exists}</div>
+          <div>${product.productId?if_exists}</div>
+          <#-- example of showing a certain type of feature with the product -->
+          <#if sizeProductFeatureAndAppls?has_content>
+            <div>
+              <#if (sizeProductFeatureAndAppls?size == 1)>
+                <#-- TODO : i18n -->
+                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>
-          <#list sizeProductFeatureAndAppls as sizeProductFeatureAndAppl>
-            ${sizeProductFeatureAndAppl.description?default(sizeProductFeatureAndAppl.abbrev?default(sizeProductFeatureAndAppl.productFeatureId))}<#if sizeProductFeatureAndAppl_has_next>,</#if>
-          </#list>
-        </div>
-      </#if>
-
-      <#-- for prices:
-              - 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 price.competitivePrice?exists && price.price?exists && price.price &lt; price.competitivePrice>
-        <div>${uiLabelMap.ProductCompareAtPrice}: <span class="basePrice"><@ofbizCurrency amount=price.competitivePrice isoCode=price.currencyUsed /></span></div>
-      </#if>
-      <#if price.listPrice?exists && price.price?exists && price.price &lt; price.listPrice>
-        <div>${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 &lt; price.defaultPrice && price.defaultPrice &lt; price.listPrice>
-        <div>${uiLabelMap.ProductRegularPrice}: <span class="basePrice"><@ofbizCurrency amount=price.defaultPrice isoCode=price.currencyUsed /></span></div>
-      </#if>
-      <#if price.specialPromoPrice?exists>
-        <div>${uiLabelMap.ProductSpecialPromoPrice}: <span class="basePrice"><@ofbizCurrency amount=price.specialPromoPrice isoCode=price.currencyUsed /></span></div>
-      </#if>
-      <div>
-        <strong>
-          <#if price.isSale?exists && price.isSale>
-            <span class="salePrice">${uiLabelMap.OrderOnSale}!</span>
-            <#assign priceStyle = "salePrice" />
-          <#else>
-            <#assign priceStyle = "regularPrice" />
+    
+          <#-- for prices:
+                  - 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 price.competitivePrice?exists && price.price?exists && price.price &lt; price.competitivePrice>
+            <div>${uiLabelMap.ProductCompareAtPrice}: <span class="basePrice"><@ofbizCurrency amount=price.competitivePrice isoCode=price.currencyUsed /></span></div>
           </#if>
-            ${uiLabelMap.OrderYourPrice}: <#if "Y" = product.isVirtual?if_exists> ${uiLabelMap.CommonFrom} </#if><span class="${priceStyle}"><@ofbizCurrency amount=price.price isoCode=price.currencyUsed /></span>
-             <#if product.productTypeId?if_exists == "ASSET_USAGE">
-            <#if product.reserv2ndPPPerc?exists && product.reserv2ndPPPerc != 0><br /><span class="${priceStyle}">${uiLabelMap.ProductReserv2ndPPPerc}<#if !product.reservNthPPPerc?exists || product.reservNthPPPerc == 0>${uiLabelMap.CommonUntil} ${product.reservMaxPersons?if_exists}</#if> <@ofbizCurrency amount=product.reserv2ndPPPerc*price.price/100 isoCode=price.currencyUsed /></span></#if>
-            <#if product.reservNthPPPerc?exists &&product.reservNthPPPerc != 0><br /><span class="${priceStyle}">${uiLabelMap.ProductReservNthPPPerc} <#if !product.reserv2ndPPPerc?exists || product.reserv2ndPPPerc == 0>${uiLabelMap.ProductReservSecond} <#else> ${uiLabelMap.ProductReservThird} </#if> ${uiLabelMap.CommonUntil} ${product.reservMaxPersons?if_exists}, ${uiLabelMap.ProductEach}: <@ofbizCurrency amount=product.reservNthPPPerc*price.price/100 isoCode=price.currencyUsed /></span></#if>
-            <#if (!product.reserv2ndPPPerc?exists || product.reserv2ndPPPerc == 0) && (!product.reservNthPPPerc?exists || product.reservNthPPPerc == 0)><br />${uiLabelMap.ProductMaximum} ${product.reservMaxPersons?if_exists} ${uiLabelMap.ProductPersons}.</#if>
-             </#if>
-         </strong>
-      </div>
-      <#if price.listPrice?exists && price.price?exists && price.price &lt; price.listPrice>
-        <#assign priceSaved = price.listPrice - price.price />
-        <#assign percentSaved = (priceSaved / price.listPrice) * 100 />
-        <div>${uiLabelMap.OrderSave}: <span class="basePrice"><@ofbizCurrency amount=priceSaved isoCode=price.currencyUsed /> (${percentSaved?int}%)</span></div>
-      </#if>
-      <#-- show price details ("showPriceDetails" field can be set in the screen definition) -->
-      <#if (showPriceDetails?exists && showPriceDetails?default("N") == "Y")>
-          <#if price.orderItemPriceInfos?exists>
-              <#list price.orderItemPriceInfos as orderItemPriceInfo>
-                  <div>${orderItemPriceInfo.description?if_exists}</div>
-              </#list>
+          <#if price.listPrice?exists && price.price?exists && price.price &lt; price.listPrice>
+            <div>${uiLabelMap.ProductListPrice}: <span class="basePrice"><@ofbizCurrency amount=price.listPrice isoCode=price.currencyUsed /></span></div>
           </#if>
-      </#if>
-
-      <#-- Included quantities/pieces -->
-      <#if product.piecesIncluded?exists && product.piecesIncluded?long != 0>
-        <div>
-          ${uiLabelMap.OrderPieces}: ${product.piecesIncluded}
-        </div>
-      </#if>
-      <#if (product.quantityIncluded?exists && product.quantityIncluded != 0) || product.quantityUomId?has_content>
-        <#assign quantityUom = product.getRelatedOneCache("QuantityUom")?if_exists />
-        <div>
-          ${uiLabelMap.CommonQuantity}: ${product.quantityIncluded?if_exists} ${((quantityUom.abbreviation)?default(product.quantityUomId))?if_exists}
-        </div>
-      </#if>
-
-      <#if (product.weight?exists && product.weight != 0) || product.weightUomId?has_content>
-        <#assign weightUom = product.getRelatedOneCache("WeightUom")?if_exists />
-        <div>
-          ${uiLabelMap.CommonWeight}: ${product.weight?if_exists} ${((weightUom.abbreviation)?default(product.weightUomId))?if_exists}
-        </div>
-      </#if>
-      <#if (product.productHeight?exists && product.productHeight != 0) || product.heightUomId?has_content>
-        <#assign heightUom = product.getRelatedOneCache("HeightUom")?if_exists />
-        <div>
-          ${uiLabelMap.CommonHeight}: ${product.productHeight?if_exists} ${((heightUom.abbreviation)?default(product.heightUomId))?if_exists}
-        </div>
-      </#if>
-      <#if (product.productWidth?exists && product.productWidth != 0) || product.widthUomId?has_content>
-        <#assign widthUom = product.getRelatedOneCache("WidthUom")?if_exists />
-        <div>
-          ${uiLabelMap.CommonWidth}: ${product.productWidth?if_exists} ${((widthUom.abbreviation)?default(product.widthUomId))?if_exists}
-        </div>
-      </#if>
-      <#if (product.productDepth?exists && product.productDepth != 0) || product.depthUomId?has_content>
-        <#assign depthUom = product.getRelatedOneCache("DepthUom")?if_exists />
-        <div>
-          ${uiLabelMap.CommonDepth}: ${product.productDepth?if_exists} ${((depthUom.abbreviation)?default(product.depthUomId))?if_exists}
-        </div>
-      </#if>
-
-      <#if daysToShip?exists>
-        <div><strong>${uiLabelMap.ProductUsuallyShipsIn} ${daysToShip} ${uiLabelMap.CommonDays}!</strong></div>
-      </#if>
-
-      <#-- show tell a friend details only in ecommerce application -->
-      <div>&nbsp;</div>
-      <div>
-          <a href="javascript:popUpSmall('<@ofbizUrl>tellafriend?productId=${product.productId}</@ofbizUrl>','tellafriend');" class="buttontext">${uiLabelMap.CommonTellAFriend}</a>
-      </div>
-
-      <#if disFeatureList?exists && 0 &lt; disFeatureList.size()>
-      <p>&nbsp;</p>
-        <#list disFeatureList as currentFeature>
-            <#assign disFeatureType = currentFeature.getRelatedOneCache("ProductFeatureType") />
+          <#if price.listPrice?exists && price.defaultPrice?exists && price.price?exists && price.price &lt; price.defaultPrice && price.defaultPrice &lt; price.listPrice>
+            <div>${uiLabelMap.ProductRegularPrice}: <span class="basePrice"><@ofbizCurrency amount=price.defaultPrice isoCode=price.currencyUsed /></span></div>
+          </#if>
+          <#if price.specialPromoPrice?exists>
+            <div>${uiLabelMap.ProductSpecialPromoPrice}: <span class="basePrice"><@ofbizCurrency amount=price.specialPromoPrice isoCode=price.currencyUsed /></span></div>
+          </#if>
+          <div>
+            <strong>
+              <#if price.isSale?exists && price.isSale>
+                <span class="salePrice">${uiLabelMap.OrderOnSale}!</span>
+                <#assign priceStyle = "salePrice" />
+              <#else>
+                <#assign priceStyle = "regularPrice" />
+              </#if>
+                ${uiLabelMap.OrderYourPrice}: <#if "Y" = product.isVirtual?if_exists> ${uiLabelMap.CommonFrom} </#if><span class="${priceStyle}"><@ofbizCurrency amount=price.price isoCode=price.currencyUsed /></span>
+                 <#if product.productTypeId?if_exists == "ASSET_USAGE">
+                <#if product.reserv2ndPPPerc?exists && product.reserv2ndPPPerc != 0><br /><span class="${priceStyle}">${uiLabelMap.ProductReserv2ndPPPerc}<#if !product.reservNthPPPerc?exists || product.reservNthPPPerc == 0>${uiLabelMap.CommonUntil} ${product.reservMaxPersons?if_exists}</#if> <@ofbizCurrency amount=product.reserv2ndPPPerc*price.price/100 isoCode=price.currencyUsed /></span></#if>
+                <#if product.reservNthPPPerc?exists &&product.reservNthPPPerc != 0><br /><span class="${priceStyle}">${uiLabelMap.ProductReservNthPPPerc} <#if !product.reserv2ndPPPerc?exists || product.reserv2ndPPPerc == 0>${uiLabelMap.ProductReservSecond} <#else> ${uiLabelMap.ProductReservThird} </#if> ${uiLabelMap.CommonUntil} ${product.reservMaxPersons?if_exists}, ${uiLabelMap.ProductEach}: <@ofbizCurrency amount=product.reservNthPPPerc*price.price/100 isoCode=price.currencyUsed /></span></#if>
+                <#if (!product.reserv2ndPPPerc?exists || product.reserv2ndPPPerc == 0) && (!product.reservNthPPPerc?exists || product.reservNthPPPerc == 0)><br />${uiLabelMap.ProductMaximum} ${product.reservMaxPersons?if_exists} ${uiLabelMap.ProductPersons}.</#if>
+                 </#if>
+             </strong>
+          </div>
+          <#if price.listPrice?exists && price.price?exists && price.price &lt; price.listPrice>
+            <#assign priceSaved = price.listPrice - price.price />
+            <#assign percentSaved = (priceSaved / price.listPrice) * 100 />
+            <div>${uiLabelMap.OrderSave}: <span class="basePrice"><@ofbizCurrency amount=priceSaved isoCode=price.currencyUsed /> (${percentSaved?int}%)</span></div>
+          </#if>
+          <#-- show price details ("showPriceDetails" field can be set in the screen definition) -->
+          <#if (showPriceDetails?exists && showPriceDetails?default("N") == "Y")>
+              <#if price.orderItemPriceInfos?exists>
+                  <#list price.orderItemPriceInfos as orderItemPriceInfo>
+                      <div>${orderItemPriceInfo.description?if_exists}</div>
+                  </#list>
+              </#if>
+          </#if>
+    
+          <#-- Included quantities/pieces -->
+          <#if product.piecesIncluded?exists && product.piecesIncluded?long != 0>
             <div>
-                <#if disFeatureType.description?exists>${disFeatureType.get("description", locale)}<#else>${currentFeature.productFeatureTypeId}</#if>:&nbsp;${currentFeature.description}
+              ${uiLabelMap.OrderPieces}: ${product.piecesIncluded}
             </div>
-        </#list>
-            <div>&nbsp;</div>
-      </#if>
-    </div>
-
-    <div id="addItemForm">
-      <form method="post" action="<@ofbizUrl>additem</@ofbizUrl>" name="addform"  style="margin: 0;">
-      <fieldset>
-        <#assign inStock = true />
-        <#-- Variant Selection -->
-        <#if product.isVirtual?if_exists?upper_case == "Y">
-          <#if product.virtualVariantMethodEnum?if_exists == "VV_FEATURETREE" && featureLists?has_content>
-            <#list featureLists as featureList>
-                <#list featureList as feature>
-                    <#if feature_index == 0>
-                        <div>${feature.description}: <select id="FT${feature.productFeatureTypeId}" name="FT${feature.productFeatureTypeId}" onchange="javascript:checkRadioButton();">
-                        <option value="select" selected="selected"> select option </option>
-                    <#else>
-                        <option value="${feature.productFeatureId}">${feature.description} <#if feature.price?exists>(+ <@ofbizCurrency amount=feature.price?string isoCode=feature.currencyUomId />)</#if></option>
-                    </#if>
-                </#list>
-                </select>
-                </div>
-            </#list>
-              <input type="hidden" name="add_product_id" value="${product.productId}" />
-            <div id="addCart1" style="display:none;">
-              <span style="white-space: nowrap;"><strong>${uiLabelMap.CommonQuantity}:</strong></span>&nbsp;
-              <input type="text" size="5" name="quantity" value="1" />
-              <a href="javascript:javascript:addItem();" class="buttontext"><span style="white-space: nowrap;">${uiLabelMap.OrderAddToCart}</span></a>
-              &nbsp;
-            </div>
-            <div id="addCart2" style="display:block;">
-              <span style="white-space: nowrap;"><strong>${uiLabelMap.CommonQuantity}:</strong></span>&nbsp;
-              <input type="text" size="5" value="1" disabled="disabled" />
-              <a href="javascript:showErrorAlert("${uiLabelMap.CommonErrorMessage2}","${uiLabelMap.CommonPleaseSelectAllFeaturesFirst}");" class="buttontext"><span style="white-space: nowrap;">${uiLabelMap.OrderAddToCart}</span></a>
-              &nbsp;
-            </div>
-          </#if>
-          <#if !product.virtualVariantMethodEnum?exists || product.virtualVariantMethodEnum == "VV_VARIANTTREE">
-           <#if variantTree?exists && (variantTree.size() &gt; 0)>
-            <#list featureSet as currentType>
-              <div>
-                <select name="FT${currentType}" onchange="javascript:getList(this.name, (this.selectedIndex-1), 1);">
-                  <option>${featureTypes.get(currentType)}</option>
-                </select>
-              </div>
-            </#list>
-            <span id="product_uom"></span>
-            <input type="hidden" name="product_id" value="${product.productId}"/>
-            <input type="hidden" name="add_product_id" value="NULL"/>
+          </#if>
+          <#if (product.quantityIncluded?exists && product.quantityIncluded != 0) || product.quantityUomId?has_content>
+            <#assign quantityUom = product.getRelatedOneCache("QuantityUom")?if_exists />
             <div>
-              <strong><span id="product_id_display"> </span></strong>
-              <strong><div id="variant_price_display"> </div></strong>
+              ${uiLabelMap.CommonQuantity}: ${product.quantityIncluded?if_exists} ${((quantityUom.abbreviation)?default(product.quantityUomId))?if_exists}
             </div>
-          <#else>
-            <input type="hidden" name="add_product_id" value="NULL"/>
-            <#assign inStock = false />
           </#if>
-         </#if>
-        <#else>
-          <input type="hidden" name="add_product_id" value="${product.productId}" />
-          <#if mainProducts?has_content>
-            <input type="hidden" name="product_id" value=""/>
-            <select name="productVariantId" onchange="javascript:displayProductVirtualVariantId(this.value);">
-                <option value="">Select Unit Of Measure</option>
-                <#list mainProducts as mainProduct>
-                    <option value="${mainProduct.productId}">${mainProduct.uomDesc} : ${mainProduct.piecesIncluded}</option>
-                </#list>
-            </select><br/>
+    
+          <#if (product.weight?exists && product.weight != 0) || product.weightUomId?has_content>
+            <#assign weightUom = product.getRelatedOneCache("WeightUom")?if_exists />
+            <div>
+              ${uiLabelMap.CommonWeight}: ${product.weight?if_exists} ${((weightUom.abbreviation)?default(product.weightUomId))?if_exists}
+            </div>
+          </#if>
+          <#if (product.productHeight?exists && product.productHeight != 0) || product.heightUomId?has_content>
+            <#assign heightUom = product.getRelatedOneCache("HeightUom")?if_exists />
             <div>
-              <strong><span id="product_id_display"> </span></strong>
-              <strong><div id="variant_price_display"> </div></strong>
+              ${uiLabelMap.CommonHeight}: ${product.productHeight?if_exists} ${((heightUom.abbreviation)?default(product.heightUomId))?if_exists}
             </div>
           </#if>
-          <#if (availableInventory?exists) && (availableInventory <= 0)>
-            <#assign inStock = false />
+          <#if (product.productWidth?exists && product.productWidth != 0) || product.widthUomId?has_content>
+            <#assign widthUom = product.getRelatedOneCache("WidthUom")?if_exists />
+            <div>
+              ${uiLabelMap.CommonWidth}: ${product.productWidth?if_exists} ${((widthUom.abbreviation)?default(product.widthUomId))?if_exists}
+            </div>
           </#if>
-        </#if>
-        <#-- check to see if introductionDate hasnt passed yet -->
-        <#if product.introductionDate?exists && nowTimestamp.before(product.introductionDate)>
-        <p>&nbsp;</p>
-          <div style="color: red;">${uiLabelMap.ProductProductNotYetMadeAvailable}.</div>
-        <#-- check to see if salesDiscontinuationDate has passed -->
-        <#elseif product.salesDiscontinuationDate?exists && nowTimestamp.after(product.salesDiscontinuationDate)>
-          <div style="color: red;">${uiLabelMap.ProductProductNoLongerAvailable}.</div>
-        <#-- check to see if the product requires inventory check and has inventory -->
-        <#elseif product.virtualVariantMethodEnum?if_exists != "VV_FEATURETREE">
-          <#if inStock>
-            <#if product.requireAmount?default("N") == "Y">
-              <#assign hiddenStyle = "visible" />
-            <#else>
-              <#assign hiddenStyle = "hidden"/>
-            </#if>
-            <div id="add_amount" class="${hiddenStyle}">
-              <span style="white-space: nowrap;"><strong>${uiLabelMap.CommonAmount}:</strong></span>&nbsp;
-              <input type="text" size="5" name="add_amount" value=""/>
-            </div>
-            <#if product.productTypeId?if_exists == "ASSET_USAGE">
-              <div class="inline">
-                <label>Start Date(yyyy-mm-dd)</label><@htmlTemplate.renderDateTimeField event="" action="" name="reservStart" className="" alert="" title="Format: yyyy-MM-dd HH:mm:ss.SSS" value="" size="25" maxlength="30" id="reservStart1" dateType="date" shortDateInput=true timeDropdownParamName="" defaultDateTimeString="" localizedIconTitle="" timeDropdown="" timeHourName="" classString="" hour1="" hour2="" timeMinutesName="" minutes="" isTwelveHour="" ampmName="" amSelected="" pmSelected="" compositeType="" formName=""/>
-                <label>End Date(yyyy-mm-dd)</label><@htmlTemplate.renderDateTimeField event="" action="" name="reservEnd" className="" alert="" title="Format: yyyy-MM-dd HH:mm:ss.SSS" value="" size="25" maxlength="30" id="reservEnd1" dateType="date" shortDateInput=true timeDropdownParamName="" defaultDateTimeString="" localizedIconTitle="" timeDropdown="" timeHourName="" classString="" hour1="" hour2="" timeMinutesName="" minutes="" isTwelveHour="" ampmName="" amSelected="" pmSelected="" compositeType="" formName=""/>
-              </div>
-              <div>
-                <#--td nowrap="nowrap" align="right">Number<br />of days</td><td><input type="textt" size="4" name="reservLength"/></td></tr><tr><td>&nbsp;</td><td align="right" nowrap="nowrap">&nbsp;</td-->
-                Number of persons<input type="text" size="4" name="reservPersons" value="2"/>
-                Number of rooms<input type="text" size="5" name="quantity" value="1"/>
-              </div>
+          <#if (product.productDepth?exists && product.productDepth != 0) || product.depthUomId?has_content>
+            <#assign depthUom = product.getRelatedOneCache("DepthUom")?if_exists />
+            <div>
+              ${uiLabelMap.CommonDepth}: ${product.productDepth?if_exists} ${((depthUom.abbreviation)?default(product.depthUomId))?if_exists}
+            </div>
+          </#if>
+    
+          <#if daysToShip?exists>
+            <div><strong>${uiLabelMap.ProductUsuallyShipsIn} ${daysToShip} ${uiLabelMap.CommonDays}!</strong></div>
+          </#if>
+    
+          <#-- show tell a friend details only in ecommerce application -->
+          <div>&nbsp;</div>
+          <div>
+              <a href="javascript:popUpSmall('<@ofbizUrl>tellafriend?productId=${product.productId}</@ofbizUrl>','tellafriend');" class="buttontext">${uiLabelMap.CommonTellAFriend}</a>
+          </div>
+    
+          <#if disFeatureList?exists && 0 &lt; disFeatureList.size()>
+          <p>&nbsp;</p>
+            <#list disFeatureList as currentFeature>
+                <#assign disFeatureType = currentFeature.getRelatedOneCache("ProductFeatureType") />
+                <div>
+                    <#if disFeatureType.description?exists>${disFeatureType.get("description", locale)}<#else>${currentFeature.productFeatureTypeId}</#if>:&nbsp;${currentFeature.description}
+                </div>
+            </#list>
+                <div>&nbsp;</div>
+          </#if>
+        </div>
+    
+        <div id="addItemForm">
+          <form method="post" action="<@ofbizUrl>additem</@ofbizUrl>" name="addform"  style="margin: 0;">
+          <fieldset>
+            <#assign inStock = true />
+            <#-- Variant Selection -->
+            <#if product.isVirtual?if_exists?upper_case == "Y">
+              <#if product.virtualVariantMethodEnum?if_exists == "VV_FEATURETREE" && featureLists?has_content>
+                <#list featureLists as featureList>
+                    <#list featureList as feature>
+                        <#if feature_index == 0>
+                            <div>${feature.description}: <select id="FT${feature.productFeatureTypeId}" name="FT${feature.productFeatureTypeId}" onchange="javascript:checkRadioButton();">
+                            <option value="select" selected="selected"> select option </option>
+                        <#else>
+                            <option value="${feature.productFeatureId}">${feature.description} <#if feature.price?exists>(+ <@ofbizCurrency amount=feature.price?string isoCode=feature.currencyUomId />)</#if></option>
+                        </#if>
+                    </#list>
+                    </select>
+                    </div>
+                </#list>
+                  <input type="hidden" name="add_product_id" value="${product.productId}" />
+                <div id="addCart1" style="display:none;">
+                  <span style="white-space: nowrap;"><strong>${uiLabelMap.CommonQuantity}:</strong></span>&nbsp;
+                  <input type="text" size="5" name="quantity" value="1" />
+                  <a href="javascript:javascript:addItem();" class="buttontext"><span style="white-space: nowrap;">${uiLabelMap.OrderAddToCart}</span></a>
+                  &nbsp;
+                </div>
+                <div id="addCart2" style="display:block;">
+                  <span style="white-space: nowrap;"><strong>${uiLabelMap.CommonQuantity}:</strong></span>&nbsp;
+                  <input type="text" size="5" value="1" disabled="disabled" />
+                  <a href="javascript:showErrorAlert("${uiLabelMap.CommonErrorMessage2}","${uiLabelMap.CommonPleaseSelectAllFeaturesFirst}");" class="buttontext"><span style="white-space: nowrap;">${uiLabelMap.OrderAddToCart}</span></a>
+                  &nbsp;
+                </div>
+              </#if>
+              <#if !product.virtualVariantMethodEnum?exists || product.virtualVariantMethodEnum == "VV_VARIANTTREE">
+               <#if variantTree?exists && (variantTree.size() &gt; 0)>
+                <#list featureSet as currentType>
+                  <div>
+                    <select name="FT${currentType}" onchange="javascript:getList(this.name, (this.selectedIndex-1), 1);">
+                      <option>${featureTypes.get(currentType)}</option>
+                    </select>
+                  </div>
+                </#list>
+                <span id="product_uom"></span>
+                <input type="hidden" name="product_id" value="${product.productId}"/>
+                <input type="hidden" name="add_product_id" value="NULL"/>
+                <div>
+                  <strong><span id="product_id_display"> </span></strong>
+                  <strong><div id="variant_price_display"> </div></strong>
+                </div>
+              <#else>
+                <input type="hidden" name="add_product_id" value="NULL"/>
+                <#assign inStock = false />
+              </#if>
+             </#if>
             <#else>
-              <span><input name="quantity" id="quantity" value="1" size="4" maxLength="4" type="text" <#if product.isVirtual!?upper_case == "Y">disabled="disabled"</#if> /></span><a href="javascript:addItem()" id="addToCart" name="addToCart" class="buttontext">${uiLabelMap.OrderAddToCart}</a>
-              <@showUnavailableVarients/>
+              <input type="hidden" name="add_product_id" value="${product.productId}" />
+              <#if mainProducts?has_content>
+                <input type="hidden" name="product_id" value=""/>
+                <select name="productVariantId" onchange="javascript:displayProductVirtualVariantId(this.value);">
+                    <option value="">Select Unit Of Measure</option>
+                    <#list mainProducts as mainProduct>
+                        <option value="${mainProduct.productId}">${mainProduct.uomDesc} : ${mainProduct.piecesIncluded}</option>
+                    </#list>
+                </select><br/>
+                <div>
+                  <strong><span id="product_id_display"> </span></strong>
+                  <strong><div id="variant_price_display"> </div></strong>
+                </div>
+              </#if>
+              <#if (availableInventory?exists) && (availableInventory <= 0)>
+                <#assign inStock = false />
+              </#if>
             </#if>
-            <#else>
-              <#if productStore?exists>
-                <#if productStore.requireInventory?exists && productStore.requireInventory == "N">
+            <#-- check to see if introductionDate hasnt passed yet -->
+            <#if product.introductionDate?exists && nowTimestamp.before(product.introductionDate)>
+            <p>&nbsp;</p>
+              <div style="color: red;">${uiLabelMap.ProductProductNotYetMadeAvailable}.</div>
+            <#-- check to see if salesDiscontinuationDate has passed -->
+            <#elseif product.salesDiscontinuationDate?exists && nowTimestamp.after(product.salesDiscontinuationDate)>
+              <div style="color: red;">${uiLabelMap.ProductProductNoLongerAvailable}.</div>
+            <#-- check to see if the product requires inventory check and has inventory -->
+            <#elseif product.virtualVariantMethodEnum?if_exists != "VV_FEATURETREE">
+              <#if inStock>
+                <#if product.requireAmount?default("N") == "Y">
+                  <#assign hiddenStyle = "visible" />
+                <#else>
+                  <#assign hiddenStyle = "hidden"/>
+                </#if>
+                <div id="add_amount" class="${hiddenStyle}">
+                  <span style="white-space: nowrap;"><strong>${uiLabelMap.CommonAmount}:</strong></span>&nbsp;
+                  <input type="text" size="5" name="add_amount" value=""/>
+                </div>
+                <#if product.productTypeId?if_exists == "ASSET_USAGE">
+                  <div class="inline">
+                    <label>Start Date(yyyy-mm-dd)</label><@htmlTemplate.renderDateTimeField event="" action="" name="reservStart" className="" alert="" title="Format: yyyy-MM-dd HH:mm:ss.SSS" value="" size="25" maxlength="30" id="reservStart1" dateType="date" shortDateInput=true timeDropdownParamName="" defaultDateTimeString="" localizedIconTitle="" timeDropdown="" timeHourName="" classString="" hour1="" hour2="" timeMinutesName="" minutes="" isTwelveHour="" ampmName="" amSelected="" pmSelected="" compositeType="" formName=""/>
+                    <label>End Date(yyyy-mm-dd)</label><@htmlTemplate.renderDateTimeField event="" action="" name="reservEnd" className="" alert="" title="Format: yyyy-MM-dd HH:mm:ss.SSS" value="" size="25" maxlength="30" id="reservEnd1" dateType="date" shortDateInput=true timeDropdownParamName="" defaultDateTimeString="" localizedIconTitle="" timeDropdown="" timeHourName="" classString="" hour1="" hour2="" timeMinutesName="" minutes="" isTwelveHour="" ampmName="" amSelected="" pmSelected="" compositeType="" formName=""/>
+                  </div>
+                  <div>
+                    <#--td nowrap="nowrap" align="right">Number<br />of days</td><td><input type="textt" size="4" name="reservLength"/></td></tr><tr><td>&nbsp;</td><td align="right" nowrap="nowrap">&nbsp;</td-->
+                    Number of persons<input type="text" size="4" name="reservPersons" value="2"/>
+                    Number of rooms<input type="text" size="5" name="quantity" value="1"/>
+                  </div>
+                <#else>
                   <span><input name="quantity" id="quantity" value="1" size="4" maxLength="4" type="text" <#if product.isVirtual!?upper_case == "Y">disabled="disabled"</#if> /></span><a href="javascript:addItem()" id="addToCart" name="addToCart" class="buttontext">${uiLabelMap.OrderAddToCart}</a>
                   <@showUnavailableVarients/>
-                <#else>
-                  <span><input name="quantity" id="quantity" value="1" size="4" maxLength="4" type="text" disabled="disabled" /></span><a href="javascript:void(0);" disabled="disabled" class="buttontext">${uiLabelMap.OrderAddToCart}</a><br />
-                  <span>${uiLabelMap.ProductItemOutOfStock}<#if product.inventoryMessage?exists>&mdash; ${product.inventoryMessage}</#if></span>
                 </#if>
+                <#else>
+                  <#if productStore?exists>
+                    <#if productStore.requireInventory?exists && productStore.requireInventory == "N">
+                      <span><input name="quantity" id="quantity" value="1" size="4" maxLength="4" type="text" <#if product.isVirtual!?upper_case == "Y">disabled="disabled"</#if> /></span><a href="javascript:addItem()" id="addToCart" name="addToCart" class="buttontext">${uiLabelMap.OrderAddToCart}</a>
+                      <@showUnavailableVarients/>
+                    <#else>
+                      <span><input name="quantity" id="quantity" value="1" size="4" maxLength="4" type="text" disabled="disabled" /></span><a href="javascript:void(0);" disabled="disabled" class="buttontext">${uiLabelMap.OrderAddToCart}</a><br />
+                      <span>${uiLabelMap.ProductItemOutOfStock}<#if product.inventoryMessage?exists>&mdash; ${product.inventoryMessage}</#if></span>
+                    </#if>
+                  </#if>
               </#if>
-          </#if>
-        </#if>
-        <#if variantPriceList?exists>
-          <#list variantPriceList as vpricing>
-            <#assign variantName = vpricing.get("variantName")?if_exists>
-            <#assign secondVariantName = vpricing.get("secondVariantName")?if_exists>
-            <#assign minimumQuantity = vpricing.get("minimumQuantity")>
-            <#if minimumQuantity &gt; 0>
-              <div>minimum order quantity for ${secondVariantName!} ${variantName!} is ${minimumQuantity!}</div>
             </#if>
-          </#list>
-        <#elseif minimumQuantity?exists && minimumQuantity?has_content && minimumQuantity &gt; 0>
-           <div>minimum order quantity for ${productContentWrapper.get("PRODUCT_NAME")?if_exists} is ${minimumQuantity!}</div>
-        </#if>
-        </fieldset>
-      </form>
-    </div>
-    <div>
-      <#if sessionAttributes.userLogin?has_content && sessionAttributes.userLogin.userLoginId != "anonymous">
-        <hr />
-        <form name="addToShoppingList" method="post" action="<@ofbizUrl>addItemToShoppingList<#if requestAttributes._CURRENT_VIEW_?exists>/${requestAttributes._CURRENT_VIEW_}</#if></@ofbizUrl>">
-          <fieldset>
-          <input type="hidden" name="productId" value="${product.productId}" />
-          <input type="hidden" name="product_id" value="${product.productId}" />
-          <input type="hidden" name="productStoreId" value="${productStoreId}" />
-          <input type="hidden" name="reservStart" value= "" />
-          <select name="shoppingListId">
-            <#if shoppingLists?has_content>
-              <#list shoppingLists as shoppingList>
-                <option value="${shoppingList.shoppingListId}">${shoppingList.listName}</option>
+            <#if variantPriceList?exists>
+              <#list variantPriceList as vpricing>
+                <#assign variantName = vpricing.get("variantName")?if_exists>
+                <#assign secondVariantName = vpricing.get("secondVariantName")?if_exists>
+                <#assign minimumQuantity = vpricing.get("minimumQuantity")>
+                <#if minimumQuantity &gt; 0>
+                  <div>minimum order quantity for ${secondVariantName!} ${variantName!} is ${minimumQuantity!}</div>
+                </#if>
               </#list>
+            <#elseif minimumQuantity?exists && minimumQuantity?has_content && minimumQuantity &gt; 0>
+               <div>minimum order quantity for ${productContentWrapper.get("PRODUCT_NAME")?if_exists} is ${minimumQuantity!}</div>
             </#if>
-            <option value="">---</option>
-            <option value="">${uiLabelMap.OrderNewShoppingList}</option>
-          </select>
-          &nbsp;&nbsp;
-          <#if product.productTypeId?if_exists == "ASSET_USAGE">
-              &nbsp;${uiLabelMap.CommonStartDate} (yyyy-mm-dd)<input type="text" size="10" name="reservStartStr" />Number of&nbsp;days<input type="text" size="4" name="reservLength" />&nbsp;Number of&nbsp;persons<input type="text" size="4" name="reservPersons" value="1" />Qty&nbsp;<input type="text" size="5" name="quantity" value="1" />
-          <#else>
-              <input type="text" size="5" name="quantity" value="1" />
-              <input type="hidden" name="reservStartStr" value= "" />
+            </fieldset>
+          </form>
+        </div>
+        <div>
+          <#if sessionAttributes.userLogin?has_content && sessionAttributes.userLogin.userLoginId != "anonymous">
+            <hr />
+            <form name="addToShoppingList" method="post" action="<@ofbizUrl>addItemToShoppingList<#if requestAttributes._CURRENT_VIEW_?exists>/${requestAttributes._CURRENT_VIEW_}</#if></@ofbizUrl>">
+              <fieldset>
+              <input type="hidden" name="productId" value="${product.productId}" />
+              <input type="hidden" name="product_id" value="${product.productId}" />
+              <input type="hidden" name="productStoreId" value="${productStoreId}" />
+              <input type="hidden" name="reservStart" value= "" />
+              <select name="shoppingListId">
+                <#if shoppingLists?has_content>
+                  <#list shoppingLists as shoppingList>
+                    <option value="${shoppingList.shoppingListId}">${shoppingList.listName}</option>
+                  </#list>
+                </#if>
+                <option value="">---</option>
+                <option value="">${uiLabelMap.OrderNewShoppingList}</option>
+              </select>
+              &nbsp;&nbsp;
+              <#if product.productTypeId?if_exists == "ASSET_USAGE">
+                  &nbsp;${uiLabelMap.CommonStartDate} (yyyy-mm-dd)<input type="text" size="10" name="reservStartStr" />Number of&nbsp;days<input type="text" size="4" name="reservLength" />&nbsp;Number of&nbsp;persons<input type="text" size="4" name="reservPersons" value="1" />Qty&nbsp;<input type="text" size="5" name="quantity" value="1" />
+              <#else>
+                  <input type="text" size="5" name="quantity" value="1" />
+                  <input type="hidden" name="reservStartStr" value= "" />
+              </#if>
+              <a href="javascript:addShoplistSubmit();" class="buttontext">${uiLabelMap.OrderAddToShoppingList}</a>
+              </fieldset>
+            </form>
+          <#else> <br />
+            ${uiLabelMap.OrderYouMust} <a href="<@ofbizUrl>checkLogin/showcart</@ofbizUrl>" class="buttontext">${uiLabelMap.CommonBeLogged}</a>
+            ${uiLabelMap.OrderToAddSelectedItemsToShoppingList}.&nbsp;
           </#if>
-          <a href="javascript:addShoplistSubmit();" class="buttontext">${uiLabelMap.OrderAddToShoppingList}</a>
-          </fieldset>
-        </form>
-      <#else> <br />
-        ${uiLabelMap.OrderYouMust} <a href="<@ofbizUrl>checkLogin/showcart</@ofbizUrl>" class="buttontext">${uiLabelMap.CommonBeLogged}</a>
-        ${uiLabelMap.OrderToAddSelectedItemsToShoppingList}.&nbsp;
+          </div>
+          <#-- Prefill first select box (virtual products only) -->
+          <#if variantTree?exists && 0 &lt; variantTree.size()>
+            <script type="text/javascript">eval("list" + "${featureOrderFirst}" + "()");</script>
+          </#if>
+    
+          <#-- Swatches (virtual products only) -->
+          <#if variantSample?exists && 0 &lt; variantSample.size()>
+            <#assign imageKeys = variantSample.keySet() />
+            <#assign imageMap = variantSample />
+            <p>&nbsp;</p>
+                <#assign maxIndex = 7 />
+                <#assign indexer = 0 />
+                <#list imageKeys as key>
+                  <#assign swatchProduct = imageMap.get(key) />
+                  <#if swatchProduct?has_content && indexer &lt; maxIndex>
+                    <#assign imageUrl = Static["org.ofbiz.product.product.ProductContentWrapper"].getProductContentAsText(swatchProduct, "SMALL_IMAGE_URL", request)?if_exists />
+                    <#if !imageUrl?string?has_content>
+                      <#assign imageUrl = productContentWrapper.get("SMALL_IMAGE_URL")?if_exists />
+                    </#if>
+                    <#if !imageUrl?string?has_content>
+                      <#assign imageUrl = "/images/defaultImage.jpg" />
+                    </#if>
+                      <a href="javascript:getList('FT${featureOrderFirst}','${indexer}',1);"><img src="<@ofbizContentUrl>${contentPathPrefix?if_exists}${imageUrl}</@ofbizContentUrl>" width="60" height="60" alt="" /></a>
+                      <br />
+                      <a href="javascript:getList('FT${featureOrderFirst}','${indexer}',1);" class="linktext">${key}</a>
+                  </#if>
+                  <#assign indexer = indexer + 1 />
+                </#list>
+                <#if (indexer > maxIndex)>
+                  <div><strong>${uiLabelMap.ProductMoreOptions}</strong></div>
+                </#if>
+          </#if>
+    
+      <#-- Digital Download Files Associated with this Product -->
+      <#if downloadProductContentAndInfoList?has_content>
+        <div id="download-files">
+          <div>${uiLabelMap.OrderDownloadFilesTitle}:</div>
+          <#list downloadProductContentAndInfoList as downloadProductContentAndInfo>
+            <div>${downloadProductContentAndInfo.contentName?if_exists}<#if downloadProductContentAndInfo.description?has_content> - ${downloadProductContentAndInfo.description}</#if></div>
+          </#list>
+        </div>
       </#if>
+    
+      <#-- Long description of product -->
+      <div id="long-description">
+          <div>${productContentWrapper.get("LONG_DESCRIPTION")?if_exists}</div>
+          <div>${productContentWrapper.get("WARNINGS")?if_exists}</div>
       </div>
-      <#-- Prefill first select box (virtual products only) -->
-      <#if variantTree?exists && 0 &lt; variantTree.size()>
-        <script type="text/javascript">eval("list" + "${featureOrderFirst}" + "()");</script>
-      </#if>
-
-      <#-- Swatches (virtual products only) -->
-      <#if variantSample?exists && 0 &lt; variantSample.size()>
-        <#assign imageKeys = variantSample.keySet() />
-        <#assign imageMap = variantSample />
-        <p>&nbsp;</p>
-            <#assign maxIndex = 7 />
-            <#assign indexer = 0 />
-            <#list imageKeys as key>
-              <#assign swatchProduct = imageMap.get(key) />
-              <#if swatchProduct?has_content && indexer &lt; maxIndex>
-                <#assign imageUrl = Static["org.ofbiz.product.product.ProductContentWrapper"].getProductContentAsText(swatchProduct, "SMALL_IMAGE_URL", request)?if_exists />
-                <#if !imageUrl?string?has_content>
-                  <#assign imageUrl = productContentWrapper.get("SMALL_IMAGE_URL")?if_exists />
-                </#if>
-                <#if !imageUrl?string?has_content>
-                  <#assign imageUrl = "/images/defaultImage.jpg" />
-                </#if>
-                  <a href="javascript:getList('FT${featureOrderFirst}','${indexer}',1);"><img src="<@ofbizContentUrl>${contentPathPrefix?if_exists}${imageUrl}</@ofbizContentUrl>" width="60" height="60" alt="" /></a>
-                  <br />
-                  <a href="javascript:getList('FT${featureOrderFirst}','${indexer}',1);" class="linktext">${key}</a>
-              </#if>
-              <#assign indexer = indexer + 1 />
+    
+      <#-- Any attributes/etc may go here -->
+    
+      <#-- Product Reviews -->
+        <div id="reviews">
+          <div>${uiLabelMap.OrderCustomerReviews}:</div>
+          <#if averageRating?exists && (averageRating &gt; 0) && numRatings?exists && (numRatings &gt; 1)>
+              <div>${uiLabelMap.OrderAverageRating}: ${averageRating} <#if numRatings?exists>(${uiLabelMap.CommonFrom} ${numRatings} ${uiLabelMap.OrderRatings})</#if></div>
+          </#if>
+    <hr />
+          <#if productReviews?has_content>
+            <#list productReviews as productReview>
+              <#assign postedUserLogin = productReview.getRelatedOne("UserLogin") />
+              <#assign postedPerson = postedUserLogin.getRelatedOne("Person")?if_exists />
+                        <div><strong>${uiLabelMap.CommonBy}: </strong><#if productReview.postedAnonymous?default("N") == "Y"> ${uiLabelMap.OrderAnonymous}<#else> ${postedPerson.firstName} ${postedPerson.lastName}&nbsp;</#if></div>
+                        <div><strong>${uiLabelMap.CommonAt}: </strong>${productReview.postedDateTime?if_exists}&nbsp;</div>
+                        <div><strong>${uiLabelMap.OrderRanking}: </strong>${productReview.productRating?if_exists?string}</div>
+                        <div>&nbsp;</div>
+                        <div>${productReview.productReview?if_exists}</div>
+                    <hr />
             </#list>
-            <#if (indexer > maxIndex)>
-              <div><strong>${uiLabelMap.ProductMoreOptions}</strong></div>
-            </#if>
+            <div>
+                <a href="<@ofbizUrl>reviewProduct?category_id=${categoryId?if_exists}&amp;product_id=${product.productId}</@ofbizUrl>" class="linktext">${uiLabelMap.ProductReviewThisProduct}!</a>
+            </div>
+          <#else>
+            <div>${uiLabelMap.ProductProductNotReviewedYet}.</div>
+            <div>
+                <a href="<@ofbizUrl>reviewProduct?category_id=${categoryId?if_exists}&amp;product_id=${product.productId}</@ofbizUrl>" class="linktext">${uiLabelMap.ProductBeTheFirstToReviewThisProduct}</a>
+            </div>
+        </div>
       </#if>
-
-  <#-- Digital Download Files Associated with this Product -->
-  <#if downloadProductContentAndInfoList?has_content>
-    <div id="download-files">
-      <div>${uiLabelMap.OrderDownloadFilesTitle}:</div>
-      <#list downloadProductContentAndInfoList as downloadProductContentAndInfo>
-        <div>${downloadProductContentAndInfo.contentName?if_exists}<#if downloadProductContentAndInfo.description?has_content> - ${downloadProductContentAndInfo.description}</#if></div>
-      </#list>
-    </div>
-  </#if>
-
-  <#-- Long description of product -->
-  <div id="long-description">
-      <div>${productContentWrapper.get("LONG_DESCRIPTION")?if_exists}</div>
-      <div>${productContentWrapper.get("WARNINGS")?if_exists}</div>
-  </div>
-
-  <#-- Any attributes/etc may go here -->
-
-  <#-- Product Reviews -->
-    <div id="reviews">
-      <div>${uiLabelMap.OrderCustomerReviews}:</div>
-      <#if averageRating?exists && (averageRating &gt; 0) && numRatings?exists && (numRatings &gt; 1)>
-          <div>${uiLabelMap.OrderAverageRating}: ${averageRating} <#if numRatings?exists>(${uiLabelMap.CommonFrom} ${numRatings} ${uiLabelMap.OrderRatings})</#if></div>
+    <#-- Upgrades/Up-Sell/Cross-Sell -->
+      <#macro associated assocProducts beforeName showName afterName formNamePrefix targetRequestName>
+      <#assign pageProduct = product />
+      <#assign targetRequest = "product" />
+      <#if targetRequestName?has_content>
+        <#assign targetRequest = targetRequestName />
       </#if>
-<hr />
-      <#if productReviews?has_content>
-        <#list productReviews as productReview>
-          <#assign postedUserLogin = productReview.getRelatedOne("UserLogin") />
-          <#assign postedPerson = postedUserLogin.getRelatedOne("Person")?if_exists />
-                    <div><strong>${uiLabelMap.CommonBy}: </strong><#if productReview.postedAnonymous?default("N") == "Y"> ${uiLabelMap.OrderAnonymous}<#else> ${postedPerson.firstName} ${postedPerson.lastName}&nbsp;</#if></div>
-                    <div><strong>${uiLabelMap.CommonAt}: </strong>${productReview.postedDateTime?if_exists}&nbsp;</div>
-                    <div><strong>${uiLabelMap.OrderRanking}: </strong>${productReview.productRating?if_exists?string}</div>
-                    <div>&nbsp;</div>
-                    <div>${productReview.productReview?if_exists}</div>
-                <hr />
+      <#if assocProducts?has_content>
+        <h2>${beforeName?if_exists}<#if showName == "Y">${productContentWrapper.get("PRODUCT_NAME")?if_exists}</#if>${afterName?if_exists}</h2>
+    
+        <div class="productsummary-container">
+        <#list assocProducts as productAssoc>
+            <#if productAssoc.productId == product.productId>
+                <#assign assocProductId = productAssoc.productIdTo />
+            <#else>
+                <#assign assocProductId = productAssoc.productId />
+            </#if>
+            <div>
+              <a href="<@ofbizUrl>${targetRequest}/<#if categoryId?exists>~category_id=${categoryId}/</#if>~product_id=${assocProductId}</@ofbizUrl>" class="buttontext">
+                ${assocProductId}
+              </a>
+            <#if productAssoc.reason?has_content>
+              - <strong>${productAssoc.reason}</strong>
+            </#if>
+            </div>
+          ${setRequestAttribute("optProductId", assocProductId)}
+          ${setRequestAttribute("listIndex", listIndex)}
+          ${setRequestAttribute("formNamePrefix", formNamePrefix)}
+          <#if targetRequestName?has_content>
+            ${setRequestAttribute("targetRequestName", targetRequestName)}
+          </#if>
+              ${screens.render(productsummaryScreen)}
+          <#assign product = pageProduct />
+          <#local listIndex = listIndex + 1 />
         </#list>
-        <div>
-            <a href="<@ofbizUrl>reviewProduct?category_id=${categoryId?if_exists}&amp;product_id=${product.productId}</@ofbizUrl>" class="linktext">${uiLabelMap.ProductReviewThisProduct}!</a>
-        </div>
-      <#else>
-        <div>${uiLabelMap.ProductProductNotReviewedYet}.</div>
-        <div>
-            <a href="<@ofbizUrl>reviewProduct?category_id=${categoryId?if_exists}&amp;product_id=${product.productId}</@ofbizUrl>" class="linktext">${uiLabelMap.ProductBeTheFirstToReviewThisProduct}</a>
-        </div>
-    </div>
-  </#if>
-<#-- Upgrades/Up-Sell/Cross-Sell -->
-  <#macro associated assocProducts beforeName showName afterName formNamePrefix targetRequestName>
-  <#assign pageProduct = product />
-  <#assign targetRequest = "product" />
-  <#if targetRequestName?has_content>
-    <#assign targetRequest = targetRequestName />
-  </#if>
-  <#if assocProducts?has_content>
-    <h2>${beforeName?if_exists}<#if showName == "Y">${productContentWrapper.get("PRODUCT_NAME")?if_exists}</#if>${afterName?if_exists}</h2>
-
-    <div class="productsummary-container">
-    <#list assocProducts as productAssoc>
-        <#if productAssoc.productId == product.productId>
-            <#assign assocProductId = productAssoc.productIdTo />
-        <#else>
-            <#assign assocProductId = productAssoc.productId />
-        </#if>
-        <div>
-          <a href="<@ofbizUrl>${targetRequest}/<#if categoryId?exists>~category_id=${categoryId}/</#if>~product_id=${assocProductId}</@ofbizUrl>" class="buttontext">
-            ${assocProductId}
-          </a>
-        <#if productAssoc.reason?has_content>
-          - <strong>${productAssoc.reason}</strong>
-        </#if>
         </div>
-      ${setRequestAttribute("optProductId", assocProductId)}
-      ${setRequestAttribute("listIndex", listIndex)}
-      ${setRequestAttribute("formNamePrefix", formNamePrefix)}
-      <#if targetRequestName?has_content>
-        ${setRequestAttribute("targetRequestName", targetRequestName)}
+    
+        ${setRequestAttribute("optProductId", "")}
+        ${setRequestAttribute("formNamePrefix", "")}
+        ${setRequestAttribute("targetRequestName", "")}
       </#if>
-          ${screens.render(productsummaryScreen)}
-      <#assign product = pageProduct />
-      <#local listIndex = listIndex + 1 />
-    </#list>
+    </#macro>
+    
+    <#assign productValue = product />
+    <#assign listIndex = 1 />
+    ${setRequestAttribute("productValue", productValue)}
+    <div id="associated-products">
+        <#-- also bought -->
+        <@associated assocProducts=alsoBoughtProducts beforeName="" showName="N" afterName="${uiLabelMap.ProductAlsoBought}" formNamePrefix="albt" targetRequestName="" />
+        <#-- obsolete -->
+        <@associated assocProducts=obsoleteProducts beforeName="" showName="Y" afterName=" ${uiLabelMap.ProductObsolete}" formNamePrefix="obs" targetRequestName="" />
+        <#-- cross sell -->
+        <@associated assocProducts=crossSellProducts beforeName="" showName="N" afterName="${uiLabelMap.ProductCrossSell}" formNamePrefix="cssl" targetRequestName="crosssell" />
+        <#-- up sell -->
+        <@associated assocProducts=upSellProducts beforeName="${uiLabelMap.ProductUpSell} " showName="Y" afterName=":" formNamePrefix="upsl" targetRequestName="upsell" />
+        <#-- obsolescence -->
+        <@associated assocProducts=obsolenscenseProducts beforeName="" showName="Y" afterName=" ${uiLabelMap.ProductObsolescense}" formNamePrefix="obce" targetRequestName="" />
     </div>
-
-    ${setRequestAttribute("optProductId", "")}
-    ${setRequestAttribute("formNamePrefix", "")}
-    ${setRequestAttribute("targetRequestName", "")}
-  </#if>
-</#macro>
-
-<#assign productValue = product />
-<#assign listIndex = 1 />
-${setRequestAttribute("productValue", productValue)}
-<div id="associated-products">
-    <#-- also bought -->
-    <@associated assocProducts=alsoBoughtProducts beforeName="" showName="N" afterName="${uiLabelMap.ProductAlsoBought}" formNamePrefix="albt" targetRequestName="" />
-    <#-- obsolete -->
-    <@associated assocProducts=obsoleteProducts beforeName="" showName="Y" afterName=" ${uiLabelMap.ProductObsolete}" formNamePrefix="obs" targetRequestName="" />
-    <#-- cross sell -->
-    <@associated assocProducts=crossSellProducts beforeName="" showName="N" afterName="${uiLabelMap.ProductCrossSell}" formNamePrefix="cssl" targetRequestName="crosssell" />
-    <#-- up sell -->
-    <@associated assocProducts=upSellProducts beforeName="${uiLabelMap.ProductUpSell} " showName="Y" afterName=":" formNamePrefix="upsl" targetRequestName="upsell" />
-    <#-- obsolescence -->
-    <@associated assocProducts=obsolenscenseProducts beforeName="" showName="Y" afterName=" ${uiLabelMap.ProductObsolescense}" formNamePrefix="obce" targetRequestName="" />
-</div>
-
-<#-- special cross/up-sell area using commonFeatureResultIds (from common feature product search) -->
-<#if comsmonFeatureResultIds?has_content>
-    <h2>${uiLabelMap.ProductSimilarProducts}</h2>
-
-    <div class="productsummary-container">
-        <#list commonFeatureResultIds as commonFeatureResultId>
-            ${setRequestAttribute("optProductId", commonFeatureResultId)}
-            ${setRequestAttribute("listIndex", commonFeatureResultId_index)}
-            ${setRequestAttribute("formNamePrefix", "cfeatcssl")}
-            <#-- ${setRequestAttribute("targetRequestName", targetRequestName)} -->
-            ${screens.render(productsummaryScreen)}
-        </#list>
+    
+    <#-- special cross/up-sell area using commonFeatureResultIds (from common feature product search) -->
+    <#if comsmonFeatureResultIds?has_content>
+        <h2>${uiLabelMap.ProductSimilarProducts}</h2>
+    
+        <div class="productsummary-container">
+            <#list commonFeatureResultIds as commonFeatureResultId>
+                ${setRequestAttribute("optProductId", commonFeatureResultId)}
+                ${setRequestAttribute("listIndex", commonFeatureResultId_index)}
+                ${setRequestAttribute("formNamePrefix", "cfeatcssl")}
+                <#-- ${setRequestAttribute("targetRequestName", targetRequestName)} -->
+                ${screens.render(productsummaryScreen)}
+            </#list>
+        </div>
+    </#if>
     </div>
-</#if>
 </div>