Skip to content
Snippets Groups Projects
Commit f8e18be2 authored by Andrii Kasian's avatar Andrii Kasian
Browse files

MAGETWO-35382: Impossible to add bundle product with required option to...

MAGETWO-35382: Impossible to add bundle product with required option to shopping cart without selecting all available options
parent b10a27bb
Branches
No related merge requests found
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
<input class="bundle-option-<?php echo $_option->getId() ?> checkbox product bundle option change-container-classname" <input class="bundle-option-<?php echo $_option->getId() ?> checkbox product bundle option change-container-classname"
id="bundle-option-<?php echo $_option->getId() ?>-<?php echo $_selection->getSelectionId() ?>" id="bundle-option-<?php echo $_option->getId() ?>-<?php echo $_selection->getSelectionId() ?>"
type="checkbox" type="checkbox"
<?php if ($_option->getRequired()) echo 'data-validate="{\'validate-one-required-by-name\':true}"'?> <?php if ($_option->getRequired()) echo 'data-validate="{\'validate-one-required-by-name\':\'input[name^=&quot;bundle_option[' . $_option->getId() . ']&quot;]:checked\'}"'?>
name="bundle_option[<?php echo $_option->getId() ?>][<?php echo $_selection->getId() ?>]" name="bundle_option[<?php echo $_option->getId() ?>][<?php echo $_selection->getId() ?>]"
<?php if ($block->isSelected($_selection)) echo ' checked="checked"' ?> <?php if ($block->isSelected($_selection)) echo ' checked="checked"' ?>
<?php if (!$_selection->isSaleable()) echo ' disabled="disabled"' ?> <?php if (!$_selection->isSaleable()) echo ' disabled="disabled"' ?>
......
...@@ -916,10 +916,10 @@ ...@@ -916,10 +916,10 @@
'This is a required field.' 'This is a required field.'
], ],
"validate-one-required-by-name": [ "validate-one-required-by-name": [
function(v, elm) { function(v, elm, selector) {
var name = elm.name.replace(/([\\"])/g, '\\$1'), var name = elm.name.replace(/([\\"])/g, '\\$1'),
container = this.currentForm, container = this.currentForm,
selector = 'input[name="' + name + '"]:checked'; selector = selector === true ? 'input[name="' + name + '"]:checked' : selector;
return !!container.querySelectorAll(selector).length; return !!container.querySelectorAll(selector).length;
}, },
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment