From 20e00c82a3950e413395cdfd7e79a424ec9178f4 Mon Sep 17 00:00:00 2001 From: Nicolas Malin Date: Tue, 28 Sep 2021 14:11:52 +0200 Subject: [PATCH] Fixed: Add to cart is not working for products with selectable features (OFBIZ-11970) Two issues were present, first was due to incorrect markup and the second was due to ajax request and response view of the additem request. In additem request last saved view or the view of the last request is rendered on successful operation and in this case the last request/view is the one which is used to render UOM dropdown. Thanks: Akash Jain and Ravi Lodhi --- ecommerce/template/catalog/ProductDetail.ftl | 4 +-- .../catalog/ProductUomDropDownOnly.ftl | 28 +++++++++++++++++++ .../webapp/ecommerce/WEB-INF/controller.xml | 4 +-- ecommerce/widget/CatalogScreens.xml | 25 +++++++++++++++++ 4 files changed, 57 insertions(+), 4 deletions(-) create mode 100644 ecommerce/template/catalog/ProductUomDropDownOnly.ftl diff --git a/ecommerce/template/catalog/ProductDetail.ftl b/ecommerce/template/catalog/ProductDetail.ftl index ea8bda471..188d03074 100644 --- a/ecommerce/template/catalog/ProductDetail.ftl +++ b/ecommerce/template/catalog/ProductDetail.ftl @@ -617,10 +617,10 @@ ${variantInfoJavaScript!} <#-- Variant Selection --> -
<#if "Y" == product.isVirtual!?upper_case> <#if "VV_FEATURETREE" == product.virtualVariantMethodEnum! && featureLists?has_content> <#list featureLists as featureList> +
<#list featureList as feature> <#if feature_index == 0> ${feature.description}: @@ -660,7 +660,7 @@ ${variantInfoJavaScript!} <#if !product.virtualVariantMethodEnum?? || "VV_VARIANTTREE" == product.virtualVariantMethodEnum> <#if variantTree?? && (variantTree.size() > 0)> <#list featureSet as currentType> -
+
diff --git a/ecommerce/template/catalog/ProductUomDropDownOnly.ftl b/ecommerce/template/catalog/ProductUomDropDownOnly.ftl new file mode 100644 index 000000000..49522db7c --- /dev/null +++ b/ecommerce/template/catalog/ProductUomDropDownOnly.ftl @@ -0,0 +1,28 @@ +<#-- +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. +--> +<#if product?? && mainProducts??> +
+ +
+ \ No newline at end of file diff --git a/ecommerce/webapp/ecommerce/WEB-INF/controller.xml b/ecommerce/webapp/ecommerce/WEB-INF/controller.xml index 200f82986..b2f1f78e7 100644 --- a/ecommerce/webapp/ecommerce/WEB-INF/controller.xml +++ b/ecommerce/webapp/ecommerce/WEB-INF/controller.xml @@ -1812,7 +1812,7 @@ under the License. - + @@ -2016,7 +2016,7 @@ under the License. - + diff --git a/ecommerce/widget/CatalogScreens.xml b/ecommerce/widget/CatalogScreens.xml index e162984a2..72befeb18 100644 --- a/ecommerce/widget/CatalogScreens.xml +++ b/ecommerce/widget/CatalogScreens.xml @@ -641,4 +641,29 @@ under the License. + + +
+ + + +