Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
grouped.phtml
Go to the documentation of this file.
1 <?php
7 // @codingStandardsIgnoreFile
8 
9  ?>
10 
11 <?php /* @var $block \Magento\GroupedProduct\Block\Adminhtml\Product\Composite\Fieldset\Grouped */ ?>
12 <?php $_skipSaleableCheck = $this->helper('Magento\Catalog\Helper\Product')->getSkipSaleableCheck(); ?>
13 <div id="catalog_product_composite_configure_fields_grouped" class="<?= $block->getIsLastFieldset() ? 'last-fieldset' : '' ?>">
14  <h4><?= /* @escapeNotVerified */ __('Associated Products') ?></h4>
15  <div class="product-options">
16  <?php $_product = $block->getProduct(); ?>
17  <?php $block->setPreconfiguredValue(); ?>
18  <?php $_associatedProducts = $block->getAssociatedProducts(); ?>
20  <?php if ((!$_product->isAvailable() && !$_skipSaleableCheck) || !$_hasAssociatedProducts): ?>
21  <p class="availability out-of-stock"><?= /* @escapeNotVerified */ __('Availability:') ?> <span><?= /* @escapeNotVerified */ __('Out of stock') ?></span></p>
22  <?php endif; ?>
23  <table class="data-table admin__table-primary grouped-items-table" id="super-product-table">
24  <thead>
25  <tr class="headings">
26  <th class="col-id"><?= /* @escapeNotVerified */ __('ID') ?></th>
27  <th class="col-sku"><?= /* @escapeNotVerified */ __('SKU') ?></th>
28  <th class="col-name"><?= /* @escapeNotVerified */ __('Product Name') ?></th>
29  <?php if ($block->getCanShowProductPrice($_product)): ?>
30  <th class="col-price"><?= /* @escapeNotVerified */ __('Price') ?></th>
31  <?php endif; ?>
32  <?php if ($_product->isSaleable() || $_skipSaleableCheck): ?>
33  <th class="col-qty"><?= /* @escapeNotVerified */ __('Qty') ?></th>
34  <?php endif; ?>
35  </tr>
36  </thead>
37  <tbody>
38  <?php if ($_hasAssociatedProducts): ?>
39  <?php $i = 0 ?>
40  <?php foreach ($_associatedProducts as $_item): ?>
41  <tr class="<?= /* @escapeNotVerified */ (++$i % 2) ? 'even' : 'odd' ?>">
42  <td class="col-id"><?= /* @escapeNotVerified */ $_item->getId() ?></td>
43  <td class="col-sku"><?= $block->escapeHtml($_item->getSku()) ?></td>
44  <td class="col-name"><?= $block->escapeHtml($_item->getName()) ?></td>
45  <?php if ($block->getCanShowProductPrice($_product)): ?>
46  <td class="col-price">
47  <?php if ($block->getCanShowProductPrice($_item)): ?>
48  <?= /* @escapeNotVerified */ $block->getProductPrice($_item) ?>
49  <?php endif; ?>
50  </td>
51  <?php endif; ?>
52  <?php if ($_product->isSaleable() || $_skipSaleableCheck): ?>
53  <td class="col-qty">
54  <?php if ($_item->isSaleable() || $_skipSaleableCheck) : ?>
55  <input type="text"
56  name="super_group[<?= /* @escapeNotVerified */ $_item->getId() ?>]"
57  id="super_group[<?= /* @escapeNotVerified */ $_item->getId() ?>]"
58  maxlength="12"
59  value="<?= /* @escapeNotVerified */ $_item->getQty()*1 ?>"
60  title="<?= /* @escapeNotVerified */ __('Qty') ?>"
61  class="input-text admin__control-text qty" />
62  <input type="hidden" value="1" price="<?= /* @escapeNotVerified */ $block->getCurrencyPrice($_item->getPrice()) ?>" qtyId="super_group[<?= /* @escapeNotVerified */ $_item->getId() ?>]" />
63  <?php else: ?>
64  <p class="availability out-of-stock"><span><?= /* @escapeNotVerified */ __('Out of stock') ?></span></p>
65  <?php endif; ?>
66  </td>
67  <?php endif; ?>
68  </tr>
69  <?php endforeach; ?>
70  <?php else: ?>
71  <tr>
72  <td class="empty-text" colspan="<?php if ($_product->isSaleable() || $_skipSaleableCheck): ?>4<?php else : ?>3<?php endif; ?>"><?= /* @escapeNotVerified */ __('No options of this product are available.') ?></td>
73  </tr>
74  <?php endif; ?>
75  </tbody>
76  </table>
77  </div>
78 </div>
$_hasAssociatedProducts
Definition: grouped.phtml:19
$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
$_skipSaleableCheck
Definition: grouped.phtml:12
if((! $_product->isAvailable() &&! $_skipSaleableCheck)||! $_hasAssociatedProducts)( 'Availability:') ?>< span ><? endif
Definition: grouped.phtml:20
__()
Definition: __.php:13
$block
Definition: block.php:8
$_item
Definition: default.phtml:11
$_product
Definition: grouped.phtml:16
endforeach
Definition: grouped.phtml:69
$i
Definition: gallery.phtml:31
$_associatedProducts
Definition: grouped.phtml:18