Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
downloadable.phtml
Go to the documentation of this file.
1 <?php
7 // @codingStandardsIgnoreFile
8 
9 ?>
10 <?php /* @var $block \Magento\Downloadable\Block\Adminhtml\Catalog\Product\Composite\Fieldset\Downloadable */ ?>
11 <?php $_linksPurchasedSeparately = $block->getLinksPurchasedSeparately(); ?>
12 <?php $_skipSaleableCheck = $this->helper('Magento\Catalog\Helper\Product')->getSkipSaleableCheck(); ?>
13 <?php if (($block->getProduct()->isSaleable() || $_skipSaleableCheck) && $block->hasLinks()):?>
14 
15 <fieldset id="catalog_product_composite_configure_fields_downloadable"
16  class="fieldset admin__fieldset downloadable information<?= $block->getIsLastFieldset() ? ' last-fieldset' : '' ?>">
17  <legend class="legend admin__legend"><span><?= /* @escapeNotVerified */ __('Downloadable Information') ?></span></legend><br />
18  <?php $_links = $block->getLinks(); ?>
19  <?php $_isRequired = $block->getLinkSelectionRequired(); ?>
20  <div class="field admin__field link<?php if ($_isRequired) echo ' required _required' ?>">
21  <label class="label admin__field-label"><span><?= /* @escapeNotVerified */ $block->getLinksTitle() ?></span></label>
22  <div class="control admin__field-control" id="downloadable-links-list">
23  <?php foreach ($_links as $_link): ?>
24  <div class="nested admin__field-option">
25  <?php if ($_linksPurchasedSeparately): ?>
26  <input type="checkbox"
27  class="admin__control-checkbox checkbox<?php if ($_isRequired):?> validate-one-required-by-name<?php endif; ?> product downloadable link"
28  name="links[]" id="links_<?= /* @escapeNotVerified */ $_link->getId() ?>"
29  value="<?= /* @escapeNotVerified */ $_link->getId() ?>" <?= /* @escapeNotVerified */ $block->getLinkCheckedValue($_link) ?>
30  price="<?= /* @escapeNotVerified */ $block->getCurrencyPrice($_link->getPrice()) ?>"/>
31  <?php endif; ?>
32  <label for="links_<?= /* @escapeNotVerified */ $_link->getId() ?>" class="label">
33  <?= $block->escapeHtml($_link->getTitle()) ?>
34  <?php if ($_link->getSampleFile() || $_link->getSampleUrl()): ?>
35  &nbsp;(<a href="<?= /* @escapeNotVerified */ $block->getLinkSampleUrl($_link) ?>" <?= $block->getIsOpenInNewWindow()?'onclick="this.target=\'_blank\'"':'' ?>><?= /* @escapeNotVerified */ __('sample') ?></a>)
36  <?php endif; ?>
37  <?php if ($_linksPurchasedSeparately): ?>
38  <?= /* @escapeNotVerified */ $block->getFormattedLinkPrice($_link) ?>
39  <br />
40  <?= /* @escapeNotVerified */ $block->getLinkPrice($_link) ?>
41  <?php endif; ?>
42  </label>
43  <?php if ($_isRequired): ?>
44  <script>
45 require(['prototype'], function(){
46 
47  //<![CDATA[
48  $('links_<?= /* @escapeNotVerified */ $_link->getId() ?>').advaiceContainer = 'links-advice-container';
49  $('links_<?= /* @escapeNotVerified */ $_link->getId() ?>').callbackFunction = 'validateDownloadableCallback';
50  //]]>
51 
52 });
53 </script>
54  <?php endif; ?>
55  </div>
56  <?php endforeach; ?>
57  <?php if ($_isRequired): ?>
58  <span id="links-advice-container"></span>
59  <?php endif;?>
60  </div>
61  </div>
62 </fieldset>
63 
64  <script>
65 require(['prototype'], function(){
66 
67 //<![CDATA[
68  validateDownloadableCallback = function (elmId, result) {
69  var container = $('downloadable-links-list');
70  if (result == 'failed') {
71  container.removeClassName('validation-passed');
72  container.addClassName('validation-failed');
73  } else {
74  container.removeClassName('validation-failed');
75  container.addClassName('validation-passed');
76  }
77  }
78 //]]>
79 
80 });
81 </script>
82 <?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
$_linksPurchasedSeparately
__()
Definition: __.php:13
endforeach
$block
Definition: block.php:8
$_count $_index $_prevOptionId if($block->getOrderOptions()|| $_item->getDescription()) foreach( $items as $_item)( $_item) ?><?php $attributes if( $_item->getOrderItem() ->getParentItem())($_prevOptionId !=$attributes['option_id'])</td >< td > & nbsp
Definition: renderer.phtml:33
$_isRequired
$_skipSaleableCheck
if( $_isRequired) echo ' required _required' ?>"> <label classforeach($_links as $_link) ($_linksPurchasedSeparately) ( $_isRequired) endif