Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
default.phtml
Go to the documentation of this file.
1 <?php
7 // @codingStandardsIgnoreFile
8 
11 $_item = $block->getItem();
12 $product = $_item->getProduct();
13 $isVisibleProduct = $product->isVisibleInSiteVisibility();
15 $helper = $this->helper('Magento\Msrp\Helper\Data');
16 $canApplyMsrp = $helper->isShowBeforeOrderConfirm($product) && $helper->isMinimalPriceLessMsrp($product);
17 ?>
18 <tbody class="cart item">
19  <tr class="item-info">
20  <td data-th="<?= $block->escapeHtml(__('Item')) ?>" class="col item">
21  <?php if ($block->hasProductUrl()):?>
22  <a href="<?= /* @escapeNotVerified */ $block->getProductUrl() ?>"
23  title="<?= $block->escapeHtml($block->getProductName()) ?>"
24  tabindex="-1"
25  class="product-item-photo">
26  <?php else:?>
27  <span class="product-item-photo">
28  <?php endif;?>
29  <?= $block->getImage($block->getProductForThumbnail(), 'cart_page_product_thumbnail')->toHtml() ?>
30  <?php if ($block->hasProductUrl()):?>
31  </a>
32  <?php else: ?>
33  </span>
34  <?php endif; ?>
35  <div class="product-item-details">
36  <strong class="product-item-name">
37  <?php if ($block->hasProductUrl()):?>
38  <a href="<?= /* @escapeNotVerified */ $block->getProductUrl() ?>"><?= $block->escapeHtml($block->getProductName()) ?></a>
39  <?php else: ?>
40  <?= $block->escapeHtml($block->getProductName()) ?>
41  <?php endif; ?>
42  </strong>
43  <?php if ($_options = $block->getOptionList()):?>
44  <dl class="item-options">
45  <?php foreach ($_options as $_option) : ?>
46  <?php $_formatedOptionValue = $block->getFormatedOptionValue($_option) ?>
47  <dt><?= $block->escapeHtml($_option['label']) ?></dt>
48  <dd>
49  <?php if (isset($_formatedOptionValue['full_view'])): ?>
50  <?= /* @escapeNotVerified */ $_formatedOptionValue['full_view'] ?>
51  <?php else: ?>
52  <?= /* @escapeNotVerified */ $_formatedOptionValue['value'] ?>
53  <?php endif; ?>
54  </dd>
55  <?php endforeach; ?>
56  </dl>
57  <?php endif;?>
58  <?php if ($messages = $block->getMessages()): ?>
59  <?php foreach ($messages as $message): ?>
60  <div class="cart item message <?= /* @escapeNotVerified */ $message['type'] ?>"><div><?= $block->escapeHtml($message['text']) ?></div></div>
61  <?php endforeach; ?>
62  <?php endif; ?>
63  <?php $addInfoBlock = $block->getProductAdditionalInformationBlock(); ?>
64  <?php if ($addInfoBlock): ?>
65  <?= $addInfoBlock->setItem($_item)->toHtml() ?>
66  <?php endif;?>
67  </div>
68  </td>
69 
70  <?php if ($canApplyMsrp): ?>
71  <td class="col msrp" data-th="<?= $block->escapeHtml(__('Price')) ?>">
72  <span class="pricing msrp">
73  <span class="msrp notice"><?= /* @escapeNotVerified */ __('See price before order confirmation.') ?></span>
74  <?php $helpLinkId = 'cart-msrp-help-' . $_item->getId(); ?>
75  <a href="#" class="action help map" id="<?= /* @escapeNotVerified */ ($helpLinkId) ?>" data-mage-init='{"addToCart":{"helpLinkId": "#<?= /* @escapeNotVerified */ $helpLinkId ?>","productName": "<?= /* @escapeNotVerified */ $product->getName() ?>","showAddToCart": false}}'>
76  <span><?= /* @escapeNotVerified */ __("What's this?") ?></span>
77  </a>
78  </span>
79  </td>
80  <?php else: ?>
81  <td class="col price" data-th="<?= $block->escapeHtml(__('Price')) ?>">
82  <?= $block->getUnitPriceHtml($_item) ?>
83  </td>
84  <?php endif; ?>
85  <td class="col qty" data-th="<?= $block->escapeHtml(__('Qty')) ?>">
86  <div class="field qty">
87  <label class="label" for="cart-<?= /* @escapeNotVerified */ $_item->getId() ?>-qty">
88  <span><?= /* @escapeNotVerified */ __('Qty') ?></span>
89  </label>
90  <div class="control qty">
91  <input id="cart-<?= /* @escapeNotVerified */ $_item->getId() ?>-qty"
92  name="cart[<?= /* @escapeNotVerified */ $_item->getId() ?>][qty]"
93  data-cart-item-id="<?= $block->escapeHtml($_item->getSku()) ?>"
94  value="<?= /* @escapeNotVerified */ $block->getQty() ?>"
95  type="number"
96  size="4"
97  title="<?= $block->escapeHtml(__('Qty')) ?>"
98  class="input-text qty"
99  data-validate="{required:true,'validate-greater-than-zero':true}"
100  data-role="cart-item-qty"/>
101  </div>
102  </div>
103  </td>
104 
105  <td class="col subtotal" data-th="<?= $block->escapeHtml(__('Subtotal')) ?>">
106  <?php if ($canApplyMsrp): ?>
107  <span class="cart msrp subtotal">--</span>
108  <?php else: ?>
109  <?= $block->getRowTotalHtml($_item) ?>
110  <?php endif; ?>
111  </td>
112  </tr>
113  <tr class="item-actions">
114  <td colspan="100">
115  <div class="actions-toolbar">
116  <?= /* @escapeNotVerified */ $block->getActions($_item) ?>
117  </div>
118  </td>
119  </tr>
120 </tbody>
$_option
Definition: checkbox.phtml:11
$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
$message
$helper
Definition: default.phtml:15
$block
Definition: block.php:8
endforeach
Definition: default.phtml:72
$_item
Definition: default.phtml:11
$product
Definition: default.phtml:12
if( $_item->getOrderItem() ->getParentItem())( $_item) ?><?php if( $_prevOptionId ! $_prevOptionId endif
Definition: default.phtml:41
$canApplyMsrp
Definition: default.phtml:16
$addInfoBlock
Definition: default.phtml:63
if( $canApplyMsrp)(__( 'Price')) ?>"> <span class $helpLinkId
Definition: default.phtml:74
$isVisibleProduct
Definition: default.phtml:13