Skip to content

Commit

Permalink
Disable Customer group selection checkbox when single customer is set…
Browse files Browse the repository at this point in the history
… and vice versa
  • Loading branch information
atomiix committed Oct 23, 2019
1 parent 7ac6872 commit 312d331
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 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'));
});

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

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

if ($(this).prop('checked'))
Expand Down

0 comments on commit 312d331

Please sign in to comment.