Skip to content

Commit

Permalink
Fixes #1189 Missing dropdown attributes values(2/2)
Browse files Browse the repository at this point in the history
Part 2: when Magento_Swatches/Smile_ElasticsuiteSwatches are disabled
Note: possible non-working native code ?
  • Loading branch information
rbayet committed Nov 20, 2018
1 parent 01f56f7 commit aab21b7
Showing 1 changed file with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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')){
Expand Down Expand Up @@ -209,21 +209,27 @@

<?php foreach ($this->helper('Magento\Catalog\Helper\Data')->getAttributeHiddenFields() as $type => $fields): ?>
case '<?php /* @escapeNotVerified */ echo $type; ?>':
var isFrontTabHidden = false;
<?php foreach ($fields as $one): ?>
<?php if ($one == '_front_fieldset'): ?>
getFrontTab().hide();
isFrontTabHidden = true;
<?php elseif ($one == '_default_value'): ?>
defaultValueTextVisibility =
defaultValueTextareaVisibility =
defaultValueDateVisibility =
defaultValueYesnoVisibility = false;
defaultValueTextareaVisibility =
defaultValueDateVisibility =
defaultValueYesnoVisibility = false;
<?php elseif ($one == '_scope'): ?>
scopeVisibility = false;
<?php else: ?>
setRowVisibility('<?php /* @escapeNotVerified */ echo $one; ?>', false);
<?php endif; ?>
<?php endforeach; ?>
break;

if (!isFrontTabHidden){
getFrontTab().show();
}
break;
<?php endforeach; ?>

default:
Expand Down Expand Up @@ -338,6 +344,7 @@

jQuery(function($) {
bindAttributeInputType();
// @todo: refactor collapsable component
$('.attribute-popup .collapse, [data-role="advanced_fieldset-content"]')
.collapsable()
.collapse('hide');
Expand All @@ -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;
Expand Down

0 comments on commit aab21b7

Please sign in to comment.