Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
cc.phtml
Go to the documentation of this file.
1 <?php
7 // @codingStandardsIgnoreFile
11 $code = $block->escapeHtml($block->getMethodCode());
12 $ccType = $block->getInfoData('cc_type');
13 $ccExpMonth = $block->getInfoData('cc_exp_month');
14 $ccExpYear = $block->getInfoData('cc_exp_year');
15 ?>
16 <fieldset class="fieldset payment items ccard <?= /* @noEscape */ $code ?>"
17  id="payment_form_<?= /* @noEscape */ $code ?>" style="display: none;">
18  <div class="field type required">
19  <label for="<?= /* @noEscape */ $code ?>_cc_type" class="label">
20  <span><?= $block->escapeHtml(__('Credit Card Type')) ?></span>
21  </label>
22  <div class="control">
23  <select id="<?= /* @noEscape */ $code ?>_cc_type"
24  data-mage-init='{
25  "creditCardType":{"creditCardTypeContainer":"#<?= /* @noEscape */ $code ?>_cc_type_ss_div"}
26  }'
27  name="payment[cc_type]" data-validate='{
28  required:true,
29  "validate-cc-type-select":"#<?= /* @noEscape */ $code ?>_cc_number"
30  }'
31  class="select">
32  <option value=""><?= $block->escapeHtml(__('--Please Select--')) ?></option>
33  <?php foreach ($block->getCcAvailableTypes() as $typeCode => $typeName): ?>
34  <option value="<?= $block->escapeHtml($typeCode) ?>"
35  <?php if ($typeCode == $ccType): ?> selected="selected"<?php endif; ?>>
36  <?= $block->escapeHtml($typeName) ?>
37  </option>
38  <?php endforeach; ?>
39  </select>
40  </div>
41  </div>
42  <div class="field number required">
43  <label for="<?= /* @noEscape */ $code ?>_cc_number" class="label">
44  <span><?= $block->escapeHtml(__('Credit Card Number')) ?></span>
45  </label>
46  <div class="control">
47  <input type="number" id="<?= /* @noEscape */ $code ?>_cc_number" name="payment[cc_number]"
48  title="<?= $block->escapeHtml(__('Credit Card Number')) ?>" class="input-text" value=""
49  data-validate='{
50  "required-number":true,
51  "validate-cc-number":"#<?= /* @noEscape */ $code ?>_cc_type",
52  "validate-cc-type":"#<?= /* @noEscape */ $code ?>_cc_type"
53  }'/>
54  </div>
55  </div>
56  <div class="field date required" id="<?= /* @noEscape */ $code ?>_cc_type_exp_div">
57  <label for="<?= /* @noEscape */ $code ?>_expiration" class="label">
58  <span><?= $block->escapeHtml(__('Expiration Date')) ?></span>
59  </label>
60  <div class="control">
61  <div class="fields group group-2">
62  <div class="field no-label month">
63  <div class="control">
64  <select id="<?= /* @noEscape */ $code ?>_expiration" name="payment[cc_exp_month]" class="select month"
65  data-validate='{required:true, "validate-cc-exp":"#<?= /* @noEscape */ $code ?>_expiration_yr"}'>
66  <?php foreach ($block->getCcMonths() as $k => $v): ?>
67  <option value="<?= /* @noEscape */ $k ? $block->escapeHtml($k) : '' ?>"
68  <?php if ($k == $ccExpMonth): ?> selected="selected"<?php endif; ?>>
69  <?= $block->escapeHtml($v) ?>
70  </option>
71  <?php endforeach; ?>
72  </select>
73  </div>
74  </div>
75  <div class="field no-label year">
76  <div class="control">
77  <select id="<?= /* @noEscape */ $code ?>_expiration_yr" name="payment[cc_exp_year]"
78  class="select year" data-validate='{required:true}'>
79  <?php foreach ($block->getCcYears() as $k => $v): ?>
80  <option value="<?= /* @noEscape */ $k ? $block->escapeHtml($k) : '' ?>
81  "<?php if ($k == $ccExpYear): ?> selected="selected"<?php endif; ?>>
82  <?= $block->escapeHtml($v) ?>
83  </option>
84  <?php endforeach; ?>
85  </select>
86  </div>
87  </div>
88  </div>
89  </div>
90  </div>
91  <?php if ($block->hasVerification()): ?>
92  <div class="field cvv required" id="<?= /* @noEscape */ $code ?>_cc_type_cvv_div">
93  <label for="<?= /* @noEscape */ $code ?>_cc_cid" class="label">
94  <span><?= $block->escapeHtml(__('Card Verification Number')) ?></span>
95  </label>
96  <div class="control">
97  <input type="number" title="<?= $block->escapeHtml(__('Card Verification Number')) ?>"
98  class="input-text cvv" id="<?= /* @noEscape */ $code ?>_cc_cid" name="payment[cc_cid]" value=""
99  data-validate='{"required-number":true, "validate-cc-cvn":"#<?= /* @noEscape */ $code ?>_cc_type"}' />
100  <?php $content = '<img src=\"' . $block->getViewFileUrl('Magento_Checkout::cvv.png') . '\" alt=\"' .
101  $block->escapeHtml(__('Card Verification Number Visual Reference')) .
102  '\" title=\"' . $block->escapeHtml(__('Card Verification Number Visual Reference')) . '\" />'; ?>
103  <div class="note">
104  <a href="#" class="action cvv" title="<?= $block->escapeHtml(__('What is this?')) ?>"
105  data-mage-init='{"tooltip": {"content": "<?= /* @noEscape */ $content ?>"}}'>
106  <span><?= $block->escapeHtml(__('What is this?')) ?></span>
107  </a>
108  </div>
109  </div>
110  </div>
111  <?php endif; ?>
112  <?= $block->getChildHtml() ?>
113 </fieldset>
$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
if( $form)() ?>< script > require(['jquery' mage mage
Definition: save.phtml:15
__()
Definition: __.php:13
$block
Definition: block.php:8
endforeach
Definition: cc.phtml:28
$ccExpYear
Definition: cc.phtml:14
$ccExpMonth
Definition: cc.phtml:13
$code
Definition: cc.phtml:11
foreach( $block->getCcAvailableTypes() as $typeCode=> $typeName)( $typeCode) ?>" <?php if($typeCode endif
Definition: cc.phtml:25
$ccType
Definition: cc.phtml:12