|
5 | 5 | */
|
6 | 6 | ?>
|
7 | 7 |
|
8 |
| -<?php /* @var $block \Magento\Bundle\Block\Catalog\Product\View\Type\Bundle\Option\Checkbox */ ?> |
| 8 | +<?php |
| 9 | +/** |
| 10 | + * @var $block \Magento\Bundle\Block\Catalog\Product\View\Type\Bundle\Option\Checkbox |
| 11 | + * @var \Magento\Framework\Escaper $escaper |
| 12 | + */ |
| 13 | +?> |
9 | 14 | <?php $_option = $block->getOption() ?>
|
10 | 15 | <?php $_selections = $_option->getSelections() ?>
|
11 |
| -<?php $inputClass = 'checkbox product bundle option bundle-option-' . $block->escapeHtmlAttr($_option->getId()) ?> |
12 |
| -<?php $inputId = 'bundle-option-' . $block->escapeHtmlAttr($_option->getId()) ?> |
13 |
| -<?php $inputName = 'bundle_option[' . $block->escapeHtmlAttr($_option->getId()) . ']' ?> |
| 16 | +<?php $inputClass = 'checkbox product bundle option bundle-option-' . $escaper->escapeHtmlAttr($_option->getId()) ?> |
| 17 | +<?php $inputId = 'bundle-option-' . $escaper->escapeHtmlAttr($_option->getId()) ?> |
| 18 | +<?php $inputName = 'bundle_option[' . $escaper->escapeHtmlAttr($_option->getId()) . ']' ?> |
14 | 19 | <?php $dataValidation = 'data-validate="{\'validate-one-required-by-name\':\'input[name^="bundle_option[' .
|
15 |
| - $block->escapeHtmlAttr($_option->getId()) . ']"]:checked\'}"' ?> |
| 20 | + $escaper->escapeHtmlAttr($_option->getId()) . ']"]:checked\'}"' ?> |
16 | 21 |
|
17 | 22 | <div class="field option <?= ($_option->getRequired()) ? ' required': '' ?>">
|
18 | 23 | <label class="label">
|
19 |
| - <span><?= $block->escapeHtml($_option->getTitle()) ?></span> |
| 24 | + <span><?= $escaper->escapeHtml($_option->getTitle()) ?></span> |
20 | 25 | </label>
|
21 | 26 | <div class="control">
|
22 | 27 | <div class="nested options-list">
|
23 | 28 | <?php if ($block->showSingle()): ?>
|
24 | 29 | <?= /* @noEscape */ $block->getSelectionQtyTitlePrice($_selections[0]) ?>
|
25 | 30 | <?= /* @noEscape */ $block->getTierPriceRenderer()->renderTierPrice($_selections[0]) ?>
|
26 | 31 | <input type="hidden"
|
27 |
| - class="bundle-option-<?= $block->escapeHtmlAttr($_option->getId()) ?> product bundle option" |
28 |
| - name="bundle_option[<?= $block->escapeHtml($_option->getId()) ?>]" |
29 |
| - value="<?= $block->escapeHtmlAttr($_selections[0]->getSelectionId()) ?>"/> |
| 32 | + class="bundle-option-<?= $escaper->escapeHtmlAttr($_option->getId()) ?> product bundle option" |
| 33 | + name="bundle_option[<?= $escaper->escapeHtml($_option->getId()) ?>]" |
| 34 | + value="<?= $escaper->escapeHtmlAttr($_selections[0]->getSelectionId()) ?>"/> |
30 | 35 | <?php else: ?>
|
31 | 36 | <?php foreach ($_selections as $selection): ?>
|
32 | 37 | <?php $sectionId = $selection->getSelectionId() ?>
|
33 | 38 | <div class="field choice">
|
34 | 39 | <input class="<?=/* @noEscape */ $inputClass ?> change-container-classname"
|
35 |
| - id="<?=/* @noEscape */ $inputId . '-' . $block->escapeHtmlAttr($sectionId)?>" |
36 |
| - type="checkbox" |
37 |
| - <?php if ($_option->getRequired()): ?> |
38 |
| - <?= /* @noEscape */ $dataValidation ?> |
39 |
| - <?php endif;?> |
40 |
| - name="<?=/* @noEscape */ $inputName .'['. $block->escapeHtmlAttr($sectionId)?>]" |
41 |
| - data-selector="<?= /* @noEscape */ $inputName.'['.$block->escapeHtmlAttr($sectionId)?>]" |
42 |
| - <?php if ($block->isSelected($selection)): ?> |
43 |
| - <?= ' checked="checked"' ?> |
44 |
| - <?php endif; ?> |
45 |
| - <?php if (!$selection->isSaleable()): ?> |
46 |
| - <?= ' disabled="disabled"' ?> |
47 |
| - <?php endif; ?> |
48 |
| - value="<?= $block->escapeHtmlAttr($sectionId) ?>" |
49 |
| - data-errors-message-box="#validation-message-box"/> |
| 40 | + id="<?=/* @noEscape */ $inputId . '-' . $escaper->escapeHtmlAttr($sectionId)?>" |
| 41 | + type="checkbox" |
| 42 | + <?php if ($_option->getRequired()): ?> |
| 43 | + <?= /* @noEscape */ $dataValidation ?> |
| 44 | + <?php endif;?> |
| 45 | + name="<?=/* @noEscape */ $inputName .'['. $escaper->escapeHtmlAttr($sectionId)?>]" |
| 46 | + data-selector="<?= /* @noEscape */ $inputName.'['.$escaper->escapeHtmlAttr($sectionId)?>]" |
| 47 | + <?php if ($block->isSelected($selection)): ?> |
| 48 | + <?= ' checked="checked"' ?> |
| 49 | + <?php endif; ?> |
| 50 | + <?php if (!$selection->isSaleable()): ?> |
| 51 | + <?= ' disabled="disabled"' ?> |
| 52 | + <?php endif; ?> |
| 53 | + value="<?= $escaper->escapeHtmlAttr($sectionId) ?>" |
| 54 | + data-errors-msg-box="#validation-message-box-<?=$escaper->escapeHtmlAttr($_option->getId())?>"/> |
50 | 55 | <label class="label"
|
51 |
| - for="<?= /* @noEscape */ $inputId . '-' . $block->escapeHtmlAttr($sectionId) ?>"> |
| 56 | + for="<?= /* @noEscape */ $inputId . '-' . $escaper->escapeHtmlAttr($sectionId) ?>"> |
52 | 57 | <span><?= /* @noEscape */ $block->getSelectionQtyTitlePrice($selection) ?></span>
|
53 | 58 | <br/>
|
54 | 59 | <?= /* @noEscape */ $block->getTierPriceRenderer()->renderTierPrice($selection) ?>
|
55 | 60 | </label>
|
56 | 61 | </div>
|
| 62 | + |
57 | 63 | <?php endforeach; ?>
|
58 |
| - <div id="bundle-option-<?= $block->escapeHtmlAttr($_option->getId()) ?>-container"></div> |
59 |
| - <div id="validation-message-box"></div> |
60 | 64 | <?php endif; ?>
|
61 | 65 | </div>
|
| 66 | + <div id="bundle-option-<?= $escaper->escapeHtmlAttr($_option->getId()) ?>-container"></div> |
| 67 | + <div id="validation-message-box-<?= $escaper->escapeHtmlAttr($_option->getId()) ?>"></div> |
62 | 68 | </div>
|
63 | 69 | </div>
|
0 commit comments