Skip to content

Commit

Permalink
Merge pull request #16088 from atomiix/fix-cart-rule-conflict
Browse files Browse the repository at this point in the history
Disable Customer group selection checkbox when single customer is set…
  • Loading branch information
matks committed Oct 31, 2019
2 parents c28c1e6 + b996178 commit 378bd21
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions admin-dev/themes/default/template/controllers/cart_rules/form.js
Expand Up @@ -105,14 +105,22 @@ var restrictions = new Array('country', 'carrier', 'group', 'cart_rule', 'shop')
for (i in restrictions)
{
toggleCartRuleFilter($('#' + restrictions[i] + '_restriction'));
$('#' + restrictions[i] + '_restriction').click(function() {toggleCartRuleFilter(this);});
$('#' + restrictions[i] + '_restriction').change(function() {toggleCartRuleFilter(this);});
$('#' + restrictions[i] + '_select_remove').click(function() {removeCartRuleOption(this);});
$('#' + restrictions[i] + '_select_add').click(function() {addCartRuleOption(this);});
}

toggleCartRuleFilter($('#product_restriction'));

$('#product_restriction').click(function() {
$('#group_restriction').change(function() {
$('#customerFilter').prop('disabled', $(this).prop('checked'));
}).change();

$('#customerFilter').on('change keyup', function() {
$('#group_restriction').prop('disabled', $(this).val() !== '');
}).change();

$('#product_restriction').change(function() {
toggleCartRuleFilter(this);

if ($(this).prop('checked'))
Expand Down Expand Up @@ -497,8 +505,8 @@ $(document).ready(function() {
callback: function(text) { combinable_filter('#cart_rule_select_2', text, 'selected'); }
});
}
displayProductAttributes();

displayProductAttributes();
});


Expand Down

0 comments on commit 378bd21

Please sign in to comment.