File tree Expand file tree Collapse file tree 3 files changed +45
-20
lines changed
app/code/Magento/Swatches/view/adminhtml/templates/catalog/product/attribute Expand file tree Collapse file tree 3 files changed +45
-20
lines changed Original file line number Diff line number Diff line change 8
8
9
9
/** @var $block \Magento\Swatches\Block\Adminhtml\Attribute\Edit\Options\Text */
10
10
?>
11
- <fieldset class="fieldset ignore-validate ">
11
+ <fieldset class="fieldset">
12
12
<legend class="legend"><span><?php /* @escapeNotVerified */ echo __ ('Manage Swatch (values of your attribute) ' ) ?> </span></legend>
13
13
<div id="swatch-text-options-panel">
14
14
<?php //@todo move style to css file ?>
33
33
<th class="col-delete"> </th>
34
34
</tr>
35
35
</thead>
36
- <tbody data-role="swatch-text-options-container"></tbody>
36
+ <tbody data-role="swatch-text-options-container" class="ignore-validate" ></tbody>
37
37
<tfoot>
38
- <th colspan="<?php /* @escapeNotVerified */ echo $ storetotal ; ?> " class="col-actions-add">
39
- <?php if (!$ block ->getReadOnly () && !$ block ->canManageOptionDefaultOnly ()):?>
40
- <button id="add_new_swatch_text_option_button" title="<?php /* @escapeNotVerified */ echo __ ('Add Swatch ' ); ?> "
41
- type="button" class="action- scalable add">
42
- <span><?php /* @escapeNotVerified */ echo __ ('Add Swatch ' ); ?> </span>
43
- </button>
44
- <?php endif ; ?>
45
- </th>
38
+ <tr>
39
+ <th colspan="<?php /* @escapeNotVerified */ echo $ storetotal ; ?> ">
40
+ <input type="hidden" class="required-swatch-entry"/>
41
+ </th>
42
+ </tr>
43
+ <tr>
44
+ <th colspan="<?php /* @escapeNotVerified */ echo $ storetotal ; ?> " class="col-actions-add">
45
+ <?php if (!$ block ->getReadOnly () && !$ block ->canManageOptionDefaultOnly ()):?>
46
+ <button id="add_new_swatch_text_option_button" title="<?php /* @escapeNotVerified */ echo __ ('Add Swatch ' ); ?> "
47
+ type="button" class="action- scalable add">
48
+ <span><?php /* @escapeNotVerified */ echo __ ('Add Swatch ' ); ?> </span>
49
+ </button>
50
+ <?php endif ; ?>
51
+ </th>
52
+ </tr>
46
53
</tfoot>
47
54
</table>
48
55
<input type="hidden" id="swatch-text-option-count-check" value="" />
Original file line number Diff line number Diff line change 8
8
9
9
/** @var $block \Magento\Swatches\Block\Adminhtml\Attribute\Edit\Options\Visual */
10
10
?>
11
- <fieldset class="fieldset ignore-validate ">
11
+ <fieldset class="fieldset">
12
12
<legend class="legend"><span><?php /* @escapeNotVerified */ echo __ ('Manage Swatch (values of your attribute) ' ) ?> </span></legend>
13
13
<div id="swatch-visual-options-panel">
14
14
<?php //@todo move style to css file ?>
29
29
<th class="col-delete"> </th>
30
30
</tr>
31
31
</thead>
32
- <tbody data-role="swatch-visual-options-container"></tbody>
32
+ <tbody data-role="swatch-visual-options-container" class="ignore-validate" ></tbody>
33
33
<tfoot>
34
- <th colspan="<?php /* @escapeNotVerified */ echo $ storetotal ; ?> " class="col-actions-add">
35
- <?php if (!$ block ->getReadOnly () && !$ block ->canManageOptionDefaultOnly ()):?>
36
- <button id="add_new_swatch_visual_option_button" title="<?php /* @escapeNotVerified */ echo __ ('Add Swatch ' ); ?> "
37
- type="button" class="action- scalable add">
38
- <span><?php /* @escapeNotVerified */ echo __ ('Add Swatch ' ); ?> </span>
39
- </button>
40
- <?php endif ; ?>
41
- </th>
34
+ <tr>
35
+ <th colspan="<?php /* @escapeNotVerified */ echo $ storetotal ; ?> ">
36
+ <input type="hidden" class="required-swatch-entry"/>
37
+ </th>
38
+ </tr>
39
+ <tr>
40
+ <th colspan="<?php /* @escapeNotVerified */ echo $ storetotal ; ?> " class="col-actions-add">
41
+ <?php if (!$ block ->getReadOnly () && !$ block ->canManageOptionDefaultOnly ()):?>
42
+ <button id="add_new_swatch_visual_option_button" title="<?php /* @escapeNotVerified */ echo __ ('Add Swatch ' ); ?> "
43
+ type="button" class="action- scalable add">
44
+ <span><?php /* @escapeNotVerified */ echo __ ('Add Swatch ' ); ?> </span>
45
+ </button>
46
+ <?php endif ; ?>
47
+ </th>
48
+ </tr>
42
49
</tfoot>
43
50
</table>
44
51
<input type="hidden" id="swatch-visual-option-count-check" value="" />
Original file line number Diff line number Diff line change 1224
1224
} ,
1225
1225
'Please enter a valid number.'
1226
1226
] ,
1227
+ 'required-swatch-entry' : [
1228
+ function ( value , element ) {
1229
+ var empty = $ ( element ) . closest ( 'table' )
1230
+ . find ( 'input.required-option' )
1231
+ . filter ( function ( i , el ) {
1232
+ return $ . mage . isEmpty ( el . value ) ;
1233
+ } )
1234
+ . length ;
1235
+ return empty === 0 ;
1236
+ } , 'Admin is a required field in the each row.'
1237
+ ] ,
1227
1238
'validate-item-quantity' : [
1228
1239
function ( value , element , params ) {
1229
1240
// obtain values for validation
You can’t perform that action at this time.
0 commit comments