|
| 1 | +<?php declare(strict_types=1); |
| 2 | + |
| 3 | +use Magento\Framework\View\Element\Template; |
| 4 | + |
| 5 | +/** @var Template $block */ |
| 6 | +?> |
| 7 | +<template x-if="hasCartItems"> |
| 8 | +<div id="minicart-content-wrapper"> |
| 9 | + <div class="block-title"> |
| 10 | + <strong> |
| 11 | + <span class="text"><?= __('My Cart') ?></span> |
| 12 | + <span |
| 13 | + class="qty" |
| 14 | + :class="qtyClass" |
| 15 | + title="<?= __('Items in Cart') ?>" |
| 16 | + x-html="cart.summary_count">0</span> |
| 17 | + </strong> |
| 18 | + </div> |
| 19 | + |
| 20 | + <div class="block-content"> |
| 21 | + <button |
| 22 | + type="button" |
| 23 | + id="btn-minicart-close" |
| 24 | + class="action close" |
| 25 | + @click="closeContent" |
| 26 | + title="Close"> |
| 27 | + <span>Close</span> |
| 28 | + </button> |
| 29 | + |
| 30 | + <div class="items-total"> |
| 31 | + <span class="count" x-html="cart.summary_count">0</span> |
| 32 | + <span><?= __('Items in Cart') ?></span> |
| 33 | + </div> |
| 34 | + |
| 35 | + <div class="subtotal"> |
| 36 | + <span class="label"> |
| 37 | + <span><?= __('Cart Subtotal') ?></span> |
| 38 | + </span> |
| 39 | + |
| 40 | + <div class="amount price-container"> |
| 41 | + <span class="price-wrapper"> |
| 42 | + <span class="price" x-html="cart.subtotal">-</span> |
| 43 | + </span> |
| 44 | + </div> |
| 45 | + </div> |
| 46 | + |
| 47 | + <div class="actions"> |
| 48 | + <div class="primary"> |
| 49 | + <button id="top-cart-btn-checkout" type="button" |
| 50 | + class="action primary checkout" |
| 51 | + @click="proceedToCheckout" |
| 52 | + title="<?= __('Proceed to Checkout') ?>"><?= __('Proceed to Checkout') ?> |
| 53 | + </button> |
| 54 | + </div> |
| 55 | + </div> |
| 56 | + |
| 57 | + <strong class="subtitle"><?= __('Recently added item(s)') ?></strong> |
| 58 | + <div class="minicart-items-wrapper"> |
| 59 | + <ol id="mini-cart" class="minicart-items"> |
| 60 | + <template x-for="item in cart.items"> |
| 61 | + <li class="item product product-item odd last" |
| 62 | + data-role="product-item"> |
| 63 | + <div class="product"> |
| 64 | + <a |
| 65 | + tabindex="-1" class="product-item-photo" |
| 66 | + :href="item.product_url" |
| 67 | + :title="item.product_name"> |
| 68 | + <span class="product-image-container"> |
| 69 | + <span class="product-image-wrapper"> |
| 70 | + <img class="product-image-photo" loading="lazy" |
| 71 | + :src="item.product_image.src" |
| 72 | + :alt="item.product_image.alt" |
| 73 | + :width="item.product_image.width" |
| 74 | + :height="item.product_image.height"> |
| 75 | + </span> |
| 76 | + </span> |
| 77 | + </a> |
| 78 | + |
| 79 | + <div class="product-item-details"> |
| 80 | + <strong class="product-item-name"> |
| 81 | + <a |
| 82 | + :href="item.product_url" |
| 83 | + x-html="item.product_name" |
| 84 | + ></a> |
| 85 | + </strong> |
| 86 | + |
| 87 | + <div class="product-item-pricing"> |
| 88 | + <div class="price-container"> |
| 89 | + <span class="price-wrapper" x-html="item.product_price"></span> |
| 90 | + </div> |
| 91 | + |
| 92 | + <div class="details-qty qty"> |
| 93 | + <label class="label" |
| 94 | + :for="'cart-item-' + item.item_id + '-qty'"><?= __('Qty') ?></label> |
| 95 | + <input type="number" min="0" size="4" |
| 96 | + class="item-qty cart-item-qty" |
| 97 | + :id="'cart-item-' + item.item_id + '-qty'" |
| 98 | + :value="item.qty" |
| 99 | + :data-cart-item="item.item_id" |
| 100 | + :data-item-qty="item.qty" |
| 101 | + :data-cart-item-id="item.product_sku"> |
| 102 | + <button class="update-cart-item" |
| 103 | + :data-cart-item="item.item_id" |
| 104 | + @click="updateCartItemQty" |
| 105 | + title="<?= __('Update') ?>"> |
| 106 | + <span><?= __('Update') ?></span> |
| 107 | + </button> |
| 108 | + </div> |
| 109 | + </div> |
| 110 | + |
| 111 | + <div class="product actions"> |
| 112 | + <div class="primary"> |
| 113 | + <a class="action edit" |
| 114 | + :href="item.configure_url" |
| 115 | + title="<?= __('Edit item') ?>"> |
| 116 | + <span><?= __('Edit') ?></span> |
| 117 | + </a> |
| 118 | + </div> |
| 119 | + <div class="secondary"> |
| 120 | + <a @click="removeCartItem" |
| 121 | + class="action delete" |
| 122 | + :data-cart-item="item.item_id" |
| 123 | + title="<?= __('Remove item') ?>"> |
| 124 | + <span><?= __('Remove') ?></span> |
| 125 | + </a> |
| 126 | + </div> |
| 127 | + </div> |
| 128 | + </div> |
| 129 | + </div> |
| 130 | + </li> |
| 131 | + </template> |
| 132 | + </ol> |
| 133 | + </div> |
| 134 | + |
| 135 | + <div class="actions"> |
| 136 | + <div class="secondary"> |
| 137 | + <a class="action viewcart" |
| 138 | + href="<?= $block->getUrl('checkout/cart') ?>"> |
| 139 | + <span><?= __('View and Edit Cart') ?></span> |
| 140 | + </a> |
| 141 | + </div> |
| 142 | + </div> |
| 143 | + |
| 144 | + <div id="minicart-widgets" class="minicart-widgets"> |
| 145 | + </div> |
| 146 | + </div> |
| 147 | +</div> |
| 148 | +</template> |
| 149 | + |
| 150 | +<template x-if="hasNoCartItems"> |
| 151 | + <div> |
| 152 | + <?= __('Your cart is empty') ?> |
| 153 | + </div> |
| 154 | +</template> |
0 commit comments