From aab21b7e96decebf180d343a23080a40aa337d46 Mon Sep 17 00:00:00 2001 From: Richard BAYET Date: Tue, 20 Nov 2018 09:55:52 +0100 Subject: [PATCH] Fixes #1189 Missing dropdown attributes values(2/2) Part 2: when Magento_Swatches/Smile_ElasticsuiteSwatches are disabled Note: possible non-working native code ? --- .../catalog/product/attribute/js.phtml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/module-elasticsuite-catalog/view/adminhtml/templates/catalog/product/attribute/js.phtml b/src/module-elasticsuite-catalog/view/adminhtml/templates/catalog/product/attribute/js.phtml index cbe08d140..93f59d73f 100644 --- a/src/module-elasticsuite-catalog/view/adminhtml/templates/catalog/product/attribute/js.phtml +++ b/src/module-elasticsuite-catalog/view/adminhtml/templates/catalog/product/attribute/js.phtml @@ -66,7 +66,7 @@ ($('frontend_input').value == 'select' || $('frontend_input').value == 'multiselect' || $('frontend_input').value == 'price' - || $('frontend_input').value == 'text') + || $('frontend_input').value == 'text' || $('frontend_input').value == 'boolean') ) { if($('is_filterable') && !$('is_filterable').getAttribute('readonly')){ @@ -209,21 +209,27 @@ helper('Magento\Catalog\Helper\Data')->getAttributeHiddenFields() as $type => $fields): ?> case '': + var isFrontTabHidden = false; getFrontTab().hide(); + isFrontTabHidden = true; defaultValueTextVisibility = - defaultValueTextareaVisibility = - defaultValueDateVisibility = - defaultValueYesnoVisibility = false; + defaultValueTextareaVisibility = + defaultValueDateVisibility = + defaultValueYesnoVisibility = false; scopeVisibility = false; setRowVisibility('', false); - break; + + if (!isFrontTabHidden){ + getFrontTab().show(); + } + break; default: @@ -338,6 +344,7 @@ jQuery(function($) { bindAttributeInputType(); + // @todo: refactor collapsable component $('.attribute-popup .collapse, [data-role="advanced_fieldset-content"]') .collapsable() .collapse('hide'); @@ -349,7 +356,6 @@ window.showDefaultRows = showDefaultRows; window.switchDefaultValueField = switchDefaultValueField; window.switchIsFilterable = switchIsFilterable; - window.switchIsFilterable = switchIsFilterable; window.bindAttributeInputType = bindAttributeInputType; window.checkOptionsPanelVisibility = checkOptionsPanelVisibility; window.getFrontTab = getFrontTab;