Skip to content

Commit 2a129d2

Browse files
committed
Fixes in cookies, minicart, newsletter and styling
1 parent 296e047 commit 2a129d2

8 files changed

Lines changed: 251 additions & 225 deletions

File tree

ViewModel/CookieConfig.php

Lines changed: 0 additions & 45 deletions
This file was deleted.

view/frontend/layout/loki_theme_default.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
</referenceContainer>
2323

2424
<referenceContainer name="minicart.addons">
25-
<block name="loki.minicart-contents" template="Loki_Theme::minicart.phtml"/>
25+
<block name="loki.minicart-contents" template="Loki_Theme::component/minicart.phtml"/>
2626
</referenceContainer>
2727
</body>
2828
</page>
Lines changed: 208 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,208 @@
1+
<?php declare(strict_types=1);
2+
3+
use Magento\Framework\Escaper;
4+
use Magento\Framework\View\Element\Template;
5+
6+
/** @version 0.0.7 */
7+
/** @var Template $block */
8+
/** @var Escaper $escaper */
9+
10+
$loaderImage = $block->getViewFileUrl('images/loader-2.gif');
11+
?>
12+
<template x-if="hasCartItems">
13+
<div id="minicart-content-wrapper">
14+
<button
15+
type="button"
16+
id="btn-minicart-close"
17+
class="action close"
18+
@click="closeContent"
19+
title="Close">
20+
<span>Close</span>
21+
</button>
22+
23+
<div class="wrapper">
24+
<div x-cloak x-show="loading" class="loader">
25+
<img src="<?= $escaper->escapeHtml($loaderImage) ?>"
26+
alt="<?= $escaper->escapeHtml('Loading...') ?>">
27+
</div>
28+
29+
<div class="block-title">
30+
<strong>
31+
<span class="text"><?= $escaper->escapeHtml(
32+
__('My Cart')
33+
) ?></span>
34+
<span
35+
class="qty"
36+
:class="qtyClass"
37+
title="<?= $escaper->escapeHtml(__('Items in Cart')) ?>"
38+
x-html="cart.summary_count">0</span>
39+
</strong>
40+
</div>
41+
42+
<div class="block-content">
43+
<div class="items-total">
44+
<span class="count" x-html="cart.summary_count">0</span>
45+
<span><?= $escaper->escapeHtml(
46+
__('Items in Cart')
47+
) ?></span>
48+
</div>
49+
50+
<div class="subtotal">
51+
<span class="label">
52+
<span><?= $escaper->escapeHtml(__('Cart Subtotal')) ?></span>
53+
</span>
54+
55+
<div class="amount price-container">
56+
<span class="price-wrapper">
57+
<span class="price" x-html="cart.subtotal">-</span>
58+
</span>
59+
</div>
60+
</div>
61+
62+
<div class="actions">
63+
<div class="primary">
64+
<button id="top-cart-btn-checkout" type="button"
65+
class="action primary checkout"
66+
@click="proceedToCheckout"
67+
title="<?= $escaper->escapeHtml(
68+
__('Proceed to Checkout')
69+
) ?>"
70+
>
71+
<?= $escaper->escapeHtml(
72+
__('Proceed to Checkout')
73+
) ?>
74+
</button>
75+
</div>
76+
</div>
77+
78+
<strong class="subtitle">
79+
<?= $escaper->escapeHtml(__('Recently added item(s)')) ?>
80+
</strong>
81+
82+
<div class="minicart-items-wrapper">
83+
<ol id="mini-cart" class="minicart-items">
84+
<template x-for="item in cart.items">
85+
<li class="item product product-item odd last"
86+
data-role="product-item">
87+
<div class="product">
88+
<a
89+
tabindex="-1" class="product-item-photo"
90+
:href="item.product_url"
91+
:title="item.product_name">
92+
<span class="product-image-container">
93+
<span class="product-image-wrapper">
94+
<img class="product-image-photo" loading="lazy"
95+
:src="item.product_image.src"
96+
:alt="item.product_image.alt"
97+
:width="item.product_image.width"
98+
:height="item.product_image.height">
99+
</span>
100+
</span>
101+
</a>
102+
103+
<div class="product-item-details">
104+
<strong class="product-item-name">
105+
<a
106+
:href="item.product_url"
107+
x-html="item.product_name"
108+
></a>
109+
</strong>
110+
111+
<div class="product-item-pricing">
112+
<div class="price-container">
113+
<span class="price-wrapper"
114+
x-html="item.product_price"></span>
115+
</div>
116+
117+
<div class="details-qty qty">
118+
<label class="label"
119+
:for="'cart-item-' + item.item_id + '-qty'">
120+
<?= $escaper->escapeHtml(
121+
__('Qty')
122+
) ?>
123+
</label>
124+
125+
<input type="number" min="0"
126+
size="4"
127+
class="item-qty cart-item-qty"
128+
:id="'cart-item-' + item.item_id + '-qty'"
129+
:value="item.qty"
130+
@input="toggleCartItemButton"
131+
:data-cart-item="item.item_id"
132+
:data-cart-item-qty="item.qty"
133+
:data-cart-item-id="item.product_sku">
134+
135+
<button class="update-cart-item"
136+
:data-cart-item-id="item.item_id"
137+
style="display:none"
138+
@click="updateCartItemQty"
139+
title="<?= $escaper->escapeHtml(
140+
__('Update')
141+
) ?>">
142+
<span><?= $escaper->escapeHtml(
143+
__('Update')
144+
) ?></span>
145+
</button>
146+
</div>
147+
</div>
148+
149+
<div class="product actions">
150+
<div class="primary">
151+
<a class="action edit"
152+
:href="item.configure_url"
153+
title="<?= $escaper->escapeHtml(
154+
__('Edit item')
155+
) ?>"
156+
>
157+
<span><?= $escaper->escapeHtml(
158+
__('Edit')
159+
) ?></span>
160+
</a>
161+
</div>
162+
<div class="secondary">
163+
<a @click="removeCartItem"
164+
class="action delete"
165+
:data-cart-item="item.item_id"
166+
title="<?= $escaper->escapeHtml(
167+
__('Remove item')
168+
) ?>"
169+
>
170+
<span><?= $escaper->escapeHtml(
171+
__('Remove')
172+
) ?></span>
173+
</a>
174+
</div>
175+
</div>
176+
</div>
177+
</div>
178+
</li>
179+
</template>
180+
</ol>
181+
</div>
182+
183+
<div class="actions">
184+
<div class="secondary">
185+
<a class="action viewcart"
186+
href="<?= /* @noEscape */
187+
$block->getUrl('checkout/cart') ?>">
188+
<span><?= $escaper->escapeHtml(
189+
__('View and Edit Cart')
190+
) ?></span>
191+
</a>
192+
</div>
193+
</div>
194+
195+
<div id="minicart-widgets" class="minicart-widgets">
196+
</div>
197+
</div>
198+
</div>
199+
</div>
200+
</template>
201+
202+
<template x-if="hasNoCartItems">
203+
<div>
204+
<?= $escaper->escapeHtml(
205+
__('You have no items in your shopping cart.')
206+
) ?>
207+
</div>
208+
</template>

0 commit comments

Comments
 (0)