You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by bi...@apache.org on 2008/08/13 15:02:19 UTC

svn commit: r685531 - in /ofbiz/trunk/applications/order/webapp/ordermgr: WEB-INF/actions/entry/catalog/ProductDetail.groovy entry/catalog/productdetail.ftl

Author: bibryam
Date: Wed Aug 13 06:02:16 2008
New Revision: 685531

URL: http://svn.apache.org/viewvc?rev=685531&view=rev
Log:
Fix a bug in product details screen, which allows adding virtual products with not selected features to cart.

Modified:
    ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/ProductDetail.groovy
    ofbiz/trunk/applications/order/webapp/ordermgr/entry/catalog/productdetail.ftl

Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/ProductDetail.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/ProductDetail.groovy?rev=685531&r1=685530&r2=685531&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/ProductDetail.groovy (original)
+++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/ProductDetail.groovy Wed Aug 13 06:02:16 2008
@@ -281,6 +281,9 @@
                     jsBuf.append("document.forms[\"addform\"].elements[\"FT" + topLevelName + "\"].options.length = 1;");
                     jsBuf.append("document.forms[\"addform\"].elements[\"FT" + topLevelName + "\"].options[0] = new Option(\"" + featureTypes[topLevelName] + "\",\"\",true,true);");
                     if (variantTree) {
+                        featureOrder.each { featureKey ->
+                            jsBuf.append("document.forms[\"addform\"].elements[\"FT" + featureKey + "\"].options.length = 1;");
+                        }
                         firstDetailImage = null;
                         firstLargeImage = null;
                         counter = 0;

Modified: ofbiz/trunk/applications/order/webapp/ordermgr/entry/catalog/productdetail.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/entry/catalog/productdetail.ftl?rev=685531&r1=685530&r2=685531&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/webapp/ordermgr/entry/catalog/productdetail.ftl (original)
+++ ofbiz/trunk/applications/order/webapp/ordermgr/entry/catalog/productdetail.ftl Wed Aug 13 06:02:16 2008
@@ -149,8 +149,11 @@
         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 + "()");
-
+            if (index == -1) {
+                var Variable1 = eval("list" + "${featureOrderFirst}" + "()");
+            } else {
+                eval("list" + OPT[(currentFeatureIndex+1)] + selectedValue + "()");
+            }
             // set the product ID to NULL to trigger the alerts
             setAddProductId('NULL');