diff --git a/applications/order/groovyScripts/entry/catalog/InlineProductDetail.groovy b/applications/order/groovyScripts/entry/catalog/InlineProductDetail.groovy index 1d3ac614f0..5d4c7f60ec 100644 --- a/applications/order/groovyScripts/entry/catalog/InlineProductDetail.groovy +++ b/applications/order/groovyScripts/entry/catalog/InlineProductDetail.groovy @@ -102,6 +102,9 @@ if (inlineProduct) { featureTypes = [:] featureOrder = [] + variantInfoJS = new StringBuffer() + variantInfoJS.append("\n") + context.variantInfoJavaScript = variantInfoJS } diff --git a/applications/order/groovyScripts/entry/catalog/ProductDetail.groovy b/applications/order/groovyScripts/entry/catalog/ProductDetail.groovy index aa7fd2d056..ff568ce37a 100644 --- a/applications/order/groovyScripts/entry/catalog/ProductDetail.groovy +++ b/applications/order/groovyScripts/entry/catalog/ProductDetail.groovy @@ -106,6 +106,9 @@ if (product) { featureTypes = [:] featureOrder = [] + variantInfoJS = new StringBuffer() + variantInfoJS.append("\n") + context.variantInfoJavaScript = variantInfoJS availableInventory = 0.0 diff --git a/applications/order/groovyScripts/entry/catalog/ProductSummary.groovy b/applications/order/groovyScripts/entry/catalog/ProductSummary.groovy index 2137ac44b0..6e5c7a7530 100644 --- a/applications/order/groovyScripts/entry/catalog/ProductSummary.groovy +++ b/applications/order/groovyScripts/entry/catalog/ProductSummary.groovy @@ -99,6 +99,9 @@ reviews = null if (product) { categoryId = parameters.category_id ?: request.getAttribute("productCategoryId") + variantInfoJS = new StringBuffer() + variantInfoJS.append("\n") + context.variantInfoJavaScript = variantInfoJS + context.mainProducts = mainProducts } diff --git a/applications/order/template/entry/catalog/ProductDetail.ftl b/applications/order/template/entry/catalog/ProductDetail.ftl index e44832e0d7..af4b77de06 100644 --- a/applications/order/template/entry/catalog/ProductDetail.ftl +++ b/applications/order/template/entry/catalog/ProductDetail.ftl @@ -281,6 +281,8 @@ ${virtualJavaScript!} //--> +${screens.render("component://order/widget/ordermgr/OrderEntryCatalogScreens.xml#productvariantjs")} +${variantInfoJavaScript!}
@@ -498,6 +500,18 @@ ${virtualJavaScript!} <#else> + <#if mainProducts?has_content> +
+ + <#if productStoreId??> <#assign isStoreInventoryNotAvailable = !(Static["org.apache.ofbiz.product.store.ProductStoreWorker"].isStoreInventoryAvailable(request, product, 1.0?double))> <#assign isStoreInventoryRequired = Static["org.apache.ofbiz.product.store.ProductStoreWorker"].isStoreInventoryRequired(request, product)> diff --git a/applications/order/template/entry/catalog/ProductSummary.ftl b/applications/order/template/entry/catalog/ProductSummary.ftl index 553bf83326..bee8131e9f 100644 --- a/applications/order/template/entry/catalog/ProductSummary.ftl +++ b/applications/order/template/entry/catalog/ProductSummary.ftl @@ -51,6 +51,8 @@ ${virtualJavaScript!} } //--> +${screens.render("component://order/widget/ordermgr/OrderEntryCatalogScreens.xml#productvariantjs")} +${variantInfoJavaScript!} <#if product??> <#-- variable setup --> <#if "Y" == backendPath?default("N")> @@ -94,6 +96,7 @@ ${virtualJavaScript!}
<#-- check to see if introductionDate hasn't passed yet --> @@ -133,15 +137,15 @@ ${virtualJavaScript!} ${uiLabelMap.OrderAddToCart} <#if mainProducts?has_content> - + <#list mainProducts as mainProduct> -
- - + diff --git a/applications/order/template/entry/catalog/ProductVariantJS.ftl b/applications/order/template/entry/catalog/ProductVariantJS.ftl new file mode 100644 index 0000000000..0912299a0f --- /dev/null +++ b/applications/order/template/entry/catalog/ProductVariantJS.ftl @@ -0,0 +1,51 @@ +<#-- +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. +--> + diff --git a/applications/order/widget/ordermgr/OrderEntryCatalogScreens.xml b/applications/order/widget/ordermgr/OrderEntryCatalogScreens.xml index de199e6617..033bf27439 100644 --- a/applications/order/widget/ordermgr/OrderEntryCatalogScreens.xml +++ b/applications/order/widget/ordermgr/OrderEntryCatalogScreens.xml @@ -66,6 +66,14 @@ under the License. + +
+ + + +
+
+