This is an automated email from the ASF dual-hosted git repository.
jleroux pushed a commit to branch release17.12 in repository https://gitbox.apache.org/repos/asf/ofbiz-plugins.git The following commit(s) were added to refs/heads/release17.12 by this push: new 1ada36d Fixed: display/selection of unit of measure is broken/plugins (OFBIZ-11993) 1ada36d is described below commit 1ada36d74df296293d4df6559d7afe4253c22934 Author: Jacques Le Roux <[hidden email]> AuthorDate: Mon Aug 31 10:06:27 2020 +0200 Fixed: display/selection of unit of measure is broken/plugins (OFBIZ-11993) Allows selection of uom for multiple products on the same web page Thanks: Alex --- ecommerce/template/catalog/ProductDetail.ftl | 26 ++++++++++++-------------- ecommerce/template/catalog/ProductSummary.ftl | 12 +++++++----- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/ecommerce/template/catalog/ProductDetail.ftl b/ecommerce/template/catalog/ProductDetail.ftl index 65b4383..1f0d39d 100644 --- a/ecommerce/template/catalog/ProductDetail.ftl +++ b/ecommerce/template/catalog/ProductDetail.ftl @@ -336,6 +336,8 @@ $(function(){ </#if> </#macro> +${screens.render("component://order/widget/ordermgr/OrderEntryCatalogScreens.xml#productvariantjs")} +${variantInfoJavaScript!} <div id="product-detail" class="card"> <#assign productAdditionalImage1 = productContentWrapper.get("ADDITIONAL_IMAGE_1", "url")! /> <#assign productAdditionalImage2 = productContentWrapper.get("ADDITIONAL_IMAGE_2", "url")! /> @@ -719,15 +721,13 @@ $(function(){ </select> </div> </#list> - <span id="product_uom"></span> + <span id="product_uom"></span><br/> + <div class="variant-price" style="display: none;"> + <strong><span class="product_id_display"> </span></strong> + <strong><span class="variant_price_display"> </span></strong> + </div> <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 /> @@ -737,17 +737,15 @@ $(function(){ <input type="hidden" name="add_product_id" value="${product.productId}"/> <#if mainProducts?has_content> <input type="hidden" name="product_id" value=""/> - <select name="productVariantId" class="form-control" onchange="javascript:displayProductVirtualVariantId(this.value);"> - <option value="">Select Unit Of Measure</option> + <select name="productVariantId" class="form-control" onchange="javascript:variantUomSelection(this);"> + <option value="">${uiLabelMap.CommonSelect} ${uiLabelMap.ProductUnitOfMeasure}</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 class="variant-price" style="display: none;"> + <strong><span class="product_id_display"> </span></strong> + <strong><span class="variant_price_display"> </span></strong> </div> </#if> <#if (availableInventory??) && (availableInventory <= 0) && "N" == product.requireAmount?default("N")> diff --git a/ecommerce/template/catalog/ProductSummary.ftl b/ecommerce/template/catalog/ProductSummary.ftl index 605d61c..f6decf7 100644 --- a/ecommerce/template/catalog/ProductSummary.ftl +++ b/ecommerce/template/catalog/ProductSummary.ftl @@ -51,6 +51,8 @@ } //--> </script> +${screens.render("component://order/widget/ordermgr/OrderEntryCatalogScreens.xml#productvariantjs")} +${variantInfoJavaScript!} <#if product??> <#-- variable setup --> <#if "Y" == backendPath?default("N")> @@ -196,15 +198,15 @@ </div> <#if mainProducts?has_content> <input type="hidden" name="product_id" value=""/> - <select name="productVariantId" onchange="javascript:displayProductVirtualId(this.value, '${product.productId}', this.form);"> - <option value="">Select Unit Of Measure</option> + <select name="productVariantId" onchange="javascript:variantUomSelection(this);" style="width: 100%;"> + <option value="">${uiLabelMap.CommonSelect} ${uiLabelMap.ProductUnitOfMeasure}</option> <#list mainProducts as mainProduct> <option value="${mainProduct.productId}">${mainProduct.uomDesc} : ${mainProduct.piecesIncluded}</option> </#list> </select> - <div style="display: inline-block;"> - <strong><span id="product_id_display"> </span></strong> - <strong><span id="variant_price_display"> </span></strong> + <div class="variant-price" style="display: none;"> + <strong><span class="product_id_display"> </span></strong> + <strong><span class="variant_price_display"> </span></strong> </div> </#if> </div> |
Free forum by Nabble | Edit this page |