Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
adjustments.phtml
Go to the documentation of this file.
1 <?php
7 // @codingStandardsIgnoreFile
8 
9 ?>
10 <?php $_source = $block->getSource() ?>
11 <?php if ($_source): ?>
12  <tr>
13  <td class="label"><?= /* @escapeNotVerified */ $block->getShippingLabel() ?><div id="shipping_amount_adv"></div></td>
14  <td>
15  <input type="text"
16  name="creditmemo[shipping_amount]"
17  value="<?= /* @escapeNotVerified */ $block->getShippingAmount() ?>"
18  class="input-text admin__control-text not-negative-amount"
19  id="shipping_amount" />
20  </td>
21  </tr>
22  <tr>
23  <td class="label"><?= /* @escapeNotVerified */ __('Adjustment Refund') ?><div id="adjustment_positive_adv"></div></td>
24  <td>
25  <input type="text"
26  name="creditmemo[adjustment_positive]"
27  value="<?= /* @escapeNotVerified */ $_source->getBaseAdjustmentPositive()*1 ?>"
28  class="input-text admin__control-text not-negative-amount"
29  id="adjustment_positive" />
30  </td>
31  </tr>
32  <tr>
33  <td class="label"><?= /* @escapeNotVerified */ __('Adjustment Fee') ?><div id="adjustment_negative_adv"></div></td>
34  <td>
35  <input type="text"
36  name="creditmemo[adjustment_negative]"
37  value="<?= /* @escapeNotVerified */ $_source->getBaseAdjustmentNegative()*1 ?>"
38  class="input-text admin__control-text not-negative-amount"
39  id="adjustment_negative"/>
40  <script>
41  require(['prototype'], function(){
42 
43  //<![CDATA[
44  Validation.addAllThese([
45  ['not-negative-amount', '<?= /* @escapeNotVerified */ __('Please enter a positive number in this field.') ?>', function(v) {
46  if(v.length)
47  return /^\s*\d+([,.]\d+)*\s*%?\s*$/.test(v);
48  else
49  return true;
50  }]
51  ]);
52 
53  if ($('shipping_amount')) {
54  $('shipping_amount').advaiceContainer = $('shipping_amount_adv');
55  unblockSubmit('shipping_amount');
56  }
57  if ($('adjustment_positive')) {
58  $('adjustment_positive').advaiceContainer = $('adjustment_positive_adv');
59  unblockSubmit('adjustment_positive');
60  }
61  if ($('adjustment_negative')) {
62  $('adjustment_negative').advaiceContainer = $('adjustment_negative_adv');
63  unblockSubmit('adjustment_negative');
64  }
65 
66  function unblockSubmit(id) {
67  $(id).observe('focus', function(event) {
68  if ($$('button[class="scalable update-button disabled"]').size() > 0) {
69  enableElements('submit-button');
70  }
71  });
72  }
73  //]]>
74 
75  });
76  </script>
77  </td>
78  </tr>
79 
80 <?php endif; ?>
$block setTitle( 'CMS Block Title') -> setIdentifier('fixture_block') ->setContent('< h1 >Fixture Block Title</h1 >< a href=" store url</a><p> Config value
Definition: block.php:9
__()
Definition: __.php:13
$block
Definition: block.php:8
$_sourceif( $_source)() ?>< div id endif
$_source
Definition: tax.phtml:13