This commit is contained in:
2026-09-15 10:35:56 +08:00
commit 782f8ea7aa
4086 changed files with 631288 additions and 0 deletions
@@ -0,0 +1,57 @@
<div id="shipping" class="checkout-shipping-address amcheckout-shipping-address" data-bind="fadeVisible: visible()">
<div class="amcheckout-title-container">
<p class="step-title amcheckout-title"
data-amcheckout-js="step-title"
data-bind="i18n: getNameShippingAddress()"
data-role="title"></p>
</div>
<div id="checkout-step-shipping"
class="step-content amcheckout-content"
data-amcheckout-js="step-content"
data-role="content"
data-bind="mageInit: {'checkoutCollapsibleSteps': {}}">
<div class="amcheckout-wrapper">
<!-- ko ifnot: quoteIsVirtual -->
<!-- ko fastForEach: getRegion('customer-email') -->
<!-- ko fastForEach: getRegion('amazon-button-region') -->
<!-- ko template: getTemplate() --><!-- /ko -->
<!-- /ko -->
<!-- ko template: getTemplate() --><!-- /ko -->
<!--/ko-->
<!--/ko-->
<!-- ko fastForEach: getRegion('address-list') -->
<!-- ko template: getTemplate() --><!-- /ko -->
<!--/ko-->
<!-- ko fastForEach: getRegion('address-list-additional-addresses') -->
<!-- ko template: getTemplate() --><!-- /ko -->
<!--/ko-->
<!-- ko ifnot: isFormInline -->
<!-- ko ifnot: window.isShippingAddressFormOverridden -->
<button type="button"
data-bind="click: showFormPopUp, visible: !isNewAddressAdded()"
class="action action-apply action-show-popup amcheckout-button -new-address esun-checkout-address-action">
<span data-bind="i18n: 'New Address'"></span>
</button>
<div id="opc-new-shipping-address" data-bind="visible: isFormPopUpVisible">
<!-- ko template: 'Magento_Checkout/shipping-address/form' --><!-- /ko -->
</div>
<!-- /ko -->
<!-- /ko -->
<!-- ko fastForEach: getRegion('before-form') -->
<!-- ko template: getTemplate() --><!-- /ko -->
<!--/ko-->
<!-- ko if: isFormInline -->
<!-- ko template: 'Magento_Checkout/shipping-address/form' --><!-- /ko -->
<!-- /ko -->
<!-- ko fastForEach: getRegion('billing-address-form-shared') -->
<!-- ko template: getTemplate() --><!-- /ko -->
<!--/ko-->
</div>
</div>
</div>
@@ -0,0 +1,40 @@
<!-- ko foreach: getRegion('summary') -->
<!-- ko template: getTemplate() --><!-- /ko -->
<!--/ko-->
<!-- ko if: (hasChild('additional')) -->
<div class="amcheckout-additional-options additional-options">
<!-- ko with: getChild('additional') -->
<!-- ko template: getTemplate() --><!-- /ko -->
<!--/ko-->
<div class="amcheckout-clear"></div>
</div>
<!--/ko-->
<!-- ko foreach: getRegion('summary_additional') -->
<div class="checkout-payment-method">
<!-- ko template: getTemplate() --><!-- /ko -->
</div>
<!--/ko-->
<!-- ko if: (hasChild('place-button')) -->
<!-- ko with: getChild('place-button') -->
<div class="checkout-payment-method submit">
<!-- ko template: getTemplate() --><!-- /ko -->
</div>
<!--/ko-->
<!--/ko-->
<!-- ko if: (hasChild('esun-cart-services')) -->
<!-- ko with: getChild('esun-cart-services') -->
<!-- ko template: getTemplate() --><!-- /ko -->
<!--/ko-->
<!--/ko-->
<!-- ko if: (hasChild('trust-seals')) -->
<!-- ko with: getChild('trust-seals') -->
<div class="amcheckout-trust-badges">
<!-- ko template: getTemplate() --><!-- /ko -->
</div>
<!--/ko-->
<!--/ko-->
@@ -0,0 +1,420 @@
.esun-new-product,
.esun-hot-sale,
.esun-resources-downloads,
.esun-innovative-materials {
position: relative;
}
.esun-rule-deal {
--deal-green: #12ad5c;
--deal-green-soft: #e9faf1;
box-sizing: border-box;
margin: 72px auto;
max-width: 1360px;
overflow: hidden;
padding: 28px 20px 0;
position: relative;
width: 100%;
}
.esun-rule-deal *,
.esun-rule-deal *::before,
.esun-rule-deal *::after {
box-sizing: border-box;
}
.esun-rule-deal::before {
background:
radial-gradient(
circle at 16% 5%,
rgba(82, 211, 151, 0.13),
transparent 22%
),
radial-gradient(
circle at 83% 16%,
rgba(82, 211, 151, 0.1),
transparent 24%
);
content: "";
inset: 0;
pointer-events: none;
position: absolute;
}
.esun-rule-deal__header {
align-items: center;
background: rgba(255, 255, 255, 0.96);
border-radius: 68px;
box-shadow: 0 0 36px rgba(26, 137, 82, 0.38);
display: flex;
min-height: 170px;
padding: 24px 105px 24px 205px;
position: relative;
}
.esun-rule-deal__tag {
background-image: url("../images/stock-icon.png");
background-size: contain;
/*background: linear-gradient(145deg, #168eea, #04d27d);*/
/*border-radius: 12px 12px 20px 20px;*/
/*box-shadow: 0 15px 25px rgba(0, 139, 204, .25);*/
color: #fff;
font-size: 46px;
font-weight: 800;
height: 167px;
left: -55px;
line-height: 167px;
position: absolute;
text-align: center;
top: 0;
transform: rotate(5deg);
width: 143px;
}
.esun-rule-deal__tag span {
display: none;
}
.esun-rule-deal__dot {
background: #84e1af;
border-radius: 50%;
height: 26px;
left: 146px;
position: absolute;
width: 26px;
}
.esun-rule-deal__title {
color: #282b2a;
flex: 1;
font-size: 32px;
font-weight: 400;
line-height: 1.1;
margin: 0;
}
.esun-rule-deal__title span {
color: var(--deal-green);
}
.esun-rule-deal__countdown {
display: flex;
gap: 32px;
margin-left: 40px;
}
.esun-rule-deal__time {
color: var(--deal-green);
min-width: 72px;
position: relative;
text-align: center;
}
.esun-rule-deal__time:not(:last-child)::after {
content: ":";
font-size: 24px;
position: absolute;
right: -20px;
top: 2px;
}
.esun-rule-deal__time strong,
.esun-rule-deal__time span {
display: block;
}
.esun-rule-deal__time strong {
font-size: 30px;
font-weight: 500;
}
.esun-rule-deal__time span {
font-size: 14px;
letter-spacing: 0.06em;
margin-top: 4px;
}
.esun-rule-deal__maximum {
align-items: center;
background: var(--deal-green);
border-radius: 50%;
color: #fff;
display: flex;
flex-direction: column;
height: 100px;
justify-content: center;
position: absolute;
right: -18px;
text-align: center;
top: -20px;
transform: rotate(12deg);
width: 100px;
}
.esun-rule-deal__maximum strong {
font-size: 26px;
line-height: 1;
}
.esun-rule-deal__maximum span {
font-size: 13px;
font-weight: 600;
}
.esun-rule-deal__products {
display: grid;
gap: 25px;
grid-template-columns: repeat(4, minmax(0, 1fr));
list-style: none;
margin: 60px 0 0;
padding: 0;
position: relative;
}
.esun-rule-deal__product {
background: #fff;
border: 2px solid rgba(24, 169, 87, 0.12);
border-radius: 30px;
min-width: 0;
padding: 20px;
}
.esun-rule-deal__image {
border-radius: 20px;
overflow: hidden;
position: relative;
}
.esun-rule-deal__image .product-image-container,
.esun-rule-deal__image .product-image-wrapper {
display: block;
width: 100% !important;
}
.esun-rule-deal__image .product-image-wrapper {
height: 300px;
padding-bottom: 0 !important;
}
.esun-rule-deal__image .product-image-photo {
height: 100%;
left: auto;
margin: 0 auto;
max-width: 100%;
object-fit: contain;
position: static;
top: auto;
width: 100%;
border-radius: 20px;
}
.esun-rule-deal__discount {
background: var(--deal-green);
border-radius: 20px;
color: #fff;
font-size: 16px;
left: 0;
padding: 8px 24px;
position: absolute;
top: 0;
z-index: 2;
}
.esun-rule-deal__details {
padding-top: 20px;
position: relative;
}
.esun-rule-deal__details h3 {
font-size: 18px;
margin: 0 0 15px;
height: 40px;
font-weight: 600;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
}
.esun-rule-deal__details h3 a {
color: #333;
text-decoration: none;
}
.esun-rule-deal__price {
align-items: baseline;
display: flex;
gap: 12px;
}
.esun-rule-deal__final-price {
font-size: 18px;
font-weight: 600;
}
.esun-rule-deal__regular-price {
color: #c7c7c7;
font-size: 14px;
text-decoration: line-through;
}
.color-swatches-cart {
display: flex;
align-items: center;
justify-content: space-between;
margin-top: 20px;
}
.esun-rule-deal__swatches {
align-items: center;
display: flex;
gap: 9px;
}
.esun-rule-deal__swatch {
align-items: center;
border: 1px solid #c7cbc9;
border-radius: 50%;
display: inline-flex;
height: 20px;
justify-content: center;
overflow: hidden;
padding: 2px;
width: 20px;
}
.esun-rule-deal__swatch > span,
.esun-rule-deal__swatch img {
border-radius: 50%;
display: block;
height: 100%;
object-fit: cover;
width: 100%;
}
.esun-rule-deal__swatch-more {
color: #b5b5b5;
font-size: 14px;
font-weight: 600;
}
.esun-rule-deal__actions form {
margin: 0;
}
.esun-rule-deal__actions .action.tocart {
align-items: center;
background: var(--deal-green);
border: 0;
border-radius: 50%;
display: flex;
height: 50px;
justify-content: center;
padding: 0;
text-decoration: none;
width: 50px;
}
.esun-rule-deal__actions .action.tocart svg {
fill: #fff;
}
.esun-rule-deal__visually-hidden {
clip: rect(0, 0, 0, 0);
clip-path: inset(50%);
height: 1px;
overflow: hidden;
position: absolute;
white-space: nowrap;
width: 1px;
}
@media (max-width: 1200px) {
.esun-rule-deal__header {
align-items: flex-start;
flex-direction: column;
padding: 40px 150px 40px 190px;
}
.esun-rule-deal__countdown {
margin: 24px 0 0;
}
.esun-rule-deal__products {
grid-template-columns: repeat(2, minmax(0, 1fr));
}
}
@media (max-width: 767px) {
.esun-rule-deal {
margin: 36px auto;
padding: 20px 16px 40px;
}
.esun-rule-deal__header {
border-radius: 32px;
min-height: 0;
padding: 110px 22px 28px;
}
.esun-rule-deal__tag {
height: 70px;
left: 24px;
line-height: 70px;
top: 22px;
width: 68px;
}
.esun-rule-deal__dot {
left: 108px;
top: 48px;
}
.esun-rule-deal__countdown {
gap: 12px;
justify-content: space-between;
width: 100%;
}
.esun-rule-deal__time {
min-width: 0;
}
.esun-rule-deal__time:not(:last-child)::after {
right: -9px;
}
.esun-rule-deal__time strong {
font-size: 22px;
}
.esun-rule-deal__time span {
font-size: 10px;
}
.esun-rule-deal__maximum {
height: 88px;
right: 12px;
top: 12px;
width: 88px;
}
.esun-rule-deal__maximum strong {
font-size: 22px;
}
.esun-rule-deal__maximum span {
font-size: 10px;
margin-top: 5px;
}
.esun-rule-deal__products {
gap: 18px;
grid-template-columns: 1fr;
margin-top: 36px;
}
.esun-rule-deal__product {
border-radius: 30px;
padding: 22px;
}
.esun-rule-deal__image .product-image-wrapper {
height: 280px;
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

@@ -0,0 +1,105 @@
<?xml version="1.0"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
<css src="Magento_Catalog::css/category-list.css"/>
</head>
<body>
<referenceBlock name="catalog.compare.sidebar" remove="true"/>
<referenceBlock name="wishlist_sidebar" remove="true"/>
<referenceBlock name="category.product.addto.compare" remove="true"/>
<referenceBlock name="require-cookie" remove="true"/>
<referenceContainer name="category.view.container" remove="true"/>
<referenceContainer name="columns.top">
<container name="category-top-slider" as="category-top-slider" htmlTag="div" htmlClass="category-top-slider">
<block class="Magento\Cms\Block\Block" name="category_top_slider">
<arguments>
<argument name="block_id" xsi:type="string">category_top_slider</argument>
</arguments>
</block>
</container>
</referenceContainer>
<referenceContainer name="content">
<block class="Magento\Catalog\Block\Category\View" name="category.products" template="Magento_Catalog::category/products.phtml">
<block class="Magento\Catalog\Block\Product\ListProduct" name="category.products.list" as="product_list" template="Magento_Catalog::product/list.phtml">
<container name="category.list.banner" as="category_banner" htmlTag="div" htmlClass="category-view" before="-">
<block class="Magento\Catalog\Block\Category\View" name="category.banner.image" template="Magento_Catalog::category/image.phtml">
<arguments>
<argument name="image" xsi:type="object">Magento\Catalog\ViewModel\Category\Image</argument>
<argument name="output" xsi:type="object">Magento\Catalog\ViewModel\Category\Output</argument>
</arguments>
</block>
<block class="Magento\Catalog\Block\Category\View" name="category.banner.description" template="Magento_Catalog::category/description.phtml"/>
<block class="Magento\Catalog\Block\Category\View" name="category.banner.cms" template="Magento_Catalog::category/cms.phtml"/>
</container>
<container name="category.product.list.additional" as="additional" />
<block class="Magento\Framework\View\Element\RendererList" name="category.product.type.details.renderers" as="details.renderers">
<block class="Magento\Framework\View\Element\Template" name="category.product.type.details.renderers.default" as="default"/>
</block>
<block class="Magento\Catalog\Block\Product\ProductList\Item\Container" name="category.product.addto" as="addto">
<block class="Magento\Catalog\Block\Product\ProductList\Item\AddTo\Compare"
name="category.product.addto.compare" as="compare"
template="Magento_Catalog::product/list/addto/compare.phtml"/>
</block>
<block class="Magento\Catalog\Block\Product\ProductList\Toolbar" name="product_list_toolbar" template="Magento_Catalog::product/list/toolbar.phtml">
<block class="Magento\Theme\Block\Html\Pager" name="product_list_toolbar_pager"/>
</block>
<action method="setToolbarBlockName">
<argument name="name" xsi:type="string">product_list_toolbar</argument>
</action>
</block>
</block>
<block class="Magento\Cookie\Block\RequireCookie" name="require-cookie" template="Magento_Cookie::require_cookie.phtml">
<arguments>
<argument name="triggers" xsi:type="array">
<item name="compareProductLink" xsi:type="string">.action.tocompare</item>
</argument>
</arguments>
</block>
</referenceContainer>
<referenceContainer name="columns">
<container name="category.bottom.content" as="category_bottom_content" htmlTag="div" htmlClass="category-bottom-content" after="-">
<container name="service-guarantee" as="service-guarantee" htmlTag="div" htmlClass="service-guarantee">
<block class="Magento\Cms\Block\Block" name="service_guarantee">
<arguments>
<argument name="block_id" xsi:type="string">service_guarantee</argument>
</arguments>
</block>
</container>
<!-- <container name="footer-esun_contactus" as="footer-esun_contactus" htmlTag="div" htmlClass="footer-esun_contactus">
<block class="Magento\Cms\Block\Block" name="esun_contactus">
<arguments>
<argument name="block_id" xsi:type="string">esun_contactus</argument>
</arguments>
</block>
</container> -->
</container>
</referenceContainer>
<referenceBlock name="page.main.title">
<arguments>
<argument name="id" xsi:type="string">page-title-heading</argument>
<argument name="add_base_attribute_aria" xsi:type="string">page-title-heading toolbar-amount</argument>
</arguments>
<block class="Magento\Catalog\Block\Category\Rss\Link" name="rss.link" template="Magento_Catalog::category/rss.phtml"/>
</referenceBlock>
<move element="page.main.title" destination="category.list.banner" before="category.banner.description"/>
<referenceBlock name="category.products.list">
<arguments>
<argument name="viewModel" xsi:type="object">Magento\Catalog\ViewModel\Product\OptionsData</argument>
<argument name="cardViewModel" xsi:type="object">Esun\Catalog\ViewModel\Category\ProductCard</argument>
</arguments>
</referenceBlock>
<referenceContainer name="page.bottom" htmlTag="div" htmlClass="footer-esun_contactus">
<block class="Magento\Cms\Block\Block" name="esun_contactus">
<arguments>
<argument name="block_id" xsi:type="string">esun_contactus</argument>
</arguments>
</block>
</referenceContainer>
</body>
</page>
@@ -0,0 +1,252 @@
<?xml version="1.0"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
<css src="mage/gallery/gallery.css"/>
</head>
<update handle="catalog_product_opengraph" />
<update handle="page_calendar"/>
<body>
<attribute name="itemtype" value="http://schema.org/Product" />
<attribute name="itemscope" value="itemscope"/>
<referenceBlock name="head.components">
<block class="Magento\Framework\View\Element\Js\Components" name="checkout_page_head_components" template="Magento_Catalog::js/components.phtml"/>
</referenceBlock>
<referenceBlock name="page.main.title">
<arguments>
<argument name="css_class" xsi:type="string">product</argument>
<argument name="add_base_attribute" xsi:type="string">itemprop="name"</argument>
</arguments>
</referenceBlock>
<referenceBlock name="root">
<arguments>
<argument name="add_attribute" xsi:type="string">itemscope itemtype="http://schema.org/Product"</argument>
</arguments>
</referenceBlock>
<referenceBlock name="breadcrumbs" template="Magento_Catalog::product/breadcrumbs.phtml">
<arguments>
<argument name="viewModel" xsi:type="object">Esun\Catalog\ViewModel\Product\Breadcrumbs</argument>
</arguments>
</referenceBlock>
<referenceContainer name="content">
<container name="product.info.main" htmlTag="div" htmlClass="product-info-main" before="product.info.details">
<container name="product.info.price" label="Product info auxiliary container" htmlTag="div" htmlClass="product-info-price">
<container name="product.info.stock.sku" label="Product auxiliary info" htmlTag="div" htmlClass="product-info-stock-sku">
<container name="product.info.type" before="-"/>
<block class="Magento\Catalog\Block\Product\View\Description" name="product.info.sku" template="Magento_Catalog::product/view/attribute.phtml" after="product.info.type">
<arguments>
<argument name="at_call" xsi:type="string">getSku</argument>
<argument name="at_code" xsi:type="string">sku</argument>
<argument name="css_class" xsi:type="string">sku</argument>
<argument name="at_label" xsi:type="string">default</argument>
<argument name="add_attribute" xsi:type="string">itemprop="sku"</argument>
</arguments>
</block>
</container>
<block class="Magento\Catalog\Block\Product\View" name="product.info.review" template="Magento_Catalog::product/view/review.phtml" after="product.info.stock.sku">
<block class="Magento\Wishlist\Block\Catalog\Product\View\AddTo\Wishlist"
name="esun.product.wishlist"
as="esun_product_wishlist"
template="Esun_Catalog::product/view/wishlist.phtml"/>
</block>
<block class="Magento\Catalog\Pricing\Render" name="product.price.final">
<arguments>
<argument name="price_render" xsi:type="string">product.price.render.default</argument>
<argument name="price_type_code" xsi:type="string">final_price</argument>
<argument name="zone" xsi:type="string">item_view</argument>
</arguments>
</block>
</container>
<block class="Magento\Catalog\Pricing\Render" name="product.price.tier" after="product.info.price">
<arguments>
<argument name="price_render" xsi:type="string">product.price.render.default</argument>
<argument name="price_type_code" xsi:type="string">tier_price</argument>
<argument name="zone" xsi:type="string">item_view</argument>
</arguments>
</block>
<container name="alert.urls" as="alert_urls" label="Alert Urls" after="product.price.tier"/>
<block class="Magento\Catalog\Block\Product\View" name="product.info" template="Magento_Catalog::product/view/form.phtml" after="alert.urls">
<container name="product.info.form.content" as="product_info_form_content">
<block class="Magento\Catalog\Block\Product\View" name="product.info.addtocart" as="addtocart" template="Magento_Catalog::product/view/addtocart.phtml"/>
</container>
<block class="Magento\Framework\View\Element\Template" name="product.info.form.options" as="options_container">
<block class="Magento\Catalog\Block\Product\View" name="product.info.options.wrapper" as="product_options_wrapper" template="Magento_Catalog::product/view/options/wrapper.phtml">
<block class="Magento\Catalog\Block\Product\View\Options" name="product.info.options" as="product_options" template="Magento_Catalog::product/view/options.phtml">
<block class="Magento\Catalog\Block\Product\View\Options\Type\DefaultType" name="product.info.options.default" as="default" template="Magento_Catalog::product/view/options/type/default.phtml"/>
<block class="Magento\Catalog\Block\Product\View\Options\Type\Text" name="product.info.options.text" as="text" template="Magento_Catalog::product/view/options/type/text.phtml"/>
<block class="Magento\Catalog\Block\Product\View\Options\Type\File" name="product.info.options.file" as="file" template="Magento_Catalog::product/view/options/type/file.phtml"/>
<block class="Magento\Catalog\Block\Product\View\Options\Type\Select" name="product.info.options.select" as="select" template="Magento_Catalog::product/view/options/type/select.phtml"/>
<block class="Magento\Catalog\Block\Product\View\Options\Type\Date" name="product.info.options.date" as="date" template="Magento_Catalog::product/view/options/type/date.phtml"/>
</block>
<block class="Magento\Framework\View\Element\Html\Calendar" name="html_calendar" as="html_calendar" template="Magento_Theme::js/calendar.phtml"/>
</block>
<block class="Magento\Catalog\Block\Product\View" name="product.info.options.wrapper.bottom" as="product_options_wrapper_bottom" template="Magento_Catalog::product/view/options/wrapper/bottom.phtml">
<block class="Magento\Catalog\Block\Product\View" name="product.info.addtocart.additional" as="product.info.addtocart" template="Magento_Catalog::product/view/addtocart.phtml"/>
</block>
</block>
</block>
<block class="Esun\Catalog\Block\Product\RecommendedProducts"
name="esun.product.recommended.products"
template="Esun_Catalog::product/recommended-products.phtml"
after="product.info"/>
<container name="product.info.extrahint" as="extrahint" label="Product View Extra Hint">
<container name="product.info.social" label="Product social links container" htmlTag="div" htmlClass="product-social-links">
<block class="Magento\Catalog\Block\Product\View" name="product.info.addto" as="addto" template="Magento_Catalog::product/view/addto.phtml">
<block class="Magento\Catalog\Block\Product\View\AddTo\Compare" name="view.addto.compare" after="view.addto.wishlist"
template="Magento_Catalog::product/view/addto/compare.phtml" >
<arguments>
<argument name="addToCompareViewModel" xsi:type="object">Magento\Catalog\ViewModel\Product\Checker\AddToCompareAvailability</argument>
</arguments>
</block>
</block>
<block class="Magento\Catalog\Block\Product\View" name="product.info.mailto" template="Magento_Catalog::product/view/mailto.phtml"/>
</container>
</container>
<block class="Magento\Catalog\Block\Product\View\Description" name="product.info.overview" template="Magento_Catalog::product/view/attribute.phtml" group="detailed_info" after="product.info.extrahint">
<arguments>
<argument name="at_call" xsi:type="string">getShortDescription</argument>
<argument name="at_code" xsi:type="string">short_description</argument>
<argument name="css_class" xsi:type="string">overview</argument>
<argument name="at_label" xsi:type="string">none</argument>
<argument name="title" translate="true" xsi:type="string">Overview</argument>
<argument name="add_attribute" xsi:type="string">itemprop="description"</argument>
</arguments>
</block>
</container>
<container name="product.info.media" htmlTag="div" htmlClass="product media" before="product.info.main">
<block class="Magento\Framework\View\Element\Template" name="skip_gallery_after.target" before="skip_gallery_before.wrapper" template="Magento_Theme::html/skiptarget.phtml">
<arguments>
<argument name="target_id" xsi:type="string">gallery-prev-area</argument>
</arguments>
</block>
<container name="skip_gallery_before.wrapper" htmlTag="div" htmlClass="action-skip-wrapper">
<block class="Magento\Framework\View\Element\Template" name="skip_gallery_before" template="Magento_Theme::html/skip.phtml">
<arguments>
<argument name="target" xsi:type="string">gallery-next-area</argument>
<argument name="label" translate="true" xsi:type="string">Skip to the end of the images gallery</argument>
</arguments>
</block>
</container>
<block class="Magento\Catalog\Block\Product\View\Gallery" name="product.info.media.image" template="Magento_Catalog::product/view/gallery.phtml">
<arguments>
<argument name="gallery_options" xsi:type="object">Magento\Catalog\Block\Product\View\GalleryOptions</argument>
<argument name="imageHelper" xsi:type="object">Magento\Catalog\Helper\Image</argument>
</arguments>
</block>
<container name="skip_gallery_after.wrapper" htmlTag="div" htmlClass="action-skip-wrapper">
<block class="Magento\Framework\View\Element\Template" name="skip_gallery_after" template="Magento_Theme::html/skip.phtml">
<arguments>
<argument name="target" xsi:type="string">gallery-prev-area</argument>
<argument name="label" translate="true" xsi:type="string">Skip to the beginning of the images gallery</argument>
</arguments>
</block>
</container>
<block class="Magento\Framework\View\Element\Template" name="skip_gallery_before.target" after="skip_gallery_after.wrapper" template="Magento_Theme::html/skiptarget.phtml">
<arguments>
<argument name="target_id" xsi:type="string">gallery-next-area</argument>
</arguments>
</block>
</container>
<block class="Magento\Catalog\Block\Product\View\Details" name="product.info.details" template="Esun_Catalog::product/details.phtml" after="product.info.media">
<block class="Magento\Catalog\Block\Product\View\Description" name="esun.product.info.product.overview" as="product_overview" template="Magento_Catalog::product/view/attribute.phtml" group="detailed_info">
<arguments>
<argument name="at_call" xsi:type="string">getProductOverview</argument>
<argument name="at_code" xsi:type="string">product_overview</argument>
<argument name="css_class" xsi:type="string">product-overview</argument>
<argument name="at_label" xsi:type="string">none</argument>
<argument name="title" translate="true" xsi:type="string">Product Overview</argument>
<argument name="sort_order" xsi:type="string">10</argument>
</arguments>
</block>
<block class="Magento\Cms\Block\Block" name="esun.product.info.delivery.shipping" as="delivery_shipping" group="detailed_info">
<arguments>
<argument name="block_id" xsi:type="string">esun_product_delivery_shipping</argument>
<argument name="title" translate="true" xsi:type="string">Delivery and Shipping</argument>
<argument name="sort_order" xsi:type="string">20</argument>
</arguments>
</block>
<block class="Magento\Cms\Block\Block" name="esun.product.info.payment.security" as="payment_security" group="detailed_info">
<arguments>
<argument name="block_id" xsi:type="string">esun_product_payment_security</argument>
<argument name="title" translate="true" xsi:type="string">Payment &amp; Security</argument>
<argument name="sort_order" xsi:type="string">30</argument>
</arguments>
</block>
</block>
<block class="Magento\Cookie\Block\RequireCookie" name="require-cookie" template="Magento_Cookie::require_cookie.phtml">
<arguments>
<argument name="triggers" xsi:type="array">
<item name="compareProductLink" xsi:type="string">.action.tocompare</item>
</argument>
</arguments>
</block>
</referenceContainer>
<referenceBlock name="product.info.overview" remove="true"/>
<referenceBlock name="product.info.description" remove="true"/>
<referenceBlock name="product.attributes" remove="true"/>
<referenceBlock name="reviews.tab" remove="true"/>
<referenceBlock name="product.attributes.wrapper" remove="true"/>
<referenceBlock name="product.attributes.exclude.pagebuilder" remove="true"/>
<referenceBlock name="product.reviews.wrapper" remove="true"/>
<referenceBlock name="product.info.product_additional_data.wrapper" remove="true"/>
<move element="product.info.details" destination="product.info.main" after="esun.product.recommended.products"/>
<referenceContainer name="content.aside">
<block class="Magento\Catalog\Block\Product\ProductList\Related" name="catalog.product.related" template="Magento_Catalog::product/list/items.phtml">
<arguments>
<argument name="type" xsi:type="string">related</argument>
<argument name="view_model" xsi:type="object">Magento\Catalog\ViewModel\Product\Listing\PreparePostData</argument>
</arguments>
<block class="Magento\Catalog\Block\Product\ProductList\Item\Container" name="related.product.addto" as="addto">
<block class="Magento\Catalog\Block\Product\ProductList\Item\AddTo\Compare"
name="related.product.addto.compare" as="compare"
template="Magento_Catalog::product/list/addto/compare.phtml"/>
</block>
</block>
<block class="Magento\Catalog\Block\Product\ProductList\Upsell" name="product.info.upsell" template="Magento_Catalog::product/list/items.phtml">
<arguments>
<argument name="type" xsi:type="string">upsell</argument>
<argument name="view_model" xsi:type="object">Magento\Catalog\ViewModel\Product\Listing\PreparePostData</argument>
</arguments>
<block class="Magento\Catalog\Block\Product\ProductList\Item\Container" name="upsell.product.addto" as="addto">
<block class="Magento\Catalog\Block\Product\ProductList\Item\AddTo\Compare"
name="upsell.product.addto.compare" as="compare"
template="Magento_Catalog::product/list/addto/compare.phtml"/>
</block>
</block>
<block class="Magento\Catalog\Block\Product\View\Additional" name="product.info.additional" as="product_additional_data"/>
</referenceContainer>
<referenceBlock name="product.info.addtocart">
<block class="Magento\Catalog\Block\ShortcutButtons\InCatalog" name="addtocart.shortcut.buttons"/>
</referenceBlock>
<referenceBlock name="product.info.addtocart.additional">
<block class="Magento\Catalog\Block\ShortcutButtons\InCatalog" name="addtocart.shortcut.buttons.additional"/>
</referenceBlock>
<referenceContainer name="content">
<block
class="Magento\Catalog\Block\Ui\ProductViewCounter"
name="product_viewed_counter"
template="Magento_Catalog::product/view/counter.phtml"/>
</referenceContainer>
<!-- Remove Add to Compare from Product View Page -->
<referenceBlock name="view.addto.compare" remove="true"/>
<!-- Remove Add to Wish List from Product View Page -->
<referenceBlock name="view.addto.wishlist" remove="true"/>
<referenceContainer name="page.bottom" htmlTag="div" htmlClass="footer-esun_contactus">
<block class="Magento\Cms\Block\Block" name="esun_contactus">
<arguments>
<argument name="block_id" xsi:type="string">esun_contactus</argument>
</arguments>
</block>
</referenceContainer>
</body>
</page>
@@ -0,0 +1,71 @@
<?xml version="1.0"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceContainer name="before.body.end">
<block class="Magento\Catalog\Block\FrontendStorageManager" name="frontend-storage-manager" before="-"
template="Magento_Catalog::frontend_storage_manager.phtml">
<arguments>
<argument name="configuration" xsi:type="array">
<item name="recently_viewed_product" xsi:type="array">
<item name="requestConfig" xsi:type="array">
<item name="syncUrl" xsi:type="url" path="catalog/product/frontend_action_synchronize"/>
</item>
</item>
<item name="recently_compared_product" xsi:type="array">
<item name="requestConfig" xsi:type="array">
<item name="syncUrl" xsi:type="url" path="catalog/product/frontend_action_synchronize"/>
</item>
</item>
<item name="product_data_storage" xsi:type="array">
<item name="updateRequestConfig" xsi:type="array">
<item name="url" xsi:type="serviceUrl" path="/products-render-info"/>
</item>
<item name="requestConfig" xsi:type="array">
<item name="syncUrl" xsi:type="url" path="catalog/product/frontend_action_synchronize"/>
</item>
</item>
</argument>
</arguments>
</block>
</referenceContainer>
<referenceBlock name="top.links">
<block class="Magento\Framework\View\Element\Template" name="catalog.compare.link" before="-"
template="Magento_Catalog::product/compare/link.phtml">
<arguments>
<argument name="jsLayout" xsi:type="array">
<item name="components" xsi:type="array">
<item name="compareProducts" xsi:type="array">
<item name="component" xsi:type="string">Magento_Catalog/js/view/compare-products</item>
</item>
</item>
</argument>
</arguments>
</block>
</referenceBlock>
<referenceContainer name="sidebar.additional">
<block class="Magento\Framework\View\Element\Template" name="catalog.compare.sidebar"
template="Magento_Catalog::product/compare/sidebar.phtml">
<arguments>
<argument name="jsLayout" xsi:type="array">
<item name="components" xsi:type="array">
<item name="compareProducts" xsi:type="array">
<item name="component" xsi:type="string">Magento_Catalog/js/view/compare-products</item>
</item>
</item>
</argument>
</arguments>
</block>
</referenceContainer>
<referenceContainer name="after.body.start">
<block class="Magento\Framework\View\Element\Js\Components" name="head.components" as="components" template="Magento_Catalog::js/components.phtml"/>
</referenceContainer>
<block class="Magento\Framework\View\Element\Template" name="head.critical" as="head.critical" template="Magento_Theme::html/container.phtml"/>
<block class="Magento\Framework\View\Element\Template" name="head.additional" as="head.additional" template="Magento_Theme::html/container.phtml"/>
</body>
</page>
@@ -0,0 +1,24 @@
/**
* Copyright 2011 Adobe
* All Rights Reserved.
*/
var config = {
map: {
'*': {
compareList: 'Magento_Catalog/js/list',
relatedProducts: 'Magento_Catalog/js/related-products',
upsellProducts: 'Magento_Catalog/js/upsell-products',
productListToolbarForm: 'Magento_Catalog/js/product/list/toolbar',
catalogGallery: 'Magento_Catalog/js/gallery',
esunCategoryCard: 'Magento_Catalog/js/category-card'
}
},
config: {
mixins: {
'Magento_Theme/js/view/breadcrumbs': {
'Magento_Catalog/js/product/breadcrumbs': true
}
}
}
};
@@ -0,0 +1,35 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
?>
<?php
// phpcs:disable Magento2.Templates.ThisInTemplate.FoundThis
/**
* Category view template
*
* @var $block \Magento\Catalog\Block\Category\View
*/
?>
<?php
$_category = $block->getCurrentCategory();
$_description = $_category->getDescription();
$_descriptionText = '';
if ($_description) {
$_descriptionHtml = $this->helper(Magento\Catalog\Helper\Output::class)->categoryAttribute(
$_category,
$_description,
'description'
);
$_descriptionHtml = preg_replace('/<(script|style)\b[^>]*>.*?<\/\1>/is', '', (string) $_descriptionHtml);
$_descriptionText = trim((string) preg_replace('/\s+/', ' ', strip_tags($_descriptionHtml)));
}
?>
<?php if ($_descriptionText) : ?>
<div class="category-description">
<p class="category-description__text"><?= $block->escapeHtml($_descriptionText) ?></p>
</div>
<?php endif; ?>
@@ -0,0 +1,28 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
?>
<?php
/**
* Category view template
*
* @var $block \Magento\Catalog\Block\Category\View
*/
// phpcs:disable Magento2.Templates.ThisInTemplate.FoundThis
// phpcs:disable Generic.WhiteSpace.ScopeIndent.IncorrectExact
// phpcs:disable Magento2.Security.LanguageConstruct.DirectOutput
?>
<?php
$_category = $block->getCurrentCategory();
$_imgHtml = '';
if ($_imgUrl = $block->getImage()->getUrl($_category)) {
$_imgHtml = '<div class="category-image" aria-hidden="true"><img src="'
. $block->escapeUrl($_imgUrl)
. '" alt="" class="image" loading="eager" /></div>';
$_imgHtml = $block->getOutput()->categoryAttribute($_category, $_imgHtml, 'image');
/* @noEscape */ echo $_imgHtml;
}
?>
@@ -0,0 +1,16 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
?>
<?php
/**
* Category view template
*
* @var $block \Magento\Catalog\Block\Category\View
*/
?>
<?php if (!$block->isContentMode() || $block->isMixedMode()) :?>
<?= $block->getProductListHtml() ?>
<?php endif; ?>
@@ -0,0 +1,52 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
/**
* Category left navigation
*
* @var \Magento\Catalog\Block\Navigation $block
* @var \Magento\Framework\Locale\LocaleFormatter $localeFormatter
*/
?>
<?php if (!$block->getCategory()) {
return;
} ?>
<?php $_categories = $block->getCurrentChildCategories() ;?>
<?php $_count = is_array($_categories) ? count($_categories) : $_categories->count(); ?>
<?php if ($_count):?>
<div class="block filter">
<div class="title">
<strong><?= $block->escapeHtml(__('Shop By')) ?></strong>
</div>
<div class="content">
<strong class="subtitle"><?= $block->escapeHtml(__('Shopping Options')) ?></strong>
<dl class="options" id="narrow-by-list2">
<dt><?= $block->escapeHtml(__('Category')) ?></dt>
<dd>
<ol class="items">
<?php /** @var \Magento\Catalog\Model\Category $_category */ ?>
<?php foreach ($_categories as $_category):?>
<?php if ($_category->getIsActive()):?>
<li class="item">
<a href="<?= $block->escapeUrl($block->getCategoryUrl($_category)) ?>"
<?php if ($block->isCategoryActive($_category)):?>
class="current"
<?php endif; ?>
><?= $block->escapeHtml($_category->getName()) ?></a>
<span class="count">
<?= $block->escapeHtml(
$localeFormatter->formatNumber($_category->getProductCount())
) ?>
</span>
</li>
<?php endif; ?>
<?php endforeach ?>
</ol>
</dd>
</dl>
</div>
</div>
<?php endif; ?>
@@ -0,0 +1,28 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
/** @var \Magento\Theme\Block\Html\Breadcrumbs $block */
/** @var \Esun\Catalog\ViewModel\Product\Breadcrumbs $viewModel */
$viewModel = $block->getData('viewModel');
$items = $viewModel->getItems();
?>
<?php if ($items): ?>
<div class="breadcrumbs">
<ul class="items">
<?php foreach ($items as $index => $item): ?>
<li class="item <?= $item['last'] ? 'product' : ($index === 0 ? 'home' : 'category') ?>">
<?php if ($item['link']): ?>
<a href="<?= $escaper->escapeUrl($item['link']) ?>"
title="<?= $escaper->escapeHtmlAttr($item['label']) ?>">
<?= $escaper->escapeHtml($item['label']) ?>
</a>
<?php else: ?>
<strong><?= $escaper->escapeHtml($item['label']) ?></strong>
<?php endif; ?>
</li>
<?php endforeach; ?>
</ul>
</div>
<?php endif; ?>
@@ -0,0 +1,19 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
/** @var $block Magento\Framework\View\Element\Template */
?>
<li class="item link compare" data-bind="scope: 'compareProducts'" data-role="compare-products-link">
<a class="action compare no-display" title="<?= $block->escapeHtmlAttr(__('Compare Products')) ?>"
data-bind="attr: {'href': compareProducts().listUrl}, css: {'no-display': !compareProducts().count}"
>
<?= $block->escapeHtml(__('Compare Products')) ?>
<span class="counter qty" data-bind="text: compareProducts().countCaption"></span>
</a>
</li>
<script type="text/x-magento-init">
{"[data-role=compare-products-link]": {"Magento_Ui/js/core/app": <?= /* @noEscape */ $block->getJsLayout() ?>}}
</script>
@@ -0,0 +1,156 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
// phpcs:disable Magento2.Templates.ThisInTemplate.FoundThis
// phpcs:disable PSR2.ControlStructures.SwitchDeclaration
// phpcs:disable Generic.WhiteSpace.ScopeIndent
/* @var $block \Magento\Catalog\Block\Product\Compare\ListCompare */
?>
<?php $total = $block->getItems()->getSize() ?>
<?php if ($total) :?>
<a href="#" class="action print hidden-print" title="<?= $block->escapeHtmlAttr(__('Print This Page')) ?>">
<span><?= $block->escapeHtml(__('Print This Page')) ?></span>
</a>
<div class="table-wrapper comparison">
<table class="data table table-comparison" id="product-comparison"
data-mage-init='{"compareList":{
"windowPrintSelector":".action.print",
"productsInRow":"5",
"selectors":{
"productAddToCartSelector":"button.action.tocart"}
}}'>
<caption class="table-caption"><?= $block->escapeHtml(__('Compare Products')) ?></caption>
<thead>
<tr>
<?php $index = 0 ?>
<?php foreach ($block->getItems() as $item) :?>
<?php if ($index++ == 0) :?>
<th scope="row" class="cell label remove"><span><?= $block->escapeHtml(__('Remove Product')) ?></span></th>
<?php endif; ?>
<td class="cell remove product hidden-print">
<?php $compareHelper = $this->helper(Magento\Catalog\Helper\Product\Compare::class);?>
<a href="#" data-post='<?= /* @noEscape */ $compareHelper->getPostDataRemove($item) ?>'
class="action delete" title="<?= $block->escapeHtmlAttr(__('Remove Product')) ?>">
<span><?= $block->escapeHtml(__('Remove Product')) ?></span>
</a>
</td>
<?php endforeach; ?>
</tr>
</thead>
<tbody>
<tr>
<?php $index = 0; ?>
<?php $helper = $this->helper(Magento\Catalog\Helper\Output::class); ?>
<?php /** @var $item \Magento\Catalog\Model\Product */ ?>
<?php foreach ($block->getItems() as $item) :?>
<?php if ($index++ == 0) :?>
<th scope="row" class="cell label product">
<span><?= $block->escapeHtml(__('Product')) ?></span>
</th>
<?php endif; ?>
<td data-th="<?= $block->escapeHtmlAttr(__('Product')) ?>" class="cell product info">
<a class="product-item-photo"
href="<?= $block->escapeUrl($block->getProductUrl($item)) ?>"
title="<?= /* @noEscape */ $block->stripTags($item->getName(), null, true) ?>">
<?= $block->getImage($item, 'product_comparison_list')->toHtml() ?>
</a>
<strong class="product-item-name">
<a href="<?= $block->escapeUrl($block->getProductUrl($item)) ?>"
title="<?= /* @noEscape */ $block->stripTags($item->getName(), null, true) ?>">
<?= /* @noEscape */ $helper->productAttribute($item, $item->getName(), 'name') ?>
</a>
</strong>
<?= $block->getReviewsSummaryHtml($item, 'short') ?>
<?= /* @noEscape */ $block->getProductPrice($item, '-compare-list-top') ?>
<div class="product-item-actions hidden-print">
<div class="actions-primary">
<?php if ($item->isSaleable()) :?>
<form data-role="tocart-form"
action="<?= $block->escapeUrl($this->helper(Magento\Catalog\Helper\Product\Compare::class)->getAddToCartUrl($item)) ?>"
method="post">
<?= $block->getBlockHtml('formkey') ?>
<button type="submit" class="action tocart primary" disabled>
<span><?= $block->escapeHtml(__('Add to Cart')) ?></span>
</button>
</form>
<?php else :?>
<?php if ($item->isAvailable()) :?>
<div class="stock available"><span><?= $block->escapeHtml(__('In stock')) ?></span></div>
<?php else :?>
<div class="stock unavailable"><span><?= $block->escapeHtml(__('Out of stock')) ?></span></div>
<?php endif; ?>
<?php endif; ?>
</div>
<?php if ($this->helper(Magento\Wishlist\Helper\Data::class)->isAllow()) :?>
<div class="secondary-addto-links actions-secondary" data-role="add-to-links">
<a href="#"
data-post='<?= /* @noEscape */ $block->getAddToWishlistParams($item) ?>'
class="action towishlist"
data-action="add-to-wishlist">
<span><?= $block->escapeHtml(__('Add to Wish List')) ?></span>
</a>
</div>
<?php endif; ?>
</div>
</td>
<?php endforeach; ?>
</tr>
</tbody>
<tbody>
<?php foreach ($block->getAttributes() as $attribute) :?>
<?php $index = 0; ?>
<?php if ($block->hasAttributeValueForProducts($attribute)) :?>
<tr>
<?php foreach ($block->getItems() as $item) :?>
<?php if ($index++ == 0) :?>
<th scope="row" class="cell label">
<span class="attribute label">
<?= $block->escapeHtml($attribute->getStoreLabel() ? $attribute->getStoreLabel() : __($attribute->getFrontendLabel())) ?>
</span>
</th>
<?php endif; ?>
<td class="cell product attribute">
<div class="attribute value">
<?php switch ($attribute->getAttributeCode()) {
case "price": ?>
<?=
/* @noEscape */ $block->getProductPrice(
$item,
'-compare-list-' . $attribute->getCode()
)
?>
<?php break;
case "small_image": ?>
<?php $block->getImage($item, 'product_small_image')->toHtml(); ?>
<?php break;
default :?>
<?php if (is_string($block->getProductAttributeValue($item, $attribute))) :?>
<?= /* @noEscape */ $helper->productAttribute($item, $block->getProductAttributeValue($item, $attribute), $attribute->getAttributeCode()) ?>
<?php else : ?>
<?= $block->escapeHtml($helper->productAttribute($item, $block->getProductAttributeValue($item, $attribute), $attribute->getAttributeCode())) ?>
<?php endif; ?>
<?php break;
} ?>
</div>
</td>
<?php endforeach; ?>
</tr>
<?php endif; ?>
<?php endforeach; ?>
</tbody>
</table>
</div>
<script type="text/x-magento-init">
{
"[data-role=tocart-form]": {
"catalogAddToCart": {}
}
}
</script>
<?php else :?>
<div class="message info empty"><div><?= $block->escapeHtml(__('You have no items to compare.')) ?></div></div>
<?php endif; ?>
@@ -0,0 +1,52 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
// phpcs:disable Magento2.Templates.ThisInTemplate.FoundThis
/* @var $block \Magento\Framework\View\Element\Template */
?>
<div class="block block-compare" data-bind="scope: 'compareProducts'" data-role="compare-products-sidebar">
<div class="block-title">
<strong id="block-compare-heading" role="heading" aria-level="2"><?= $block->escapeHtml(__('Compare Products')) ?></strong>
<span class="counter qty no-display" data-bind="text: compareProducts().countCaption, css: {'no-display': !compareProducts().count}"></span>
</div>
<!-- ko if: compareProducts().count -->
<div class="block-content no-display" aria-labelledby="block-compare-heading" data-bind="css: {'no-display': !compareProducts().count}">
<ol id="compare-items" class="product-items product-items-names" data-bind="foreach: compareProducts().items">
<li class="product-item">
<input type="hidden" class="compare-item-id" data-bind="value: id"/>
<strong class="product-item-name">
<a data-bind="attr: {href: product_url}, html: name" class="product-item-link"></a>
</strong>
<a href="#"
data-bind="attr: {'data-post': remove_url}"
title="<?= $block->escapeHtmlAttr(__('Remove This Item')) ?>"
class="action delete">
<span><?= $block->escapeHtml(__('Remove This Item')) ?></span>
</a>
</li>
</ol>
<div class="actions-toolbar">
<div class="primary">
<a data-bind="attr: {'href': compareProducts().listUrl}" class="action compare primary"><span><?= $block->escapeHtml(__('Compare')) ?></span></a>
</div>
<div class="secondary">
<a id="compare-clear-all" href="#" class="action clear" data-post="<?=$block->escapeHtml(
$this->helper(Magento\Catalog\Helper\Product\Compare::class)->getPostDataClearList()
) ?>">
<span><?= $block->escapeHtml(__('Clear All')) ?></span>
</a>
</div>
</div>
</div>
<!-- /ko -->
<!-- ko ifnot: compareProducts().count -->
<div class="empty"><?= $block->escapeHtml(__('You have no items to compare.')) ?></div>
<!-- /ko -->
</div>
<script type="text/x-magento-init">
{"[data-role=compare-products-sidebar]": {"Magento_Ui/js/core/app": <?= /* @noEscape */ $block->getJsLayout() ?>}}
</script>
@@ -0,0 +1,60 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
/** @var \Magento\Catalog\Block\Product\Gallery $block */
/** @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */
?>
<?php $_width = $block->getImageWidth(); ?>
<div class="product-image-popup">
<div class="buttons-set"><a href="#" class="button" role="close-window">
<span><?= $block->escapeHtml(__('Close Window')) ?></span></a></div>
<?php if ($block->getPreviousImageUrl() || $block->getNextImageUrl()):?>
<div class="nav">
<?php if ($_prevUrl = $block->getPreviousImageUrl()):?>
<a href="<?= $block->escapeUrl($_prevUrl) ?>"
class="prev">&laquo; <?= $block->escapeHtml(__('Prev')) ?></a>
<?php endif; ?>
<?php if ($_nextUrl = $block->getNextImageUrl()):?>
<a href="<?= $block->escapeUrl($_nextUrl) ?>"
class="next"><?= $block->escapeHtml(__('Next')) ?> &raquo;</a>
<?php endif; ?>
</div>
<?php endif; ?>
<?php if ($_imageTitle = $block->escapeHtml($block->getCurrentImage()->getLabel())):?>
<h1 class="image-label"><?= /* @noEscape */ $_imageTitle ?></h1>
<?php endif; ?>
<?php
$imageUrl = $block->getImageUrl();
?>
<img src="<?= $block->escapeUrl($imageUrl) ?>"
<?php if ($_width):?>
width="<?= /* @noEscape */ $_width ?>"
<?php endif; ?>
alt="<?= $block->escapeHtmlAttr($block->getCurrentImage()->getLabel()) ?>"
title="<?= $block->escapeHtmlAttr($block->getCurrentImage()->getLabel()) ?>"
id="product-gallery-image"
class="image"
data-mage-init='{"catalogGallery":{}}'/>
<div class="buttons-set"><
a href="#" class="button" role="close-window"><span><?= $block->escapeHtml(__('Close Window')) ?></span></a>
</div>
<?php if ($block->getPreviousImageUrl() || $block->getNextImageUrl()):?>
<div class="nav">
<?php if ($_prevUrl = $block->getPreviousImageUrl()):?>
<a href="<?= $block->escapeUrl($_prevUrl) ?>"
class="prev">&laquo; <?= $block->escapeHtml(__('Prev')) ?></a>
<?php endif; ?>
<?php if ($_nextUrl = $block->getNextImageUrl()):?>
<a href="<?= $block->escapeUrl($_nextUrl) ?>"
class="next"><?= $block->escapeHtml(__('Next')) ?> &raquo;</a>
<?php endif; ?>
</div>
<?php endif; ?>
</div>
<?= /* @noEscape */ $secureRenderer->renderStyleAsTag(
'width:' . /* @noEscape */ $_width . 'px;',
'div.product-image-popup'
) ?>
@@ -0,0 +1,20 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
?>
<?php
/** @var $block \Magento\Catalog\Block\Product\Image */
/** @var $escaper \Magento\Framework\Escaper */
?>
<!--deprecated template as image_with_borders is a primary one-->
<img class="photo image <?= $escaper->escapeHtmlAttr($block->getClass()) ?>"
<?php foreach ($block->getCustomAttributes() as $name => $value): ?>
<?= $escaper->escapeHtmlAttr($name) ?>="<?= $escaper->escapeHtml($value) ?>"
<?php endforeach; ?>
src="<?= $escaper->escapeUrl($block->getImageUrl()) ?>"
loading="lazy"
width="<?= $escaper->escapeHtmlAttr($block->getWidth()) ?>"
height="<?= $escaper->escapeHtmlAttr($block->getHeight()) ?>"
alt="<?= $escaper->escapeHtmlAttr($block->getLabel()) ?>" />
@@ -0,0 +1,45 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
?>
<?php
/** @var $block \Magento\Catalog\Block\Product\Image */
/** @var $escaper \Magento\Framework\Escaper */
/** @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */
$width = (int)$block->getWidth();
$height = (int)$block->getHeight();
$paddingBottom = $block->getRatio() * 100;
?>
<span class="product-image-container product-image-container-<?= /* @noEscape */ $block->getProductId() ?>">
<span class="product-image-wrapper">
<img class="<?= $escaper->escapeHtmlAttr($block->getClass()) ?>"
<?php foreach ($block->getCustomAttributes() as $name => $value): ?>
<?= $escaper->escapeHtmlAttr($name) ?>="<?= $escaper->escapeHtml($value) ?>"
<?php endforeach; ?>
src="<?= $escaper->escapeUrl($block->getImageUrl()) ?>"
loading="lazy"
width="<?= $escaper->escapeHtmlAttr($block->getWidth()) ?>"
height="<?= $escaper->escapeHtmlAttr($block->getHeight()) ?>"
alt="<?= $escaper->escapeHtmlAttr($block->getLabel()) ?>"/></span>
</span>
<?php
$styles = <<<STYLE
.product-image-container-{$block->getProductId()} {
width: {$width}px;
height: auto;
aspect-ratio: {$width} / {$height};
}
.product-image-container-{$block->getProductId()} span.product-image-wrapper {
height: 100%;
width: 100%;
}
@supports not (aspect-ratio: auto) {
.product-image-container-{$block->getProductId()} span.product-image-wrapper {
padding-bottom: {$paddingBottom}%;
}
}
STYLE;
?>
<?= /* @noEscape */ $secureRenderer->renderTag('style', [], $styles, false) ?>
@@ -0,0 +1,231 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
use Magento\Framework\App\Action\Action;
?>
<?php
/**
* Product list template
*
* @var $block \Magento\Catalog\Block\Product\ListProduct
* @var \Magento\Framework\Escaper $escaper
* @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer
*/
?>
<?php
$_productCollection = $block->getLoadedProductCollection();
/** @var \Magento\Catalog\Helper\Output $_helper */
$_helper = $block->getData('outputHelper');
/** @var \Esun\Catalog\ViewModel\Category\ProductCard|null $cardViewModel */
$cardViewModel = $block->getData('cardViewModel');
?>
<?= $block->getChildHtml('category_banner') ?>
<?php if (!$_productCollection->count()): ?>
<div class="message info empty">
<div><?= $escaper->escapeHtml(__('We can\'t find products matching the selection.')) ?></div>
</div>
<?php else: ?>
<?= $block->getToolbarHtml() ?>
<?= $block->getAdditionalHtml() ?>
<?php
if ($block->getMode() === 'grid') {
$viewMode = 'grid';
$imageDisplayArea = 'category_page_grid';
$showDescription = false;
$templateType = \Magento\Catalog\Block\Product\ReviewRendererInterface::SHORT_VIEW;
} else {
$viewMode = 'list';
$imageDisplayArea = 'category_page_list';
$showDescription = true;
$templateType = \Magento\Catalog\Block\Product\ReviewRendererInterface::FULL_VIEW;
}
/**
* Position for actions regarding image size changing in vde if needed
*/
$pos = $block->getPositioned();
?>
<div class="products wrapper <?= /* @noEscape */ $viewMode ?> products-<?= /* @noEscape */ $viewMode ?> esun-category-products">
<ol class="products list items product-items">
<?php /** @var $_product \Magento\Catalog\Model\Product */ ?>
<?php foreach ($_productCollection as $_product): ?>
<?php
$colorSwatches = $cardViewModel ? $cardViewModel->getColorSwatches($_product) : [];
$visibleSwatches = array_slice($colorSwatches, 0, 11);
$remainingSwatches = max(0, count($colorSwatches) - count($visibleSwatches));
$categoryLabels = $cardViewModel ? array_slice($cardViewModel->getCategoryLabels($_product), 0, 2) : [];
?>
<li class="item product product-item">
<article class="product-item-info esun-category-card"
id="product-item-info_<?= /* @noEscape */ $_product->getId() ?>"
data-container="product-<?= /* @noEscape */ $viewMode ?>">
<?php
$productImage = $block->getImage($_product, $imageDisplayArea);
if ($pos != null) {
$position = 'left:' . $productImage->getWidth() . 'px;'
. 'top:' . $productImage->getHeight() . 'px;';
}
?>
<?php // Product Image
?>
<a href="<?= $escaper->escapeUrl($_product->getProductUrl()) ?>"
class="product photo product-item-photo esun-category-card__image"
tabindex="-1">
<span class="esun-category-card__badge"><?= $escaper->escapeHtml(__('25% OFF TODAY')) ?></span>
<?= $productImage->toHtml() ?>
</a>
<div class="product details product-item-details esun-category-card__details">
<?php $_productNameStripped = $block->stripTags($_product->getName(), null, true); ?>
<strong class="product name product-item-name esun-category-card__name">
<a class="product-item-link"
href="<?= $escaper->escapeUrl($_product->getProductUrl()) ?>">
<?=/* @noEscape */ $_helper->productAttribute($_product, $_product->getName(), 'name') ?>
</a>
</strong>
<?php if ($categoryLabels): ?>
<div class="esun-category-card__tags">
<?php foreach ($categoryLabels as $categoryLabel): ?>
<span><?= $escaper->escapeHtml($categoryLabel) ?></span>
<?php endforeach; ?>
</div>
<?php endif; ?>
<?php if ($colorSwatches): ?>
<div class="esun-category-card__swatches"
aria-label="<?= $escaper->escapeHtmlAttr(__('Available Colors')) ?>">
<?php foreach ($visibleSwatches as $swatch): ?>
<button class="esun-category-card__swatch"
type="button"
title="<?= $escaper->escapeHtmlAttr($swatch['label']) ?>"
aria-label="<?= $escaper->escapeHtmlAttr($swatch['label']) ?>"
data-product-image="<?= $escaper->escapeUrl($swatch['product_image']) ?>">
<?php if ($swatch['image']): ?>
<img src="<?= $escaper->escapeUrl($swatch['image']) ?>"
alt="<?= $escaper->escapeHtmlAttr($swatch['label']) ?>">
<?php elseif ($swatch['value']): ?>
<span style="background-color: <?= $escaper->escapeHtmlAttr($swatch['value']) ?>"></span>
<?php else: ?>
<span></span>
<?php endif; ?>
</button>
<?php endforeach; ?>
<?php if ($remainingSwatches > 0): ?>
<span class="esun-category-card__swatch-more">
+<?= (int) $remainingSwatches ?>
</span>
<?php endif; ?>
</div>
<?php endif; ?>
<div class="product-item-inner esun-category-card__inner">
<div class="esun-category-card__footer">
<div class="esun-category-card__price">
<?php if ($cardViewModel): ?>
<span class="esun-category-card__final-price">
<?= $escaper->escapeHtml($cardViewModel->getFormattedFinalPrice($_product)) ?>
</span>
<?php if ($cardViewModel->hasRegularPrice($_product)): ?>
<span class="esun-category-card__regular-price">
<?= $escaper->escapeHtml($cardViewModel->getFormattedRegularPrice($_product)) ?>
</span>
<?php endif; ?>
<?php else: ?>
<?= /* @noEscape */ $block->getProductPrice($_product) ?>
<?php endif; ?>
</div>
<div class="product actions product-item-actions">
<div class="actions-primary">
<?php if ($_product->isSaleable()): ?>
<?php $postParams = $block->getAddToCartPostParams($_product); ?>
<form data-role="tocart-form"
data-product-sku="<?= $escaper->escapeHtml($_product->getSku()) ?>"
action="<?= $escaper->escapeUrl($postParams['action']) ?>"
data-mage-init='{"catalogAddToCart": {}}'
method="post">
<?php $options = $block->getData('viewModel')->getOptionsData($_product); ?>
<?php foreach ($options as $optionItem): ?>
<input type="hidden"
name="<?= $escaper->escapeHtml($optionItem['name']) ?>"
value="<?= $escaper->escapeHtml($optionItem['value']) ?>">
<?php endforeach; ?>
<input type="hidden"
name="product"
value="<?= /* @noEscape */ $postParams['data']['product'] ?>">
<input type="hidden"
name="<?= /* @noEscape */ Action::PARAM_NAME_URL_ENCODED ?>"
value="<?=
/* @noEscape */ $postParams['data'][Action::PARAM_NAME_URL_ENCODED]
?>">
<?= $block->getBlockHtml('formkey') ?>
<button type="submit"
title="<?= $escaper->escapeHtmlAttr(__('Add to Cart')) ?>"
class="action tocart primary esun-category-card__cart">
<svg viewBox="0 0 24 24" aria-hidden="true">
<path d="M3 4h2l2.2 10.2a2 2 0 0 0 2 1.6h7.7a2 2 0 0 0 2-1.6L20 8H7M10 20a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm8 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z" />
</svg>
<span><?= $escaper->escapeHtml(__('Add to Cart')) ?></span>
</button>
</form>
<?php else: ?>
<?php if ($_product->isAvailable()): ?>
<div class="stock available">
<span><?= $escaper->escapeHtml(__('In stock')) ?></span>
</div>
<?php else: ?>
<div class="stock unavailable">
<span><?= $escaper->escapeHtml(__('Out of stock')) ?></span>
</div>
<?php endif; ?>
<?php endif; ?>
</div>
<?= ($pos && strpos($pos, $viewMode . '-primary')) ?
/* @noEscape */ $secureRenderer->renderStyleAsTag(
$position,
'product-item-info_' . $_product->getId() . ' div.actions-primary'
) : '' ?>
<div data-role="add-to-links" class="actions-secondary"></div>
<?= ($pos && strpos($pos, $viewMode . '-secondary')) ?
/* @noEscape */ $secureRenderer->renderStyleAsTag(
$position,
'product-item-info_' . $_product->getId() . ' div.actions-secondary'
) : '' ?>
</div>
</div>
<?php if ($showDescription): ?>
<div class="product description product-item-description">
<?= /* @noEscape */ $_helper->productAttribute(
$_product,
$_product->getShortDescription(),
'short_description'
) ?>
<a href="<?= $escaper->escapeUrl($_product->getProductUrl()) ?>"
title="<?= /* @noEscape */ $_productNameStripped ?>"
class="action more"><?= $escaper->escapeHtml(__('Learn More')) ?></a>
</div>
<?php endif; ?>
</div>
</div>
</article>
<?= ($pos && strpos($pos, $viewMode . '-actions')) ?
/* @noEscape */ $secureRenderer->renderStyleAsTag(
$position,
'product-item-info_' . $_product->getId() . ' div.product-item-actions'
) : '' ?>
</li>
<?php endforeach; ?>
</ol>
</div>
<script type="text/x-magento-init">
{
".esun-category-products": {
"esunCategoryCard": {}
}
}
</script>
<?= $block->getChildBlock('toolbar')->setIsBottom(true)->toHtml() ?>
<?php // phpcs:ignore Magento2.Legacy.PhtmlTemplate
?>
<?php endif; ?>
@@ -0,0 +1,16 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
/** @var $block Magento\Catalog\Block\Product\ProductList\Item\AddTo\Compare */
?>
<a href="#"
class="action tocompare"
title="<?= $block->escapeHtml(__('Add to Compare')) ?>"
aria-label="<?= $block->escapeHtml(__('Add to Compare')) ?>"
data-post='<?= /* @noEscape */ $block->getCompareHelper()->getPostDataParams($block->getProduct()) ?>'
role="button">
<span><?= $block->escapeHtml(__('Add to Compare')) ?></span>
</a>
@@ -0,0 +1,333 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
use Magento\Catalog\ViewModel\Product\Listing\PreparePostData;
use Magento\Framework\App\ActionInterface;
/* @var $block \Magento\Catalog\Block\Product\AbstractProduct */
/** @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */
?>
<?php
switch ($type = $block->getType()) {
case 'related-rule':
if ($exist = $block->hasItems()) {
$type = 'related';
$class = $type;
$image = 'related_products_list';
$title = __('Related Products');
$items = $block->getAllItems();
$limit = $block->getPositionLimit();
$shuffle = (int) $block->isShuffled();
$isWeightedRandom = (int) $block->getRotation()->isWeightedRandom($block->getProductListType());
$canItemsAddToCart = $block->canItemsAddToCart();
$showAddTo = true;
$showCart = false;
$templateType = null;
$description = false;
}
break;
case 'related':
/** @var \Magento\Catalog\Block\Product\ProductList\Related $block */
if ($exist = $block->getItems()->getSize()) {
$type = 'related';
$class = $type;
$image = 'related_products_list';
$title = __('Related Products');
$items = $block->getItems();
$limit = 0;
$shuffle = 0;
$isWeightedRandom = 0;
$canItemsAddToCart = $block->canItemsAddToCart();
$showAddTo = true;
$showCart = false;
$templateType = null;
$description = false;
}
break;
case 'upsell-rule':
if ($exist = $block->hasItems()) {
$type = 'upsell';
$class = $type;
$image = 'upsell_products_list';
$title = __('We found other products you might like!');
$items = $block->getAllItems();
$limit = $block->getPositionLimit();
$shuffle = (int) $block->isShuffled();
$isWeightedRandom = (int) $block->getRotation()->isWeightedRandom($block->getProductListType());
$showAddTo = false;
$showCart = false;
$templateType = null;
$description = false;
$canItemsAddToCart = false;
}
break;
case 'upsell':
/** @var \Magento\Catalog\Block\Product\ProductList\Upsell $block */
if ($exist = count($block->getItemCollection()->getItems())) {
$type = 'upsell';
$class = $type;
$image = 'upsell_products_list';
$title = __('We found other products you might like!');
$items = $block->getItemCollection()->getItems();
$limit = $block->getItemLimit('upsell');
$shuffle = 0;
$isWeightedRandom = 0;
$showAddTo = false;
$showCart = false;
$templateType = null;
$description = false;
$canItemsAddToCart = false;
}
break;
case 'crosssell-rule':
/** @var \Magento\Catalog\Block\Product\ProductList\Crosssell $block */
if ($exist = $block->hasItems()) {
$type = 'crosssell';
$class = $type;
$image = 'cart_cross_sell_products';
$title = __('More Choices:');
$items = $block->getItemCollection();
$showAddTo = true;
$showCart = true;
$templateType = \Magento\Catalog\Block\Product\ReviewRendererInterface::SHORT_VIEW;
$description = false;
$canItemsAddToCart = false;
}
break;
case 'crosssell':
/** @var \Magento\Catalog\Block\Product\ProductList\Crosssell $block */
if ($exist = count($block->getItems())) {
$type = 'crosssell';
$class = $type;
$image = 'cart_cross_sell_products';
$title = __('More Choices:');
$items = $block->getItems();
$showAddTo = true;
$showCart = true;
$templateType = \Magento\Catalog\Block\Product\ReviewRendererInterface::SHORT_VIEW;
$description = false;
$canItemsAddToCart = false;
}
break;
case 'new':
if ($exist = $block->getProductCollection()) {
$type = 'new';
$mode = 'grid';
$type = $type . ' ' . $mode;
$class = 'widget' . ' ' . $type;
$image = 'new_products_content_widget_grid';
$title = __('New Products');
$items = $exist;
$showAddTo = true;
$showCart = true;
$templateType = \Magento\Catalog\Block\Product\ReviewRendererInterface::SHORT_VIEW;
$description = ($mode == 'list') ? true : false;
$canItemsAddToCart = false;
}
break;
default:
$exist = null;
}
$_item = null;
?>
<?php if ($exist):?>
<?php if ($type == 'related' || $type == 'upsell'):?>
<?php if ($type == 'related'):?>
<div class="block <?= $block->escapeHtmlAttr($class) ?>"
data-mage-init='{"relatedProducts":{"relatedCheckbox":".related.checkbox"}}'
data-limit="<?= $block->escapeHtmlAttr($limit) ?>"
data-shuffle="<?= /* @noEscape */ $shuffle ?>"
data-shuffle-weighted="<?= /* @noEscape */ $isWeightedRandom ?>">
<?php else:?>
<div class="block <?= $block->escapeHtmlAttr($class) ?>"
data-mage-init='{"upsellProducts":{}}'
data-limit="<?= $block->escapeHtmlAttr($limit) ?>"
data-shuffle="<?= /* @noEscape */ $shuffle ?>"
data-shuffle-weighted="<?= /* @noEscape */ $isWeightedRandom ?>">
<?php endif; ?>
<?php else:?>
<div class="block <?= $block->escapeHtmlAttr($class) ?>">
<?php endif; ?>
<div class="block-title title">
<strong id="block-<?= $block->escapeHtmlAttr($class) ?>-heading" role="heading"
aria-level="2"><?= $block->escapeHtml($title) ?></strong>
</div>
<div class="block-content content" aria-labelledby="block-<?= $block->escapeHtmlAttr($class) ?>-heading">
<?php if ($type == 'related' && $canItemsAddToCart):?>
<div class="block-actions">
<?= $block->escapeHtml(__('Check items to add to the cart or')) ?>
<button type="button" class="action select"
data-role="select-all"><span><?= $block->escapeHtml(__('select all')) ?></span></button>
</div>
<?php endif; ?>
<div class="products wrapper grid products-grid products-<?= $block->escapeHtmlAttr($type) ?>">
<ol class="products list items product-items">
<?php foreach ($items as $_item):?>
<?php $available = ''; ?>
<?php if (!$_item->isComposite() && $_item->isSaleable() && $type == 'related'):?>
<?php if (!$_item->getRequiredOptions()):?>
<?php $available = 'related-available'; ?>
<?php endif; ?>
<?php endif; ?>
<?php if ($type == 'related' || $type == 'upsell'):?>
<li class="item product product-item"
id="product-item_<?= /* @noEscape */ $_item->getId() ?>"
data-shuffle-group="<?= $block->escapeHtmlAttr($_item->getPriority()) ?>" >
<?= /* @noEscape */ $secureRenderer->renderStyleAsTag(
'display:none;',
'li#product-item_' . $_item->getId()
) ?>
<?php else:?>
<li class="item product product-item">
<?php endif; ?>
<div class="product-item-info <?= /* @noEscape */ $available ?>">
<?= /* @noEscape */ '<!-- ' . $image . '-->' ?>
<a href="<?= $block->escapeUrl($block->getProductUrl($_item)) ?>"
class="product photo product-item-photo">
<?= $block->getImage($_item, $image)->toHtml() ?>
</a>
<div class="product details product-item-details">
<strong class="product name product-item-name"><a
class="product-item-link"
title="<?= $block->escapeHtmlAttr($_item->getName()) ?>"
href="<?= $block->escapeUrl($block->getProductUrl($_item)) ?>">
<?= $block->escapeHtml($_item->getName()) ?></a>
</strong>
<?= /* @noEscape */ $block->getProductPrice($_item) ?>
<?php if ($templateType):?>
<?= $block->getReviewsSummaryHtml($_item, $templateType) ?>
<?php endif; ?>
<?php if ($canItemsAddToCart && !$_item->isComposite() && $_item->isSaleable()
&& $type == 'related'):?>
<?php if (!$_item->getRequiredOptions()):?>
<div class="field choice related">
<input
type="checkbox"
class="checkbox related"
id="related-checkbox<?= $block->escapeHtmlAttr($_item->getId()) ?>"
name="related_products[]"
value="<?= $block->escapeHtmlAttr($_item->getId()) ?>" />
<label class="label"
for="related-checkbox<?= $block->escapeHtmlAttr($_item->getId())
?>"><span><?= $block->escapeHtml(__('Add to Cart')) ?></span>
</label>
</div>
<?php endif; ?>
<?php endif; ?>
<?php if ($showAddTo || $showCart):?>
<?php // phpcs:disable ?>
<div class="product actions product-item-actions">
<?php if ($showCart):?>
<div class="actions-primary">
<?php if ($_item->isSaleable()):?>
<?php if (!$_item->getTypeInstance()->isPossibleBuyFromList($_item)):?>
<button
class="action tocart primary"
data-mage-init='{"redirectUrl": {"url": "<?= $block->escapeUrl($block->getAddToCartUrl($_item)) ?>"}}' type="button" title="<?= $block->escapeHtmlAttr(__('Add to Cart')) ?>">
<span><?= $block->escapeHtml(__('Add to Cart')) ?></span>
</button>
<?php else :?>
<?php
/** @var $viewModel PreparePostData */
$viewModel = $block->getViewModel();
$postArray = $viewModel->getPostData(
$block->escapeUrl($block->getAddToCartUrl($_item)),
['product' => $_item->getEntityId()]
);
$value = $postArray['data'][ActionInterface::PARAM_NAME_URL_ENCODED];
?>
<form data-role="tocart-form"
data-product-sku="<?= $block->escapeHtmlAttr($_item->getSku()) ?>"
action="<?= $block->escapeUrl($block->getAddToCartUrl($_item)) ?>"
method="post">
<input type="hidden" name="product"
value="<?= /* @noEscape */ (int)$_item->getEntityId() ?>">
<input type="hidden"
name="<?= /* @noEscape */ ActionInterface::PARAM_NAME_URL_ENCODED?>"
value="<?= /* @noEscape */ $value ?>">
<?= $block->getBlockHtml('formkey') ?>
<button type="submit"
title="<?= $block->escapeHtmlAttr(__('Add to Cart')) ?>"
class="action tocart primary">
<span><?= $block->escapeHtml(__('Add to Cart')) ?></span>
</button>
</form>
<?php endif; ?>
<?php else:?>
<?php if ($_item->isAvailable()):?>
<div class="stock available">
<span><?= $block->escapeHtml(__('In stock')) ?></span>
</div>
<?php else:?>
<div class="stock unavailable">
<span><?= $block->escapeHtml(__('Out of stock')) ?></span>
</div>
<?php endif; ?>
<?php endif; ?>
</div>
<?php endif; ?>
<?php if ($showAddTo):?>
<div class="secondary-addto-links actions-secondary"
data-role="add-to-links">
<?php if ($addToBlock = $block->getChildBlock('addto')):?>
<?= $addToBlock->setProduct($_item)->getChildHtml() ?>
<?php endif; ?>
</div>
<?php endif; ?>
</div>
<?php // phpcs:enable ?>
<?php endif; ?>
</div>
</div>
</li>
<?php endforeach ?>
</ol>
</div>
</div>
</div>
<?php if (!$block->isRedirectToCartEnabled() && $_item):?>
<script type="text/x-magento-init">
{
"[data-role=tocart-form], .form.map.checkout": {
"catalogAddToCart": {
"product_sku": "<?= $block->escapeJs($_item->getSku()) ?>"
}
}
}
</script>
<?php endif;?>
<?php endif;?>
@@ -0,0 +1,40 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
?>
<?php
/**
* Product list toolbar
*
* @var $block \Magento\Catalog\Block\Product\ProductList\Toolbar
*/
?>
<?php if ($block->getCollection()->getSize()) :?>
<?php $widget = $this->helper(\Magento\Framework\Json\Helper\Data::class)->jsonDecode($block->getWidgetOptionsJson());
$widgetOptions = $this->helper(\Magento\Framework\Json\Helper\Data::class)->jsonEncode($widget['productListToolbarForm']);
$isInStock = (string) $block->getRequest()->getParam('in_stock') === '1';
?>
<div class="toolbar toolbar-products" data-mage-init='{"productListToolbarForm":<?= /* @noEscape */ $widgetOptions ?>}'>
<?php if ($block->getIsBottom()): ?>
<?= $block->getPagerHtml() ?>
<?php else: ?>
<div class="esun-category-toolbar__amount">
<?= $block->fetchView($block->getTemplateFile('Magento_Catalog::product/list/toolbar/amount.phtml')) ?>
</div>
<div class="esun-category-toolbar__controls">
<?php if ($block->isExpanded()): ?>
<?= $block->fetchView($block->getTemplateFile('Magento_Catalog::product/list/toolbar/sorter.phtml')) ?>
<?php endif ?>
<a class="esun-stock-toggle<?= $isInStock ? ' is-active' : '' ?>"
href="<?= $block->escapeUrl($block->getPagerUrl(['in_stock' => $isInStock ? null : 1, 'p' => null])) ?>"
role="switch"
aria-checked="<?= $isInStock ? 'true' : 'false' ?>">
<span class="esun-stock-toggle__track" aria-hidden="true"></span>
<span class="esun-stock-toggle__label"><?= $block->escapeHtml(__('In Stock')) ?></span>
</a>
</div>
<?php endif ?>
</div>
<?php endif ?>
@@ -0,0 +1,18 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
?>
<?php
/**
* Product list toolbar
*
* @var \Magento\Catalog\Block\Product\ProductList\Toolbar $block
* @var \Magento\Framework\Locale\LocaleFormatter $localeFormatter
*/
?>
<p class="toolbar-amount" id="toolbar-amount">
<?= $block->escapeHtml(__('All Result')) ?>
<span class="toolbar-number">(<?= $block->escapeHtml($localeFormatter->formatNumber($block->getTotalNum())) ?>)</span>
</p>
@@ -0,0 +1,34 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
?>
<?php
/**
* Product list toolbar
*
* @var \Magento\Catalog\Block\Product\ProductList\Toolbar $block
* @var \Magento\Framework\Locale\LocaleFormatter $localeFormatter
*/
?>
<div class="field limiter">
<label class="label" for="limiter">
<span><?= $block->escapeHtml(__('Show')) ?></span>
</label>
<div class="control">
<select id="limiter" data-role="limiter" class="limiter-options">
<?php foreach ($block->getAvailableLimit() as $_key => $_limit):?>
<option value="<?= $block->escapeHtmlAttr($_key) ?>"
<?php if ($block->isLimitCurrent($_key)):?>
selected="selected"
<?php endif ?>>
<?= $block->escapeHtml(
is_numeric($_limit) ? $localeFormatter->formatNumber((int) $_limit) : $_limit
) ?>
</option>
<?php endforeach; ?>
</select>
</div>
<span class="limiter-text"><?= $block->escapeHtml(__('per page')) ?></span>
</div>
@@ -0,0 +1,44 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
?>
<?php
/**
* Product list toolbar
*
* @var $block \Magento\Catalog\Block\Product\ProductList\Toolbar
*/
?>
<div class="toolbar-sorter sorter">
<label class="sorter-label" for="sorter"><?= $block->escapeHtml(__('Sort By')) ?></label>
<select id="sorter" data-role="sorter" class="sorter-options">
<?php foreach ($block->getAvailableOrders() as $_key => $_order) :?>
<option value="<?= $block->escapeHtmlAttr($_key) ?>"
<?php if ($block->isOrderCurrent($_key)) :?>
selected="selected"
<?php endif; ?>
>
<?= $block->escapeHtml($_key === $block->getCurrentOrder() && $_key === 'position' ? __('Hot Sale') : __($_order)) ?>
</option>
<?php endforeach; ?>
</select>
<?php if ($block->getCurrentDirection() == 'desc') :?>
<a title="<?= $block->escapeHtmlAttr(__('Set Ascending Direction')) ?>"
href="#"
class="action sorter-action sort-desc"
data-role="direction-switcher"
data-value="asc">
<span><?= $block->escapeHtml(__('Set Ascending Direction')) ?></span>
</a>
<?php else :?>
<a title="<?= $block->escapeHtmlAttr(__('Set Descending Direction')) ?>"
href="#"
class="action sorter-action sort-asc"
data-role="direction-switcher"
data-value="desc">
<span><?= $block->escapeHtml(__('Set Descending Direction')) ?></span>
</a>
<?php endif; ?>
</div>
@@ -0,0 +1,40 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
?>
<?php
/**
* Product list toolbar
*
* @var $block \Magento\Catalog\Block\Product\ProductList\Toolbar
*/
?>
<?php if ($block->isEnabledViewSwitcher()) :?>
<div class="modes">
<?php $_modes = $block->getModes(); ?>
<?php if ($_modes && count($_modes) > 1) :?>
<strong class="modes-label" id="modes-label"><?= $block->escapeHtml(__('View as')) ?></strong>
<?php foreach ($block->getModes() as $_code => $_label) :?>
<?php if ($block->isModeActive($_code)) :?>
<strong title="<?= $block->escapeHtmlAttr($_label) ?>"
class="modes-mode active mode-<?= $block->escapeHtmlAttr(strtolower($_code)) ?>"
data-value="<?= $block->escapeHtmlAttr(strtolower($_code)) ?>">
<span><?= $block->escapeHtml($_label) ?></span>
</strong>
<?php else :?>
<a class="modes-mode mode-<?= $block->escapeHtmlAttr(strtolower($_code)) ?>"
title="<?= $block->escapeHtmlAttr($_label) ?>"
href="#"
data-role="mode-switcher"
data-value="<?= $block->escapeHtmlAttr(strtolower($_code)) ?>"
id="mode-<?= $block->escapeHtmlAttr(strtolower($_code)) ?>"
aria-labelledby="modes-label mode-<?= $block->escapeHtmlAttr(strtolower($_code)) ?>">
<span><?= $block->escapeHtml($_label) ?></span>
</a>
<?php endif; ?>
<?php endforeach; ?>
<?php endif; ?>
</div>
<?php endif; ?>
@@ -0,0 +1,11 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
/** @var $block \Magento\Catalog\Block\Product\View\Additional */
?>
<?php foreach ($block->getChildHtmlList() as $_html) :?>
<?= /* @noEscape */ $_html ?>
<?php endforeach; ?>
@@ -0,0 +1,11 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
/** @var $block \Magento\Catalog\Block\Product\View*/
?>
<div class="product-addto-links" data-role="add-to-links">
<?= $block->getChildHtml() ?>
</div>
@@ -0,0 +1,16 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
/** @var $block \Magento\Catalog\Block\Product\View\Addto\Compare */
?>
<?php $viewModel = $block->getData('addToCompareViewModel'); ?>
<?php if ($viewModel->isAvailableForCompare($block->getProduct())) :?>
<a href="#" data-post='<?= /* @noEscape */ $block->getPostDataParams() ?>'
data-role="add-to-links"
class="action tocompare"><span><?= $block->escapeHtml(__('Add to Compare')) ?></span></a>
<?php endif; ?>
@@ -0,0 +1,148 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
/** @var $block \Magento\Catalog\Block\Product\View */
?>
<?php $_product = $block->getProduct(); ?>
<?php $buttonTitle = __('Add to Cart'); ?>
<?php $defaultQty = $block->getProductDefaultQty() * 1; ?>
<?php $quantityValidators = $block->getQuantityValidators(); ?>
<?php $quantityValidators['validate-item-quantity']['minAllowed'] = $defaultQty; ?>
<?php
$purchaseBlock = $block->getLayout()
->createBlock(\Esun\Catalog\Block\Product\PurchaseProgress::class)
->setData('initial_qty', $defaultQty)
->setTemplate('Esun_Catalog::product/purchase-progress.phtml');
$purchaseConfig = $purchaseBlock->getConfig();
$mixEnabled = !empty($purchaseConfig['mixEnabled']);
$displayQty = $mixEnabled ? 0 : $defaultQty;
$minimumQty = $mixEnabled ? 0 : $defaultQty;
if ($mixEnabled) {
unset($quantityValidators['validate-item-quantity']);
$quantityValidators['validate-digits'] = true;
$quantityValidators['validate-zero-or-greater'] = true;
} else {
$quantityValidators['validate-item-quantity']['minAllowed'] = $minimumQty;
}
?>
<?php if ($_product->isSaleable()) : ?>
<?= /* @noEscape */ $purchaseBlock->toHtml() ?>
<div class="box-tocart">
<div class="fieldset">
<?php if ($block->shouldRenderQuantity()) : ?>
<div class="field qty">
<label class="label" for="qty"><span><?= $block->escapeHtml(__('Qty')) ?></span></label>
<div class="control">
<div class="esun-qty-stepper">
<button type="button" class="esun-qty-btn esun-qty-btn-minus" data-role="qty-minus" aria-label="<?= $block->escapeHtmlAttr(__('Decrease Quantity')) ?>">&minus;</button>
<input type="number"
name="qty"
id="qty"
min="<?= $block->escapeHtmlAttr((string)$minimumQty) ?>"
value="<?= $block->escapeHtmlAttr((string)$displayQty) ?>"
title="<?= $block->escapeHtmlAttr(__('Qty')) ?>"
class="input-text qty"
data-validate="<?= $block->escapeHtml(json_encode($quantityValidators)) ?>" />
<button type="button" class="esun-qty-btn esun-qty-btn-plus" data-role="qty-plus" aria-label="<?= $block->escapeHtmlAttr(__('Increase Quantity')) ?>">&plus;</button>
</div>
</div>
</div>
<?php endif; ?>
<div class="actions esun-product-actions">
<button type="submit"
title="<?= $block->escapeHtmlAttr($mixEnabled ? __('Add Mix to Cart') : $buttonTitle) ?>"
class="action primary tocart"
id="product-addtocart-button" disabled>
<span><?= $block->escapeHtml($mixEnabled ? __('Add Mix to Cart') : $buttonTitle) ?></span>
</button>
<?= $block->getChildHtml('', true) ?>
</div>
</div>
<?php if (!$mixEnabled): ?>
<div class="esun-buy-now-row">
<button type="button"
title="<?= $block->escapeHtmlAttr(__('Buy Now')) ?>"
class="action primary esun-buy-now"
data-role="esun-buy-now">
<span><?= $block->escapeHtml(__('Buy Now')) ?></span>
</button>
</div>
<?php endif; ?>
</div>
<?php endif; ?>
<script type="text/x-magento-init">
{
"#product_addtocart_form": {
"Esun_Catalog/js/product-direct-submit": {}
},
"#qty": {
"Esun_Catalog/js/qty-stepper": {}
},
"[data-role=esun-buy-now]": {
"Esun_Catalog/js/buy-now": {
"formSelector": "#product_addtocart_form",
"checkoutUrl": "<?= $block->escapeUrl($block->getUrl('checkout')) ?>"
}
},
"body.catalog-product-view": {
"Esun_Catalog/js/product-sticky-actions": {
"sourceSelector": ".product-info-main .box-tocart",
"priceSelector": "[data-role='purchase-final-total']",
"addToCartSelector": "#product-addtocart-button",
"buyNowSelector": "[data-role='esun-buy-now']",
"anchorScopeSelector": ".column.main",
"anchors": [
{
"label": "Overview",
"selectors": ["#overview", ".product-overview-content", "[data-anchor='overview']"],
"aliases": ["Overview", "Product Overview", "Basic Information"]
},
{
"label": "Industry Applications",
"selectors": ["#industry-applications", ".industry-applications", "[data-anchor='industry-applications']"],
"aliases": ["Industry Applications"]
},
{
"label": "Gallery",
"selectors": ["#detail-gallery", ".detail-gallery", "[data-anchor='gallery']"],
"aliases": ["Gallery"]
},
{
"label": "Creative Videos",
"selectors": ["#creative-videos", ".creative-videos", "[data-anchor='creative-videos']"],
"aliases": ["Create Anything You Imagining", "Creative Videos"]
},
{
"label": "Printing Parameter",
"selectors": ["#printing-parameter", ".printing-parameter", "[data-anchor='printing-parameter']"],
"aliases": ["Printing Parameter", "Print Parameter", "Printing Parameters"]
},
{
"label": "Download",
"selectors": ["#download", ".download", ".downloads", "[data-anchor='download']"],
"aliases": ["Download", "Downloads"]
},
{
"label": "Available Colors",
"selectors": ["#available-colors", ".available-colors", "[data-anchor='available-colors']"],
"aliases": ["Available Colors", "Colors"]
},
{
"label": "FAQ",
"selectors": ["#faq", ".faq", "[data-anchor='faq']"],
"aliases": ["FAQ", "FAQs"]
},
{
"label": "Customer Reviews",
"selectors": ["#reviews", ".customer-reviews", ".review-form"],
"aliases": ["Customer Reviews", "Reviews"]
}
]
}
}
}
</script>
@@ -0,0 +1,55 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
// phpcs:disable Magento2.Templates.ThisInTemplate.FoundThis
/**
* Product view template
*
* @var $block \Magento\Catalog\Block\Product\View\Description
*/
?>
<?php
$_helper = $this->helper(Magento\Catalog\Helper\Output::class);
$_product = $block->getProduct();
if (!$_product instanceof \Magento\Catalog\Model\Product) {
return;
}
$_call = $block->getAtCall();
$_code = $block->getAtCode();
$_className = $block->getCssClass();
$_attributeLabel = $block->getAtLabel();
$_attributeType = $block->getAtType();
$_attributeAddAttribute = $block->getAddAttribute();
$renderLabel = true;
// if defined as 'none' in layout, do not render
if ($_attributeLabel == 'none') {
$renderLabel = false;
}
if ($_attributeLabel && $_attributeLabel == 'default') {
$_attributeLabel = $_product->getResource()->getAttribute($_code)->getStoreLabel();
}
if ($_attributeType && $_attributeType == 'text') {
$_attributeValue = ($_helper->productAttribute($_product, $_product->$_call(), $_code))
? $_product->getAttributeText($_code)
: '';
} else {
$_attributeValue = $_helper->productAttribute($_product, $_product->$_call(), $_code);
}
?>
<?php if ($_attributeValue) :?>
<div class="product attribute <?= $block->escapeHtmlAttr($_className) ?>">
<?php if ($renderLabel) :?>
<strong class="type"><?= $block->escapeHtml($_attributeLabel) ?></strong>
<?php endif; ?>
<div class="value" <?= /* @noEscape */ $_attributeAddAttribute ?>><?= /* @noEscape */ $_attributeValue ?></div>
</div>
<?php endif; ?>
@@ -0,0 +1,33 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
// phpcs:disable Magento2.Templates.ThisInTemplate.FoundThis
/**
* Product additional attributes template
*
* @var $block \Magento\Catalog\Block\Product\View\Attributes
*/
?>
<?php
$_helper = $this->helper(Magento\Catalog\Helper\Output::class);
$_product = $block->getProduct();
?>
<?php if ($_additional = $block->getAdditionalData()) :?>
<div class="additional-attributes-wrapper table-wrapper">
<table class="data table additional-attributes" id="product-attribute-specs-table">
<caption class="table-caption"><?= $block->escapeHtml(__('More Information')) ?></caption>
<tbody>
<?php foreach ($_additional as $_data) :?>
<tr>
<th class="col label" scope="row"><?= $block->escapeHtml($_data['label']) ?></th>
<td class="col data" data-th="<?= $block->escapeHtmlAttr($_data['label']) ?>"><?= /* @noEscape */ $_helper->productAttribute($_product, $_data['value'], $_data['code']) ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<?php endif;?>
@@ -0,0 +1,20 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
/**
* Product viewed counter template
*
* @var $block \Magento\Catalog\Block\Ui\ProductViewCounter
*/
?>
<script type="text/x-magento-init">
{
"*": {
"Magento_Catalog/js/product/view/provider": {
"data": <?= /* @noEscape */ $block->getCurrentProductData() ?>
}
}
}
</script>
@@ -0,0 +1,19 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
// phpcs:disable Magento2.Templates.ThisInTemplate.FoundThis
/**
* Product description template
*
* @var $block \Magento\Catalog\Block\Product\View\Description
*/
?>
<?= /* @noEscape */ $this->helper(Magento\Catalog\Helper\Output::class)->productAttribute(
$block->getProduct(),
$block->getProduct()->getDescription(),
'description'
) ?>
@@ -0,0 +1,52 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
/** @var \Magento\Catalog\Block\Product\View\Details $block */
/** @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */
?>
<?php if ($detailedInfoGroup = $block->getGroupSortedChildNames('detailed_info', 'getChildHtml')):?>
<div class="product info detailed">
<?php $layout = $block->getLayout(); ?>
<div class="product data items" data-mage-init='{"tabs":{"openedState":"active"}}'>
<?php $hideTabContent = false; ?>
<?php foreach ($detailedInfoGroup as $name):?>
<?php
$html = $layout->renderElement($name);
if (!$html || !trim($html)) {
continue;
}
$alias = $layout->getElementAlias($name);
if (in_array($alias, ['description', 'additional', 'reviews'], true)) {
continue;
}
$label = $block->getChildData($alias, 'title');
?>
<div class="data item title <?= !$hideTabContent ? 'active' : ''?>"
data-role="collapsible" id="tab-label-<?= $block->escapeHtmlAttr($alias) ?>">
<a class="data switch"
tabindex="-1"
data-toggle="trigger"
href="#<?= $block->escapeUrl($alias) ?>"
id="tab-label-<?= $block->escapeHtmlAttr($alias) ?>-title">
<?= /* @noEscape */ $label ?>
</a>
</div>
<div class="data item content"
aria-labelledby="tab-label-<?= $block->escapeHtmlAttr($alias) ?>-title"
id="<?= $block->escapeHtmlAttr($alias) ?>" data-role="content">
<?= /* @noEscape */ $html ?>
</div>
<?= $hideTabContent
? /* @noEscape */ $secureRenderer->renderStyleAsTag(
'display: none;',
'#' . $block->escapeHtmlAttr($alias)
)
: '' ?>
<?php $hideTabContent = true; ?>
<?php endforeach;?>
</div>
</div>
<?php endif; ?>
@@ -0,0 +1,52 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
// phpcs:disable Magento2.Templates.ThisInTemplate.FoundThis
/**
* Product view template
*
* @var $block \Magento\Catalog\Block\Product\View
*/
?>
<?php $_helper = $this->helper(Magento\Catalog\Helper\Output::class); ?>
<?php $_product = $block->getProduct(); ?>
<div class="product-add-form">
<form data-product-sku="<?= $block->escapeHtml($_product->getSku()) ?>"
action="<?= $block->escapeUrl($block->getSubmitUrl($_product)) ?>" method="post"
id="product_addtocart_form"<?php if ($_product->getOptions()) :?> enctype="multipart/form-data"<?php endif; ?>>
<input type="hidden" name="product" value="<?= (int)$_product->getId() ?>" />
<input type="hidden" name="selected_configurable_option" value="" />
<input type="hidden" name="related_product" id="related-products-field" value="" />
<input type="hidden" name="return_url" value="<?= $block->escapeUrl($block->getUrl('*/*/*', ['_current' => true, '_use_rewrite' => true])) ?>" />
<input type="hidden" name="item" value="<?= (int)$block->getRequest()->getParam('id') ?>" />
<?= $block->getBlockHtml('formkey') ?>
<?= $block->getChildHtml('form_top') ?>
<?php if (!$block->hasOptions()) :?>
<?= $block->getChildHtml('product_info_form_content') ?>
<?php else :?>
<?php if ($_product->isSaleable() && $block->getOptionsContainer() == 'container1') :?>
<?= $block->getChildChildHtml('options_container') ?>
<?php endif;?>
<?php endif; ?>
<?php if ($_product->isSaleable() && $block->hasOptions() && $block->getOptionsContainer() == 'container2') :?>
<?= $block->getChildChildHtml('options_container') ?>
<?php endif;?>
<?= $block->getChildHtml('form_bottom') ?>
</form>
</div>
<script type="text/x-magento-init">
{
"[data-role=priceBox][data-price-box=product-id-<?= $block->escapeHtml($_product->getId()) ?>]": {
"priceBox": {
"priceConfig": <?= /* @noEscape */ $block->getJsonConfig() ?>
}
}
}
</script>
@@ -0,0 +1,58 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
/**
* Product media data template
*
* @var $block \Magento\Catalog\Block\Product\View\Gallery
* @var $escaper \Magento\Framework\Escaper
*/
?>
<?php
$images = $block->getGalleryImages()->getItems();
$mainImage = current(array_filter($images, function ($img) use ($block) {
return $block->isMainImage($img);
}));
if (!empty($images) && empty($mainImage)) {
$mainImage = $block->getGalleryImages()->getFirstItem();
}
$helper = $block->getData('imageHelper');
$mainImageData = $mainImage ?
$mainImage->getData('medium_image_url') :
$helper->getDefaultPlaceholderUrl('image');
$imageWidth = $block->getImageAttribute('product_page_image_medium', 'width');
$imageHeight = $block->getImageAttribute('product_page_image_medium', 'height');
?>
<div class="gallery-placeholder _block-content-loading" data-gallery-role="gallery-placeholder">
<img
alt="main product photo"
class="gallery-placeholder__image"
src="<?= /* @noEscape */ $mainImageData ?>"
<?= $imageWidth ? 'width="'. $escaper->escapeHtmlAttr($imageWidth) .'"' : '' ?>
<?= $imageHeight ? 'height="'. $escaper->escapeHtmlAttr($imageHeight) .'"' : '' ?>
/>
<link itemprop="image" href="<?= /* @noEscape */ $mainImageData ?>">
</div>
<?php // phpcs:ignore Magento2.Legacy.PhtmlTemplate ?>
<script type="text/x-magento-init">
{
"[data-gallery-role=gallery-placeholder]": {
"mage/gallery/gallery": {
"mixins":["magnifier/magnify"],
"magnifierOpts": <?= /* @noEscape */ $block->getMagnifier() ?>,
"data": <?= /* @noEscape */ $block->getGalleryImagesJson() ?>,
"options": <?= /* @noEscape */ $block->getGalleryOptions()->getOptionsJson() ?>,
"fullscreen": <?= /* @noEscape */ $block->getGalleryOptions()->getFSOptionsJson() ?>,
"breakpoints": <?= /* @noEscape */ $block->getBreakpoints() ?>
}
}
}
</script>
@@ -0,0 +1,13 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
// phpcs:disable Magento2.Templates.ThisInTemplate.FoundThis
?>
<?php $_product = $block->getProduct() ?>
<?php if ($block->canEmailToFriend()) :?>
<a href="<?= $block->escapeUrl($this->helper(Magento\Catalog\Helper\Product::class)->getEmailToFriendUrl($_product)) ?>"
class="action mailto friend"><span><?= $block->escapeHtml(__('Email')) ?></span></a>
<?php endif; ?>
@@ -0,0 +1,10 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
/** @var $block \Magento\Directory\Block\Currency */
?>
<meta property="product:price:currency"
content="<?= /* @noEscape */ $block->stripTags($block->getCurrentCurrencyCode()) ?>"/>
@@ -0,0 +1,24 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
/** @var $block \Magento\Catalog\Block\Product\View */
?>
<meta property="og:type" content="product" />
<meta property="og:title"
content="<?= $block->escapeHtmlAttr($block->stripTags($block->getProduct()->getName())) ?>" />
<meta property="og:image"
content="<?= $block->escapeUrl($block->getImage($block->getProduct(), 'product_base_image')->getImageUrl()) ?>" />
<meta property="og:description"
content="<?= $block->escapeHtmlAttr($block->stripTags($block->getProduct()->getShortDescription())) ?>" />
<meta property="og:url" content="<?= $block->escapeUrl($block->getProduct()->getProductUrl()) ?>" />
<?php if ($priceAmount = $block->getProduct()
->getPriceInfo()
->getPrice(\Magento\Catalog\Pricing\Price\FinalPrice::PRICE_CODE)
->getAmount()):?>
<meta property="product:price:amount" content="<?= $block->escapeHtmlAttr($priceAmount) ?>"/>
<?= $block->getChildHtml('meta.currency') ?>
<?php endif;?>
@@ -0,0 +1,27 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
/* @var $block \Magento\Catalog\Block\Product\View\Options */
?>
<?php $_options = $block->decorateArray($block->getOptions()) ?>
<?php $_productId = $block->getProduct()->getId() ?>
<?php if (count($_options)) :?>
<script type="text/x-magento-init">
{
"#product_addtocart_form": {
"priceOptions": {
"optionConfig": <?= /* @noEscape */ $block->getJsonConfig() ?>,
"controlContainer": ".field",
"priceHolderSelector": "[data-product-id='<?= $block->escapeHtml($_productId) ?>'][data-role=priceBox]"
}
}
}
</script>
<?php foreach ($_options as $_option) :?>
<?= $block->getOptionHtml($_option) ?>
<?php endforeach; ?>
<?php endif; ?>
@@ -0,0 +1,56 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
?>
<?php /* @var $block \Magento\Catalog\Block\Product\View\Options\Type\Date */ ?>
<?php $_option = $block->getOption() ?>
<?php $_optionId = $block->escapeHtmlAttr($_option->getId()) ?>
<?php $class = ($_option->getIsRequire()) ? ' required' : ''; ?>
<div class="field date<?= /* @noEscape */ $class ?>"
data-mage-init='{"priceOptionDate":{"fromSelector":"#product_addtocart_form"}}'>
<fieldset class="fieldset fieldset-product-options-inner<?= /* @noEscape */ $class ?>">
<legend class="legend">
<span><?= $block->escapeHtml($_option->getTitle()) ?></span>
<?= /* @noEscape */ $block->getFormattedPrice() ?>
</legend>
<div class="control">
<?php if ($_option->getType() == \Magento\Catalog\Api\Data\ProductCustomOptionInterface::OPTION_TYPE_DATE_TIME
|| $_option->getType() == \Magento\Catalog\Api\Data\ProductCustomOptionInterface::OPTION_TYPE_DATE) :?>
<?= $block->getDateHtml() ?>
<?php endif; ?>
<?php if ($_option->getType() == \Magento\Catalog\Api\Data\ProductCustomOptionInterface::OPTION_TYPE_DATE_TIME
|| $_option->getType() == \Magento\Catalog\Api\Data\ProductCustomOptionInterface::OPTION_TYPE_TIME) :?>
<?= $block->getTimeHtml() ?>
<?php endif; ?>
<?php if ($_option->getIsRequire()) :?>
<input type="hidden"
name="validate_datetime_<?= /* @noEscape */ $_optionId ?>"
class="validate-datetime-<?= /* @noEscape */ $_optionId ?>"
value=""
data-validate="{'validate-required-datetime':<?= /* @noEscape */ $_optionId ?>}"/>
<?php else :?>
<input type="hidden"
name="validate_datetime_<?= /* @noEscape */ $_optionId ?>"
class="validate-datetime-<?= /* @noEscape */ $_optionId ?>"
value=""
data-validate="{'validate-optional-datetime':<?= /* @noEscape */ $_optionId ?>}"/>
<?php endif; ?>
<script type="text/x-magento-init">
{
"#product_addtocart_form": {
"validation": {
"ignore": ":hidden:not(input[name^='validate_datetime_'])"
}
}
}
</script>
</div>
</fieldset>
</div>
@@ -0,0 +1,10 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
?>
<?php $_option = $block->getOption() ?>
<div class="field">
<label class="label"><span><?= $block->escapeHtml($_option->getTitle()) ?></span></label>
</div>
@@ -0,0 +1,80 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
/* @var $block \Magento\Catalog\Block\Product\View\Options\Type\File */
/** @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */
?>
<?php $_option = $block->getOption(); ?>
<?php $_fileInfo = $block->getFileInfo(); ?>
<?php $_fileExists = $_fileInfo->hasData(); ?>
<?php $_fileName = 'options_' . $block->escapeHtmlAttr($_option->getId()) . '_file'; ?>
<?php $_fieldNameAction = $_fileName . '_action'; ?>
<?php $_fieldValueAction = $_fileExists ? 'save_old' : 'save_new'; ?>
<?php $_fileNamed = $_fileName . '_name'; ?>
<?php $class = ($_option->getIsRequire()) ? ' required' : ''; ?>
<div class="field file<?= /* @noEscape */ $class ?>">
<label class="label" for="<?= /* @noEscape */ $_fileName ?>" id="<?= /* @noEscape */ $_fileName ?>-label">
<span><?= $block->escapeHtml($_option->getTitle()) ?></span>
<?= /* @noEscape */ $block->getFormattedPrice() ?>
</label>
<?php if ($_fileExists):?>
<div class="control">
<span class="<?= /* @noEscape */ $_fileNamed ?>"><?= $block->escapeHtml($_fileInfo->getTitle()) ?></span>
<a href="#" class="label" id="change-<?= /* @noEscape */ $_fileName ?>" >
<?= $block->escapeHtml(__('Change')) ?>
</a>
<?= /* @noEscape */ $secureRenderer->renderEventListenerAsTag(
'onclick',
'event.preventDefault()',
'a#change-' ./* @noEscape */ $_fileName
) ?>
<?php if (!$_option->getIsRequire()):?>
<input type="checkbox" id="delete-<?= /* @noEscape */ $_fileName ?>" />
<span class="label"><?= $block->escapeHtml(__('Delete')) ?></span>
<?php endif; ?>
</div>
<?php endif; ?>
<div class="control" id="input-box-<?= /* @noEscape */ $_fileName ?>"
data-mage-init='{"priceOptionFile":{
"fileName":"<?= /* @noEscape */ $_fileName ?>",
"fileNamed":"<?= /* @noEscape */ $_fileNamed ?>",
"fieldNameAction":"<?= /* @noEscape */ $_fieldNameAction ?>",
"changeFileSelector":"#change-<?= /* @noEscape */ $_fileName ?>",
"deleteFileSelector":"#delete-<?= /* @noEscape */ $_fileName ?>"}
}'>
<input type="file"
name="<?= /* @noEscape */ $_fileName ?>"
id="<?= /* @noEscape */ $_fileName ?>"
class="product-custom-option<?= $_option->getIsRequire() ? ' required' : '' ?>"
<?= $_fileExists ? 'disabled="disabled"' : '' ?> />
<input type="hidden" class="product-custom-option" name="<?= /* @noEscape */ $_fieldNameAction ?>"
value="<?= /* @noEscape */ $_fieldValueAction ?>" />
<?php if ($_option->getFileExtension()):?>
<p class="note">
<?= $block->escapeHtml(__('Compatible file extensions to upload')) ?>:
<strong><?= $block->escapeHtml($_option->getFileExtension()) ?></strong>
</p>
<?php endif; ?>
<?php if ($_option->getImageSizeX() > 0):?>
<p class="note">
<?= $block->escapeHtml(__('Maximum image width')) ?>: <strong><?= (int)$_option->getImageSizeX()
?> <?= $block->escapeHtml(__('px.')) ?></strong>
</p>
<?php endif; ?>
<?php if ($_option->getImageSizeY() > 0):?>
<p class="note">
<?= $block->escapeHtml(__('Maximum image height')) ?>: <strong><?= (int)$_option->getImageSizeY()
?> <?= $block->escapeHtml(__('px.')) ?></strong>
</p>
<?php endif; ?>
</div>
<?= $_fileExists ?
/* @noEscape */ $secureRenderer->renderStyleAsTag(
'display:none',
'#input-box-' . /* @noEscape */ $_fileName
) : '' ?>
</div>
@@ -0,0 +1,25 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
?>
<?php /* @var $block \Magento\Catalog\Block\Product\View\Options\Type\Select */ ?>
<?php
$_option = $block->getOption();
$class = ($_option->getIsRequire()) ? ' required' : '';
?>
<div class="field<?= /* @noEscape */ $class ?>">
<label class="label" for="select_<?= $block->escapeHtmlAttr($_option->getId()) ?>">
<span><?= $block->escapeHtml($_option->getTitle()) ?></span>
</label>
<div class="control">
<?= $block->getValuesHtml() ?>
<?php if ($_option->getIsRequire()) :?>
<?php if ($_option->getType() == \Magento\Catalog\Api\Data\ProductCustomOptionInterface::OPTION_TYPE_RADIO || $_option->getType() == \Magento\Catalog\Api\Data\ProductCustomOptionInterface::OPTION_TYPE_CHECKBOX) :?>
<span id="options-<?= $block->escapeHtmlAttr($_option->getId()) ?>-container"></span>
<?php endif; ?>
<?php endif;?>
</div>
</div>
@@ -0,0 +1,81 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
?>
<?php /* @var $block \Magento\Catalog\Block\Product\View\Options\Type\Text */ ?>
<?php
$_option = $block->getOption();
$class = ($_option->getIsRequire()) ? ' required' : '';
?>
<div class="field<?php if ($_option->getType() == \Magento\Catalog\Api\Data\ProductCustomOptionInterface::OPTION_TYPE_AREA) {
echo ' textarea';
} ?><?= /* @noEscape */ $class ?>">
<label class="label" for="options_<?= $block->escapeHtmlAttr($_option->getId()) ?>_text">
<span><?= $block->escapeHtml($_option->getTitle()) ?></span>
<?= /* @noEscape */ $block->getFormattedPrice() ?>
</label>
<div class="control">
<?php if ($_option->getType() == \Magento\Catalog\Api\Data\ProductCustomOptionInterface::OPTION_TYPE_FIELD) :?>
<?php $_textValidate = null;
if ($_option->getIsRequire()) {
$_textValidate['required'] = true;
}
if ($_option->getMaxCharacters()) {
$_textValidate['maxlength'] = $_option->getMaxCharacters();
}
$_textValidate['validate-no-utf8mb4-characters'] = true;
?>
<input type="text"
id="options_<?= $block->escapeHtmlAttr($_option->getId()) ?>_text"
class="input-text product-custom-option"
<?php if (!empty($_textValidate)) {?>
data-validate="<?= $block->escapeHtml(json_encode($_textValidate)) ?>"
<?php } ?>
name="options[<?= $block->escapeHtmlAttr($_option->getId()) ?>]"
data-selector="options[<?= $block->escapeHtmlAttr($_option->getId()) ?>]"
value="<?= $block->escapeHtml($block->getDefaultValue()) ?>"/>
<?php elseif ($_option->getType() == \Magento\Catalog\Api\Data\ProductCustomOptionInterface::OPTION_TYPE_AREA) :?>
<?php $_textAreaValidate = null;
if ($_option->getIsRequire()) {
$_textAreaValidate['required'] = true;
}
if ($_option->getMaxCharacters()) {
$_textAreaValidate['maxlength'] = $_option->getMaxCharacters();
}
$_textAreaValidate['validate-no-utf8mb4-characters'] = true;
?>
<textarea id="options_<?= $block->escapeHtmlAttr($_option->getId()) ?>_text"
class="product-custom-option"
<?php if (!empty($_textAreaValidate)) {?>
data-validate="<?= $block->escapeHtml(json_encode($_textAreaValidate)) ?>"
<?php } ?>
name="options[<?= $block->escapeHtmlAttr($_option->getId()) ?>]"
data-selector="options[<?= $block->escapeHtmlAttr($_option->getId()) ?>]"
rows="5"
cols="25"><?= $block->escapeHtml($block->getDefaultValue()) ?></textarea>
<?php endif; ?>
<?php if ($_option->getMaxCharacters()) :?>
<p class="note note_<?= $block->escapeHtmlAttr($_option->getId()) ?>">
<?= $block->escapeHtml(__('Maximum %1 characters', $_option->getMaxCharacters())) ?>
<span class="character-counter no-display"></span>
</p>
<?php endif; ?>
</div>
<?php if ($_option->getMaxCharacters()) :?>
<script type="text/x-magento-init">
{
"[data-selector='options[<?= $block->escapeJs($_option->getId()) ?>]']": {
"Magento_Catalog/js/product/remaining-characters": {
"maxLength": "<?= (int)$_option->getMaxCharacters() ?>",
"noteSelector": ".note_<?= $block->escapeJs($_option->getId()) ?>",
"counterSelector": ".note_<?= $block->escapeJs($_option->getId()) ?> .character-counter"
}
}
}
</script>
<?php endif; ?>
</div>
@@ -0,0 +1,19 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
/** @var $block Magento\Catalog\Block\Product\View */
?>
<?php
$required = '';
if ($block->hasRequiredOptions()) {
$required = ' data-hasrequired="' . $block->escapeHtmlAttr(__('* Required Fields')) . '"';
}
?>
<div class="product-options-wrapper" id="product-options-wrapper"<?= /* @noEscape */ $required ?>>
<div class="fieldset" tabindex="0">
<?= $block->getChildHtml('', true) ?>
</div>
</div>
@@ -0,0 +1,9 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
?>
<div class="product-options-bottom">
<?= $block->getChildHtml('', true) ?>
</div>
@@ -0,0 +1,16 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
?>
<?php /** @var \Magento\Catalog\Block\Product\AbstractProduct $block */ ?>
<?php $_product = $block->getProduct() ?>
<?= $block->getProductPriceHtml(
$_product,
\Magento\Catalog\Pricing\Price\FinalPrice::PRICE_CODE,
\Magento\Framework\Pricing\Render::ZONE_ITEM_VIEW,
[
'price_id_suffix' => '_clone'
]
) ?>
@@ -0,0 +1,11 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
?>
<?php /** @var $block \Magento\Catalog\Block\Product\AbstractProduct */ ?>
<div class="esun-product-review-actions">
<?= $block->getReviewsSummaryHtml($block->getProduct(), false, true) ?>
<?= $block->getChildHtml('esun_product_wishlist') ?>
</div>
@@ -0,0 +1,20 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
?>
<?php /* @var $block \Magento\Catalog\Block\Product\View\AbstractView */?>
<?php $_product = $block->getProduct() ?>
<?php if ($block->displayProductStockStatus()) :?>
<?php if ($_product->isAvailable()) :?>
<div class="stock available" title="<?= $block->escapeHtmlAttr(__('Availability')) ?>">
<span><?= $block->escapeHtml(__('In stock')) ?></span>
</div>
<?php else :?>
<div class="stock unavailable" title="<?= $block->escapeHtmlAttr(__('Availability')) ?>">
<span><?= $block->escapeHtml(__('Out of stock')) ?></span>
</div>
<?php endif; ?>
<?php endif; ?>
@@ -0,0 +1,22 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
?>
<?php
// phpcs:disable Magento2.PHP.ShortEchoSyntax.ShortEchoTag
/** @var $block \Magento\Ui\Block\Wrapper */
?>
<?php /* @noEscape */ echo $block->renderApp(
[
'widget_columns' => [
'displayMode' => 'grid'
],
'image' => [
'imageCode' => 'recently_compared_products_grid_content_widget'
]
]
);
@@ -0,0 +1,22 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
?>
<?php
// phpcs:disable Magento2.PHP.ShortEchoSyntax.ShortEchoTag
/** @var $block \Magento\Ui\Block\Wrapper */
?>
<?php /* @noEscape */ echo $block->renderApp(
[
'widget_columns' => [
'displayMode' => 'list'
],
'image' => [
'imageCode' => 'recently_compared_products_list_content_widget'
]
]
);
@@ -0,0 +1,22 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
?>
<?php
// phpcs:disable Magento2.PHP.ShortEchoSyntax.ShortEchoTag
/** @var $block \Magento\Ui\Block\Wrapper */
?>
<?php /* @noEscape */ echo $block->renderApp(
[
'listing' => [
'displayMode' => 'grid'
],
'image' => [
'imageCode' => 'recently_compared_products_images_names_widget'
]
]
);
@@ -0,0 +1,9 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
?>
<div class="widget block block-product-link">
<a <?= /* @noEscape */ $block->getLinkAttributes() ?>><span><?= $block->escapeHtml($block->getLabel()) ?></span></a>
</div>
@@ -0,0 +1,9 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
?>
<span class="widget block block-product-link-inline">
<a <?= /* @noEscape */ $block->getLinkAttributes() ?>><span><?= $block->escapeHtml($block->getLabel()) ?></span></a>
</span>
@@ -0,0 +1,75 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
// phpcs:disable Magento2.Templates.ThisInTemplate.FoundThis
// phpcs:disable Magento2.Files.LineLength.MaxExceeded
?>
<?php if (($_products = $block->getProductCollection()) && $_products->getSize()) :?>
<div class="block widget block-new-products-list">
<div class="block-title">
<strong><?= $block->escapeHtml(__('New Products')) ?></strong>
</div>
<div class="block-content">
<?php $suffix = $block->getNameInLayout(); ?>
<ol class="product-items" id="widget-new-products-<?= $block->escapeHtmlAttr($suffix) ?>">
<?php foreach ($_products->getItems() as $_product) :?>
<li class="product-item">
<div class="product-item-info">
<a class="product-item-photo" href="<?= $block->escapeUrl($_product->getProductUrl()) ?>"
title="<?= /* @noEscape */ $block->stripTags($_product->getName(), null, true) ?>">
<?= $block->getImage($_product, 'side_column_widget_product_thumbnail')->toHtml() ?>
</a>
<div class="product-item-details">
<strong class="product-item-name">
<a href="<?= $block->escapeUrl($_product->getProductUrl()) ?>"
title="<?= /* @noEscape */ $block->stripTags($_product->getName(), null, true) ?>)"
class="product-item-link">
<?= /* @noEscape */ $this->helper(Magento\Catalog\Helper\Output::class)->productAttribute($_product, $_product->getName(), 'name') ?>
</a>
</strong>
<?= $block->getProductPriceHtml($_product, '-widget-new-' . $suffix) ?>
<div class="product-item-actions">
<div class="actions-primary">
<?php if ($_product->isSaleable()) :?>
<?php if (!$_product->getTypeInstance()->isPossibleBuyFromList($_product)) :?>
<button type="button" title="<?= $block->escapeHtmlAttr(__('Add to Cart')) ?>"
class="action tocart primary"
data-mage-init='{"redirectUrl":{"url":"<?= $block->escapeUrl($block->getAddToCartUrl($_product)) ?>"}}'>
<span><?= $block->escapeHtml(__('Add to Cart')) ?></span>
</button>
<?php else :?>
<?php
$postDataHelper = $this->helper(Magento\Framework\Data\Helper\PostHelper::class);
$postData = $postDataHelper->getPostData($block->escapeUrl($block->getAddToCartUrl($_product)), ['product' => $_product->getEntityId()]);
?>
<button type="button" title="<?= $block->escapeHtmlAttr(__('Add to Cart')) ?>"
class="action tocart primary"
data-post='<?= /* @noEscape */ $postData ?>'>
<span><?= $block->escapeHtml(__('Add to Cart')) ?></span>
</button>
<?php endif; ?>
<?php else :?>
<?php if ($_product->isAvailable()) :?>
<div class="stock available" title="<?= $block->escapeHtmlAttr(__('Availability')) ?>">
<span><?= $block->escapeHtml(__('In stock')) ?></span>
</div>
<?php else :?>
<div class="stock unavailable" title="<?= $block->escapeHtmlAttr(__('Availability')) ?>">
<span><?= $block->escapeHtml(__('Out of stock')) ?></span>
</div>
<?php endif; ?>
<?php endif; ?>
</div>
</div>
</div>
</div>
</li>
<?php endforeach; ?>
</ol>
<?= $block->getPagerHtml() ?>
</div>
</div>
<?php endif; ?>
@@ -0,0 +1,29 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
?>
<?php if (($_products = $block->getProductCollection()) && $_products->getSize()) :?>
<div class="block widget block-new-products-images">
<div class="block-title">
<strong><?= $block->escapeHtml(__('New Products')) ?></strong>
</div>
<div class="block-content">
<?php $suffix = $block->getNameInLayout(); ?>
<ol id="widget-new-products-<?= $block->escapeHtmlAttr($suffix) ?>"
class="product-items product-items-images">
<?php foreach ($_products->getItems() as $_product) :?>
<li class="product-item">
<a class="product-item-photo" href="<?= $block->escapeUrl($_product->getProductUrl()) ?>"
title="<?= /* @noEscape */ $block->stripTags($_product->getName(), null, true) ?>">
<?php /* new_products_images_only_widget */ ?>
<?= $block->getImage($_product, 'new_products_images_only_widget')->toHtml() ?>
</a>
</li>
<?php endforeach; ?>
</ol>
<?= $block->getPagerHtml() ?>
</div>
</div>
<?php endif; ?>
@@ -0,0 +1,35 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
// phpcs:disable Magento2.Templates.ThisInTemplate.FoundThis
?>
<?php if (($_products = $block->getProductCollection()) && $_products->getSize()) :?>
<div class="block widget block-new-products-names">
<div class="block-title">
<strong><?= $block->escapeHtml(__('New Products')) ?></strong>
</div>
<div class="block-content">
<?php $suffix = $block->getNameInLayout(); ?>
<ol id="widget-new-products-<?= $block->escapeHtmlAttr($suffix) ?>"
class="product-items product-items-names">
<?php foreach ($_products->getItems() as $_product) :?>
<li class="product-item">
<strong class="product-item-name">
<a href="<?= $block->escapeUrl($_product->getProductUrl()) ?>"
title="<?= /* @noEscape */ $block->stripTags($_product->getName(), null, true) ?>)"
class="product-item-link">
<?= /* @noEscape */ $this->helper(
Magento\Catalog\Helper\Output::class
)->productAttribute($_product, $_product->getName(), 'name') ?>
</a>
</strong>
</li>
<?php endforeach; ?>
</ol>
<?= $block->getPagerHtml() ?>
</div>
</div>
<?php endif; ?>
@@ -0,0 +1,136 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
?>
<?php
/**
* Template for displaying new products widget
*
* @var $block \Magento\Catalog\Block\Product\Widget\NewWidget
*/
// phpcs:disable Magento2.Files.LineLength.MaxExceeded
// phpcs:disable Magento2.Templates.ThisInTemplate.FoundThis
if ($exist = ($block->getProductCollection() && $block->getProductCollection()->getSize())) {
$type = 'widget-new-grid';
$mode = 'grid';
$image = 'new_products_content_widget_grid';
$title = __('New Products');
$items = $block->getProductCollection()->getItems();
$showWishlist = true;
$showCompare = true;
$showCart = true;
$templateType = \Magento\Catalog\Block\Product\ReviewRendererInterface::DEFAULT_VIEW;
$description = false;
}
?>
<?php if ($exist) :?>
<div class="block widget block-new-products <?= /* @noEscape */ $mode ?>">
<div class="block-title">
<strong role="heading" aria-level="2"><?= $block->escapeHtml($title) ?></strong>
</div>
<div class="block-content">
<?= /* @noEscape */ '<!-- ' . $image . '-->' ?>
<div class="products-<?= /* @noEscape */ $mode ?> <?= /* @noEscape */ $mode ?>">
<ol class="product-items <?= /* @noEscape */ $type ?>">
<?php foreach ($items as $_item) :?>
<li class="product-item">
<div class="product-item-info">
<a href="<?= $block->escapeUrl($block->getProductUrl($_item)) ?>"
class="product-item-photo">
<?= $block->getImage($_item, $image)->toHtml() ?>
</a>
<div class="product-item-details">
<strong class="product-item-name">
<a title="<?= $block->escapeHtml($_item->getName()) ?>"
href="<?= $block->escapeUrl($block->getProductUrl($_item)) ?>"
class="product-item-link">
<?= $block->escapeHtml($_item->getName()) ?>
</a>
</strong>
<?= $block->getProductPriceHtml($_item, $type); ?>
<?php if ($templateType) :?>
<?= $block->getReviewsSummaryHtml($_item, $templateType) ?>
<?php endif; ?>
<?php if ($showWishlist || $showCompare || $showCart) :?>
<div class="product-item-actions">
<?php if ($showCart) :?>
<div class="actions-primary">
<?php if ($_item->isSaleable()) :?>
<?php if (!$_item->getTypeInstance()->isPossibleBuyFromList($_item)) :?>
<button class="action tocart primary"
data-mage-init='{"redirectUrl":{"url":"<?= $block->escapeUrl($block->getAddToCartUrl($_item)) ?>"}}'
type="button"
title="<?= $block->escapeHtmlAttr(__('Add to Cart')) ?>">
<span><?= $block->escapeHtml(__('Add to Cart')) ?></span>
</button>
<?php else :?>
<?php
$postDataHelper = $this->helper(Magento\Framework\Data\Helper\PostHelper::class);
$postData = $postDataHelper->getPostData(
$block->escapeUrl($block->getAddToCartUrl($_item)),
['product' => (int) $_item->getEntityId()]
)
?>
<button class="action tocart primary"
data-post='<?= /* @noEscape */ $postData ?>'
type="button"
title="<?= $block->escapeHtmlAttr(__('Add to Cart')) ?>">
<span><?= $block->escapeHtml(__('Add to Cart')) ?></span>
</button>
<?php endif; ?>
<?php else :?>
<?php if ($_item->isAvailable()) :?>
<div class="stock available">
<span><?= $block->escapeHtml(__('In stock')) ?></span>
</div>
<?php else :?>
<div class="stock unavailable">
<span><?= $block->escapeHtml(__('Out of stock')) ?></span>
</div>
<?php endif; ?>
<?php endif; ?>
</div>
<?php endif; ?>
<?php if ($showWishlist || $showCompare) :?>
<div class="actions-secondary" data-role="add-to-links">
<?php if ($this->helper(Magento\Wishlist\Helper\Data::class)->isAllow() && $showWishlist) :?>
<a href="#"
data-post='<?= /* @noEscape */ $block->getAddToWishlistParams($_item) ?>'
class="action towishlist"
data-action="add-to-wishlist"
title="<?= $block->escapeHtmlAttr(__('Add to Wish List')) ?>">
<span><?= $block->escapeHtml(__('Add to Wish List')) ?></span>
</a>
<?php endif; ?>
<?php if ($block->getAddToCompareUrl() && $showCompare) :?>
<?php $compareHelper = $this->helper(Magento\Catalog\Helper\Product\Compare::class);?>
<a href="#" class="action tocompare"
data-post='<?= /* @noEscape */ $compareHelper->getPostDataParams($_item) ?>'
title="<?= $block->escapeHtmlAttr(__('Add to Compare')) ?>">
<span><?= $block->escapeHtml(__('Add to Compare')) ?></span>
</a>
<?php endif; ?>
</div>
<?php endif; ?>
</div>
<?php endif; ?>
</div>
</div>
</li>
<?php endforeach ?>
</ol>
</div>
<?= $block->getPagerHtml() ?>
</div>
</div>
<?php endif;?>
@@ -0,0 +1,143 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
?>
<?php
// phpcs:disable Magento2.Templates.ThisInTemplate.FoundThis
// phpcs:disable Magento2.Files.LineLength.MaxExceeded
/**
* Template for displaying new products widget
*
* @var $block \Magento\Catalog\Block\Product\Widget\NewWidget
*/
if ($exist = ($block->getProductCollection() && $block->getProductCollection()->getSize())) {
$type = 'widget-new-list';
$mode = 'list';
$image = 'new_products_content_widget_list';
$title = __('New Products');
$items = $block->getProductCollection()->getItems();
/** @var Magento\Catalog\Helper\Output $_helper */
$_helper = $this->helper(Magento\Catalog\Helper\Output::class);
$showWishlist = true;
$showCompare = true;
$showCart = true;
$templateType = \Magento\Catalog\Block\Product\ReviewRendererInterface::DEFAULT_VIEW;
$description = true;
}
?>
<?php if ($exist) :?>
<div class="block widget block-new-products <?= /* @noEscape */ $mode ?>">
<div class="block-title">
<strong role="heading" aria-level="2"><?= $block->escapeHtml($title) ?></strong>
</div>
<div class="block-content">
<?= /* @noEscape */ '<!-- ' . $image . '-->' ?>
<div class="products-<?= /* @noEscape */ $mode ?> <?= /* @noEscape */ $mode ?>">
<ol class="product-items <?= /* @noEscape */ $type ?>">
<?php foreach ($items as $_item) :?>
<li class="product-item">
<div class="product-item-info">
<a href="<?= $block->escapeUrl($block->getProductUrl($_item)) ?>"
class="product-item-photo">
<?= $block->getImage($_item, $image)->toHtml() ?>
</a>
<div class="product-item-details">
<strong class="product-item-name">
<a title="<?= $block->escapeHtmlAttr($_item->getName()) ?>"
href="<?= $block->escapeUrl($block->getProductUrl($_item)) ?>"
class="product-item-link">
<?= $block->escapeHtml($_item->getName()) ?>
</a>
</strong>
<?= $block->getProductPriceHtml($_item, $type) ?>
<?php if ($templateType) :?>
<?= $block->getReviewsSummaryHtml($_item, $templateType) ?>
<?php endif; ?>
<?php if ($showWishlist || $showCompare || $showCart) :?>
<div class="product-item-actions">
<?php if ($showCart) :?>
<div class="actions-primary">
<?php if ($_item->isSaleable()) :?>
<?php if (!$_item->getTypeInstance()->isPossibleBuyFromList($_item)
) :?>
<button class="action tocart primary"
data-mage-init='{"redirectUrl":{"url":"<?= $block->escapeUrl($block->getAddToCartUrl($_item)) ?>"}}'
type="button"
title="<?= $block->escapeHtmlAttr(__('Add to Cart')) ?>">
<span><?= $block->escapeHtml(__('Add to Cart')) ?></span>
</button>
<?php else :?>
<?php
$postDataHelper = $this->helper(Magento\Framework\Data\Helper\PostHelper::class);
$postData = $postDataHelper->getPostData($block->getAddToCartUrl($_item), ['product' => $_item->getEntityId()])
?>
<button class="action tocart primary"
data-post='<?= /* @noEscape */ $postData ?>'
type="button" title="<?= $block->escapeHtmlAttr(__('Add to Cart')) ?>">
<span><?= $block->escapeHtml(__('Add to Cart')) ?></span>
</button>
<?php endif; ?>
<?php else :?>
<?php if ($_item->isAvailable()) :?>
<div class="stock available"><span><?= $block->escapeHtml(__('In stock')) ?></span></div>
<?php else :?>
<div class="stock unavailable"><span><?= $block->escapeHtml(__('Out of stock')) ?></span></div>
<?php endif; ?>
<?php endif; ?>
</div>
<?php endif; ?>
<?php if ($showWishlist || $showCompare) :?>
<div class="actions-secondary" data-role="add-to-links">
<?php if ($this->helper(Magento\Wishlist\Helper\Data::class)->isAllow() && $showWishlist) :?>
<a href="#"
data-post='<?= /* @noEscape */ $block->getAddToWishlistParams($_item) ?>'
class="action towishlist" data-action="add-to-wishlist"
title="<?= $block->escapeHtmlAttr(__('Add to Wish List')) ?>">
<span><?= $block->escapeHtml(__('Add to Wish List')) ?></span>
</a>
<?php endif; ?>
<?php if ($block->getAddToCompareUrl() && $showCompare) :?>
<?php $compareHelper = $this->helper(Magento\Catalog\Helper\Product\Compare::class); ?>
<a href="#" class="action tocompare"
title="<?= $block->escapeHtmlAttr(__('Add to Compare')) ?>"
data-post='<?= /* @noEscape */ $compareHelper->getPostDataParams($_item) ?>'
>
<span><?= $block->escapeHtml(__('Add to Compare')) ?></span>
</a>
<?php endif; ?>
</div>
<?php endif; ?>
</div>
<?php endif; ?>
<?php if ($description) :?>
<div class="product-item-description">
<?= /* @noEscape */ $_helper->productAttribute(
$_item,
$_item->getShortDescription(),
'short_description'
) ?>
<a title="<?= $block->escapeHtmlAttr($_item->getName()) ?>"
href="<?= $block->escapeUrl($block->getProductUrl($_item))?>"
class="action more"><?= $block->escapeHtml(__('Learn More')) ?></a>
</div>
<?php endif; ?>
</div>
</div>
</li>
<?php endforeach ?>
</ol>
</div>
<?= $block->getPagerHtml() ?>
</div>
</div>
<?php endif;?>
@@ -0,0 +1,21 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
?>
<?php
// phpcs:disable Magento2.Security.LanguageConstruct.DirectOutput
// phpcs:disable Magento2.PHP.ShortEchoSyntax.ShortEchoTag
/** @var $block \Magento\Ui\Block\Wrapper */
?>
<?php /* @noEscape */ echo $block->renderApp([
'widget_columns' => [
'displayMode' => 'grid'
],
'image' => [
'imageCode' => 'recently_viewed_products_grid_content_widget'
]
]);
@@ -0,0 +1,21 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
?>
<?php
// phpcs:disable Magento2.Security.LanguageConstruct.DirectOutput
// phpcs:disable Magento2.PHP.ShortEchoSyntax.ShortEchoTag
/** @var $block \Magento\Ui\Block\Wrapper */
?>
<?php /* @noEscape */ echo $block->renderApp([
'widget_columns' => [
'displayMode' => 'list'
],
'image' => [
'imageCode' => 'recently_viewed_products_list_content_widget'
]
]);
@@ -0,0 +1,22 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
?>
<?php
// phpcs:disable Magento2.PHP.ShortEchoSyntax.ShortEchoTag
/** @var $block \Magento\Ui\Block\Wrapper */
?>
<?php /* @noEscape */ echo $block->renderApp(
[
'listing' => [
'displayMode' => 'grid'
],
'image' => [
'imageCode' => 'recently_viewed_products_images_names_widget'
]
]
);
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,8 @@
@product-name-link__color: @text__color;
@product-name-link__color__active: @text__color;
@product-name-link__color__hover: @text__color;
@product-name-link__color__visited: @text__color;
@product-name-link__text-decoration: none;
@product-name-link__text-decoration__active: @link__hover__text-decoration;
@product-name-link__text-decoration__hover: @link__hover__text-decoration;
@product-name-link__text-decoration__visited: @link__hover__text-decoration;
@@ -0,0 +1,229 @@
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
define([
'jquery',
'mage/translate',
'underscore',
'Magento_Catalog/js/product/view/product-ids-resolver',
'Magento_Catalog/js/product/view/product-info-resolver',
'jquery-ui-modules/widget'
], function ($, $t, _, idsResolver, productInfoResolver) {
'use strict';
$.widget('mage.catalogAddToCart', {
options: {
processStart: null,
processStop: null,
bindSubmit: true,
minicartSelector: '[data-block="minicart"]',
messagesSelector: '[data-placeholder="messages"]',
productStatusSelector: '.stock.available',
addToCartButtonSelector: '.action.tocart',
addToCartButtonDisabledClass: 'disabled',
addToCartButtonTextWhileAdding: '',
addToCartButtonTextAdded: '',
addToCartButtonTextDefault: '',
productInfoResolver: productInfoResolver
},
/** @inheritdoc */
_create: function () {
if (this.options.bindSubmit) {
this._bindSubmit();
}
$(this.options.addToCartButtonSelector).prop('disabled', false);
},
/**
* @private
*/
_bindSubmit: function () {
var self = this;
if (this.element.data('catalog-addtocart-initialized')) {
return;
}
this.element.data('catalog-addtocart-initialized', 1);
this.element.on('submit', function (e) {
e.preventDefault();
self.submitForm($(this));
});
},
/**
* @private
*/
_redirect: function (url) {
var urlParts, locationParts, forceReload;
urlParts = url.split('#');
locationParts = window.location.href.split('#');
forceReload = urlParts[0] === locationParts[0];
window.location.assign(url);
if (forceReload) {
window.location.reload();
}
},
/**
* @return {Boolean}
*/
isLoaderEnabled: function () {
return this.options.processStart && this.options.processStop;
},
/**
* Handler for the form 'submit' event
*
* @param {jQuery} form
*/
submitForm: function (form) {
this.ajaxSubmit(form);
},
/**
* @param {jQuery} form
*/
ajaxSubmit: function (form) {
var self = this,
productIds = idsResolver(form),
productInfo = self.options.productInfoResolver(form),
formData;
$(self.options.minicartSelector).trigger('contentLoading');
self.disableAddToCartButton(form);
formData = new FormData(form[0]);
$.ajax({
url: form.prop('action'),
data: formData,
type: 'post',
dataType: 'json',
cache: false,
contentType: false,
processData: false,
/** @inheritdoc */
beforeSend: function () {
if (self.isLoaderEnabled()) {
$('body').trigger(self.options.processStart);
}
},
/** @inheritdoc */
success: function (res) {
var eventData, parameters;
$(document).trigger('ajax:addToCart', {
'sku': form.data().productSku,
'productIds': productIds,
'productInfo': productInfo,
'form': form,
'response': res
});
if (self.isLoaderEnabled()) {
$('body').trigger(self.options.processStop);
}
if (res.backUrl) {
eventData = {
'form': form,
'redirectParameters': []
};
// trigger global event, so other modules will be able add parameters to redirect url
$('body').trigger('catalogCategoryAddToCartRedirect', eventData);
if (eventData.redirectParameters.length > 0 &&
window.location.href.split(/[?#]/)[0] === res.backUrl
) {
parameters = res.backUrl.split('#');
parameters.push(eventData.redirectParameters.join('&'));
res.backUrl = parameters.join('#');
}
self._redirect(res.backUrl);
return;
}
if (res.messages) {
$(self.options.messagesSelector).html(res.messages);
}
if (res.minicart) {
$(self.options.minicartSelector).replaceWith(res.minicart);
$(self.options.minicartSelector).trigger('contentUpdated');
}
if (res.product && res.product.statusText) {
$(self.options.productStatusSelector)
.removeClass('available')
.addClass('unavailable')
.find('span')
.html(res.product.statusText);
}
self.enableAddToCartButton(form);
},
/** @inheritdoc */
error: function (res) {
$(document).trigger('ajax:addToCart:error', {
'sku': form.data().productSku,
'productIds': productIds,
'productInfo': productInfo,
'form': form,
'response': res
});
},
/** @inheritdoc */
complete: function (res) {
if (res.state() === 'rejected') {
location.reload();
}
}
});
},
/**
* @param {String} form
*/
disableAddToCartButton: function (form) {
var addToCartButtonTextWhileAdding = this.options.addToCartButtonTextWhileAdding || $t('Adding...'),
addToCartButton = $(form).find(this.options.addToCartButtonSelector);
addToCartButton.addClass(this.options.addToCartButtonDisabledClass);
addToCartButton.find('span').text(addToCartButtonTextWhileAdding);
addToCartButton.prop('title', addToCartButtonTextWhileAdding);
},
/**
* @param {String} form
*/
enableAddToCartButton: function (form) {
var addToCartButtonTextAdded = this.options.addToCartButtonTextAdded || $t('Added'),
self = this,
addToCartButton = $(form).find(this.options.addToCartButtonSelector);
addToCartButton.find('span').text(addToCartButtonTextAdded);
addToCartButton.prop('title', addToCartButtonTextAdded);
setTimeout(function () {
var addToCartButtonTextDefault = self.options.addToCartButtonTextDefault || $t('Add to Cart');
addToCartButton.removeClass(self.options.addToCartButtonDisabledClass);
addToCartButton.find('span').text(addToCartButtonTextDefault);
addToCartButton.prop('title', addToCartButtonTextDefault);
}, 1000);
}
});
return $.mage.catalogAddToCart;
});
@@ -0,0 +1,31 @@
define([
'jquery'
], function ($) {
'use strict';
return function (config, element) {
var $scope = $(element);
$scope.find('.esun-category-card').each(function () {
var $card = $(this);
var $image = $card.find('.esun-category-card__image .product-image-photo').first();
var defaultSrc = $image.attr('src');
if (!defaultSrc) {
return;
}
$card.find('.esun-category-card__swatch').on('mouseenter focus', function () {
var imageSrc = $(this).data('product-image');
if (imageSrc) {
$image.attr('src', imageSrc);
}
});
$card.find('.esun-category-card__swatches').on('mouseleave focusout', function () {
$image.attr('src', defaultSrc);
});
});
};
});
@@ -0,0 +1,44 @@
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
define([
'jquery',
'jquery-ui-modules/widget'
], function ($) {
'use strict';
$.widget('mage.gallery', {
options: {
minWidth: 300, // Minimum width of the gallery image.
widthOffset: 90, // Offset added to the width of the gallery image.
heightOffset: 210, // Offset added to the height of the gallery image.
closeWindow: 'div.buttons-set a[role="close-window"]' // Selector for closing the gallery popup window.
},
/**
* Bind click handler for closing the popup window and resize the popup based on the image size.
* @private
*/
_create: function () {
$(this.options.closeWindow).on('click', function () {
window.close();
});
this._resizeWindow();
},
/**
* Resize the gallery image popup window based on the image's dimensions.
* @private
*/
_resizeWindow: function () {
var img = this.element,
width = img.width() < this.options.minWidth ? this.options.minWidth : img.width();
window.resizeTo(width + this.options.widthOffset, img.height() + this.options.heightOffset);
}
});
return $.mage.gallery;
});
@@ -0,0 +1,51 @@
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
define([
'jquery',
'jquery-ui-modules/widget'
], function ($) {
'use strict';
$.widget('mage.compareList', {
/** @inheritdoc */
_create: function () {
var elem = this.element,
products = $('thead td', elem),
headings;
if (products.length > this.options.productsInRow) {
headings = $('<table></table>')
.addClass('comparison headings data table')
.insertBefore(elem.closest('.container'));
elem.addClass('scroll');
$('th', elem).each(function () {
var th = $(this),
thCopy = th.clone();
th.animate({
top: '+=0'
}, 50, function () {
var height = th.height();
thCopy.css('height', height)
.appendTo(headings)
.wrap('<tr></tr>');
});
});
}
$(this.options.windowPrintSelector).on('click', function (e) {
e.preventDefault();
window.print();
});
}
});
return $.mage.compareList;
});
@@ -0,0 +1,29 @@
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
layout="1column"
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
<css src="Magento_Catalog::css/category-list.css"/>
<css src="Magento_CatalogSearch::css/search-results.css"/>
</head>
<body>
<attribute name="class" value="esun-search-results"/>
<referenceBlock name="catalogsearch.leftnav" remove="true"/>
<referenceBlock name="catalog.compare.sidebar" remove="true"/>
<referenceBlock name="wishlist_sidebar" remove="true"/>
<referenceBlock name="catalogsearch.product.addto.compare" remove="true"/>
<referenceBlock name="search_result_list">
<arguments>
<argument name="cardViewModel" xsi:type="object">Esun\Catalog\ViewModel\Category\ProductCard</argument>
</arguments>
<action method="setTemplate">
<argument name="template" xsi:type="string">Magento_Catalog::product/list.phtml</argument>
</action>
</referenceBlock>
<referenceBlock name="product_list_toolbar"
template="Magento_CatalogSearch::product/list/toolbar.phtml"/>
</body>
</page>
@@ -0,0 +1,20 @@
<?php
/**
* Search result toolbar: result count above the grid and pagination below it.
*
* @var $block \Magento\Catalog\Block\Product\ProductList\Toolbar
*/
?>
<?php if ($block->getCollection()->getSize()): ?>
<div class="toolbar toolbar-products">
<?php if ($block->getIsBottom()): ?>
<?= /* @noEscape */ $block->getPagerHtml() ?>
<?php else: ?>
<div class="esun-category-toolbar__amount">
<?= /* @noEscape */ $block->fetchView(
$block->getTemplateFile('Magento_Catalog::product/list/toolbar/amount.phtml')
) ?>
</div>
<?php endif; ?>
</div>
<?php endif; ?>
@@ -0,0 +1,180 @@
.catalogsearch-result-index {
--esun-green: #12ad5c;
--esun-green-dark: #0c914c;
--esun-text: #242424;
--esun-muted: #777;
--esun-border: #edf1ee;
background: #fff;
}
.catalogsearch-result-index.page-layout-1column .page-main {
box-sizing: border-box;
max-width: 1600px;
width: 83.333333%;
}
.catalogsearch-result-index .column.main,
.catalogsearch-result-index .search.results {
min-width: 0;
width: 100%;
}
.catalogsearch-result-index .page-title-wrapper {
display: none;
}
.catalogsearch-result-index .search.results dl.block {
display: none;
}
.catalogsearch-result-index .toolbar-products {
align-items: center;
display: flex;
justify-content: space-between;
margin: 0 0 26px;
}
.catalogsearch-result-index .toolbar-products .toolbar-amount {
color: #313131;
font-size: 14px;
margin: 0;
}
.catalogsearch-result-index .toolbar-products .toolbar-number {
color: var(--esun-green);
font-weight: 700;
}
.catalogsearch-result-index .esun-category-products .product-items {
display: grid;
gap: 24px;
grid-template-columns: repeat(4, minmax(0, 1fr));
list-style: none;
margin: 0;
padding: 0;
}
.catalogsearch-result-index .esun-category-products .product-item {
margin: 0;
min-width: 0;
width: auto;
}
.catalogsearch-result-index .toolbar-products:last-child {
justify-content: center;
margin: 42px 0 0;
}
.catalogsearch-result-index .pager {
margin: 0;
}
.catalogsearch-result-index .pager .limiter {
display: none;
}
.catalogsearch-result-index .pages {
align-items: center;
display: flex;
justify-content: center;
}
.catalogsearch-result-index .pages .label {
display: none;
}
.catalogsearch-result-index .pages .items {
align-items: center;
display: flex;
gap: 18px;
list-style: none;
margin: 0;
padding: 0;
}
.catalogsearch-result-index .pages .item {
margin: 0;
}
.catalogsearch-result-index .pages .page {
background: var(--esun-green);
border-radius: 50%;
display: block;
height: 6px;
opacity: 0.75;
overflow: hidden;
text-indent: 30px;
white-space: nowrap;
width: 6px;
padding: 0;
}
.catalogsearch-result-index .pages .current .page {
border-radius: 999px;
opacity: 1;
width: 28px;
}
.catalogsearch-result-index .pages .action {
align-items: center;
background: #fff;
border: 2px solid var(--esun-green);
border-radius: 50%;
color: var(--esun-green);
display: inline-flex;
height: 36px;
justify-content: center;
text-decoration: none;
width: 36px;
}
.catalogsearch-result-index .pages .previous::before {
content: "\2039";
font-size: 28px;
line-height: 1;
margin: -2px 0 0;
}
.catalogsearch-result-index .pages .next::before {
content: "\203a";
font-size: 28px;
line-height: 1;
margin: -2px 0 0;
}
.catalogsearch-result-index .pages .action span {
display: none;
}
@media (max-width: 1199px) {
.catalogsearch-result-index .esun-category-products .product-items {
grid-template-columns: repeat(3, minmax(0, 1fr));
}
}
@media (max-width: 899px) {
.catalogsearch-result-index.page-layout-1column .page-main {
width: 100%;
}
.catalogsearch-result-index .esun-category-products .product-items {
grid-template-columns: repeat(2, minmax(0, 1fr));
}
}
@media (max-width: 639px) {
.catalogsearch-result-index .page-main {
padding-left: 15px;
padding-right: 15px;
}
.catalogsearch-result-index .esun-category-products .product-items {
gap: 16px;
}
}
@media (max-width: 420px) {
.catalogsearch-result-index .esun-category-products .product-items {
grid-template-columns: 1fr;
}
}
@@ -0,0 +1,44 @@
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="checkout.root">
<arguments>
<argument name="jsLayout" xsi:type="array">
<item name="components" xsi:type="array">
<item name="checkout" xsi:type="array">
<item name="children" xsi:type="array">
<item name="steps" xsi:type="array">
<item name="children" xsi:type="array">
<item name="shipping-step" xsi:type="array">
<item name="children" xsi:type="array">
<item name="shippingAddress" xsi:type="array">
<item name="config" xsi:type="array">
<item name="popUpForm" xsi:type="array">
<item name="options" xsi:type="array">
<item name="buttons" xsi:type="array">
<item name="save" xsi:type="array">
<item name="text" xsi:type="string" translate="true">Ship Here</item>
<item name="class" xsi:type="string">action action-apply action-save-address esun-checkout-address-action</item>
</item>
<item name="cancel" xsi:type="array">
<item name="text" xsi:type="string" translate="true">Cancel</item>
<item name="class" xsi:type="string">action action-apply action-hide-popup esun-checkout-address-action</item>
</item>
</item>
</item>
</item>
</item>
</item>
</item>
</item>
</item>
</item>
</item>
</item>
</item>
</argument>
</arguments>
</referenceBlock>
</body>
</page>
@@ -0,0 +1,171 @@
& when (@media-common = true) {
.block-minicart {
.subtotal {
margin: 0;
}
}
// Keep every checkout address action visually identical to the actual
// mini cart discount Apply button. The dedicated class is also used
// by the popup buttons, which live outside the Amasty step container.
.checkout-index-index .esun-checkout-address-action {
background-image: none;
background: #18aa59;
border: 1px solid #18aa59;
border-radius: 20px;
box-shadow: none;
box-sizing: border-box;
color: #fff;
cursor: pointer;
align-items: center;
display: flex;
font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
font-size: 13px;
font-weight: 700;
height: 40px;
justify-content: center;
line-height: 22.4px;
margin: 0;
min-height: auto;
min-width: 82px;
padding: 0 20px;
vertical-align: middle;
}
.checkout-index-index .esun-checkout-address-action:hover {
background: #148f4b;
border-color: #148f4b;
color: #fff;
}
.checkout-index-index .esun-checkout-address-action:focus,
.checkout-index-index .esun-checkout-address-action:active {
background: #148f4b;
border-color: #148f4b;
color: #fff;
}
// Magento turns the billing Cancel action back into a small blue link
// using a more specific checkout selector. Keep it identical to Update.
.checkout-index-index .checkout-payment-method .checkout-billing-address
.actions-toolbar > .primary {
align-items: center;
display: flex;
flex-direction: row-reverse;
gap: 20px;
}
.checkout-index-index .checkout-payment-method .checkout-billing-address
.actions-toolbar .action.action-cancel.esun-checkout-address-action {
background: #18aa59;
border: 1px solid #18aa59;
border-radius: 20px;
color: #fff;
display: flex;
font-size: 13px;
font-weight: 700;
height: 40px;
line-height: 22.4px;
margin: 0;
min-width: 82px;
padding: 0 20px;
text-decoration: none;
}
.checkout-index-index .checkout-payment-method .checkout-billing-address
.actions-toolbar .action.action-cancel.esun-checkout-address-action:hover,
.checkout-index-index .checkout-payment-method .checkout-billing-address
.actions-toolbar .action.action-cancel.esun-checkout-address-action:focus,
.checkout-index-index .checkout-payment-method .checkout-billing-address
.actions-toolbar .action.action-cancel.esun-checkout-address-action:active {
background: #148f4b;
border-color: #148f4b;
color: #fff;
text-decoration: none;
}
// Shipping and billing both render the customer-address EAV fields in a
// single fieldset. These markers make the continuous form structure
// explicit and prevent third-party legend/fieldset grouping from leaking
// into either new-address form.
.checkout-index-index .esun-checkout-address-form {
// Amasty can leave the US region select wrapper with an inline
// display:none after resolving the default country. The address-book
// form shows State/Province, so checkout must expose the same field.
.field:has(select[name='region_id']) {
display: block !important;
}
.fieldset.address {
border: 0;
margin-bottom: 0;
padding: 0;
}
.fieldset.address > .legend {
display: none;
}
}
.checkout-index-index .opc-wrapper .form-discount {
max-width: none;
}
.checkout-index-index button.action.primary.checkout[data-role='review-save'] {
background-color: #18a957 !important;
border-color: #18a957;
border-radius: 30px;
padding-left: 30px;
padding-right: 30px;
}
.checkout-index-index .amcheckout-main-container.-modern
.amcheckout-column.-main > .amcheckout-step-container:nth-child(-n+3),
.checkout-index-index .amcheckout-main-container.-modern
.amcheckout-step-container:has(.amcheckout-shipping-address),
.checkout-index-index .amcheckout-main-container.-modern
.amcheckout-step-container:has(.amcheckout-shipping-methods),
.checkout-index-index .amcheckout-main-container.-modern
.amcheckout-step-container:has(.amcheckout-payment-methods) {
border: 1px solid #e4f5eb !important;
}
.checkout-index-index .amcheckout-main-container.-modern
.amcheckout-step-container.-summary,
.checkout-index-index .amcheckout-main-container.-modern
.amcheckout-step-container.-summary
.amcheckout-summary-container {
border: 0 !important;
box-shadow: none !important;
}
.checkout-index-index .amcheckout-main-container.-modern
.amcheckout-column.-main > .amcheckout-step-container:nth-child(-n+3)
.amcheckout-title,
.checkout-index-index .amcheckout-shipping-address
> .amcheckout-title-container .amcheckout-title,
.checkout-index-index .checkout-shipping-method
.amcheckout-title-container > .amcheckout-title,
.checkout-index-index .amcheckout-payment-methods
.amcheckout-title-container .step-title,
.checkout-index-index .amcheckout-summary-container > .amcheckout-title {
font-size: 2.3rem !important;
}
}
@media (min-width: 768px) {
// The stock desktop field layout gives labels only 25.8% of the modal
// width, which wraps Telephone, Street Address and Zip/Postal Code.
.checkout-index-index .new-shipping-address-modal .esun-checkout-address-form {
.fieldset > .field:not(.choice) > .label {
box-sizing: border-box;
min-width: 32%;
white-space: nowrap;
width: 32%;
}
.fieldset > .field:not(.choice) > .control {
width: 68%;
}
}
}
@@ -0,0 +1,21 @@
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<div class="actions-toolbar">
<div class="primary">
<button class="action action-apply action-update esun-checkout-address-action"
type="button"
click="updateAddress">
<span translate="'Update'"></span>
</button>
<button class="action action-apply action-cancel esun-checkout-address-action"
type="button"
click="cancelAddressEdit"
visible="canUseCancelBillingAddress()">
<span translate="'Cancel'"></span>
</button>
</div>
</div>
@@ -0,0 +1,21 @@
<div class="billing-address-form esun-checkout-address-form">
<!-- ko foreach: getRegion('before-fields') -->
<!-- ko template: getTemplate() --><!-- /ko -->
<!--/ko-->
<form data-bind="attr: {'data-hasrequired': $t('* Required Fields')}">
<fieldset class="fieldset address" data-form="billing-new-address">
<!-- ko foreach: getRegion('additional-fieldsets') -->
<!-- ko template: getTemplate() --><!-- /ko -->
<!--/ko-->
<!-- ko if: (isCustomerLoggedIn && customerHasAddresses) -->
<div class="choice field">
<input type="checkbox" class="checkbox"
data-bind="checked: saveInAddressBook, attr: {id: 'billing-save-in-address-book-' + getCode($parent)}" />
<label class="label" data-bind="attr: {for: 'billing-save-in-address-book-' + getCode($parent)}">
<span data-bind="i18n: 'Save in address book'"></span>
</label>
</div>
<!-- /ko -->
</fieldset>
</form>
</div>
@@ -0,0 +1,30 @@
<div class="shipping-address-item" css="'selected-item' : isSelected() , 'not-selected-item':!isSelected()">
<text args="address().prefix"></text> <text args="address().firstname"></text> <text args="address().middlename"></text>
<text args="address().lastname"></text> <text args="address().suffix"></text><br>
<if args="address().company">
<text args="address().company"></text><br>
</if>
<text args="_.values(_.compact(address().street)).join(', ')"></text><br>
<text args="address().city "></text>, <span text="address().region"></span> <text args="address().postcode"></text><br>
<text args="getCountryName(address().countryId)"></text><br>
<a if="address().telephone" attr="'href': 'tel:' + address().telephone" text="address().telephone"></a><br>
<if args="address().vatId">
<translate args="'VAT'"></translate>: <text args="address().vatId"></text><br>
</if>
<each args="data: address().customAttributes, as: 'element'">
<text args="$parent.getCustomAttributeLabel(element)"></text>
<br>
</each>
<button visible="address().isEditable()" type="button"
class="action edit-address-link"
click="editAddress">
<span translate="'Edit'"></span>
</button>
<if args="!isSelected()">
<button type="button" click="selectAddress"
class="action action-apply action-select-shipping-item esun-checkout-address-action">
<span translate="'Ship Here'"></span>
</button>
</if>
</div>
@@ -0,0 +1,20 @@
<form class="form form-shipping-address esun-checkout-address-form"
id="co-shipping-form"
data-bind="attr: {'data-hasrequired': $t('* Required Fields')}">
<!-- ko foreach: getRegion('before-fields') -->
<!-- ko template: getTemplate() --><!-- /ko -->
<!--/ko-->
<div id="shipping-new-address-form" class="fieldset address">
<!-- ko foreach: getRegion('additional-fieldsets') -->
<!-- ko template: getTemplate() --><!-- /ko -->
<!--/ko-->
<!-- ko if: (isCustomerLoggedIn) -->
<div class="field choice" data-bind="visible: !isFormInline">
<input type="checkbox" class="checkbox" id="shipping-save-in-address-book" data-bind="checked: saveInAddressBook" />
<label class="label" for="shipping-save-in-address-book">
<span data-bind="i18n: 'Save in address book'"></span>
</label>
</div>
<!-- /ko -->
</div>
</form>
@@ -0,0 +1,49 @@
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<!-- ko foreach: getRegion('before_details') -->
<!-- ko template: getTemplate() --><!-- /ko -->
<!-- /ko -->
<div class="product-item-details">
<div class="product-item-inner">
<div class="product-item-name-block">
<strong class="product-item-name" data-bind="html: getNameUnsanitizedHtml($parent)"></strong>
<div class="details-qty">
<span class="label"><!-- ko i18n: 'Qty' --><!-- /ko --></span>
<span class="value" data-bind="text: $parent.qty.toLocaleString(window.LOCALE)"></span>
</div>
</div>
<!-- ko foreach: getRegion('after_details') -->
<!-- ko template: getTemplate() --><!-- /ko -->
<!-- /ko -->
</div>
<!-- ko if: (JSON.parse($parent.options).length > 0)-->
<div class="product options">
<strong class="subtitle"><!-- ko i18n: 'Options Details' --><!-- /ko --></strong>
<dl class="item-options">
<!--ko foreach: JSON.parse($parent.options)-->
<dt class="label" data-bind="text: label"></dt>
<!-- ko if: ($data.full_view)-->
<!-- ko with: {full_viewUnsanitizedHtml: $data.full_view}-->
<dd class="values" data-bind="html: full_viewUnsanitizedHtml"></dd>
<!-- /ko -->
<!-- /ko -->
<!-- ko ifnot: ($data.full_view)-->
<!-- ko with: {valueUnsanitizedHtml: $data.value}-->
<dd class="values" data-bind="html: valueUnsanitizedHtml"></dd>
<!-- /ko -->
<!-- /ko -->
<!-- /ko -->
</dl>
</div>
<!-- /ko -->
</div>
<!-- ko foreach: getRegion('item_message') -->
<!-- ko template: getTemplate() --><!-- /ko -->
<!-- /ko -->
@@ -0,0 +1,8 @@
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="catalog.compare.sidebar" remove="true"/>
<referenceBlock name="wishlist_sidebar" remove="true"/>
</body>
</page>
@@ -0,0 +1,7 @@
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="breadcrumbs" remove="true"/>
</body>
</page>
@@ -0,0 +1,11 @@
<!--@subject {{trans "Welcome to %store_name" store_name=$store.frontend_name}} @-->
<!--@vars {"var store.frontend_name":"Store Name","var this.getUrl($store,'customer/account/',[_nosid:1])":"Customer Account URL","var customer.email":"Customer Email","var customer.name":"Customer Name","var customer.firstname":"Customer First Name"} @-->
{{template config_path="design/email/header_template"}}
<table width="100%" cellpadding="0" cellspacing="0" role="presentation" style="width:100%;border-collapse:collapse">
<tr><td align="center" style="padding:12px 0 0;text-align:center"><h1 style="margin:0 0 16px;color:#171717;font-size:30px;line-height:1.25;font-weight:bold;text-align:center">{{trans "Welcome to %store_name, %firstname!" store_name=$store.frontend_name firstname=$customer.firstname}}</h1><p style="max-width:560px;margin:0 auto;color:#8d8d8d;font-size:16px;line-height:1.65;text-align:center">{{trans "Thanks for creating an account with us. You can now check out faster, track orders, and save your favorite items for next time."}}</p></td></tr>
<tr><td align="center" style="padding:34px 0 44px;text-align:center"><table width="280" cellpadding="0" cellspacing="0" border="0" role="presentation" align="center" style="width:280px;border-collapse:collapse"><tr><td width="280" height="54" bgcolor="#17a957" align="center" valign="middle" style="width:280px;height:54px;padding:0;background-color:#17a957;text-align:center;vertical-align:middle"><a href="{{var this.getUrl($store,'customer/account/',[_nosid:1])}}" style="display:inline-block;padding:15px 30px;border:0;color:#ffffff;font-family:Arial,sans-serif;font-size:16px;line-height:24px;font-weight:bold;text-align:center;text-decoration:none;white-space:nowrap">{{trans "Go to My Account"}}</a></td></tr></table></td></tr>
<tr><td bgcolor="#f7f8f7" style="padding:26px 30px;background:#f7f8f7;border-radius:8px"><h2 style="margin:0 0 20px;color:#17a957;font-size:15px;line-height:1.2;font-weight:bold;text-transform:uppercase">{{trans "Account Details"}}</h2><table width="100%" cellpadding="0" cellspacing="0" role="presentation"><tr><td width="34%" style="padding:5px 0;color:#999;font-size:14px">{{trans "Name"}}</td><td style="padding:5px 0;color:#222;font-size:14px;font-weight:bold">{{var customer.name}}</td></tr><tr><td style="padding:5px 0;color:#999;font-size:14px">{{trans "Email"}}</td><td style="padding:5px 0;color:#222;font-size:14px;font-weight:bold">{{var customer.email}}</td></tr></table></td></tr>
<tr><td style="padding:42px 0 38px;border-bottom:1px solid #eee"><table width="100%" cellpadding="0" cellspacing="0" role="presentation"><tr><td width="33.33%" align="center" style="padding:0 8px;text-align:center;vertical-align:top"><div style="font-size:24px;line-height:1.2">📦</div><p style="margin:12px 0 5px;color:#222;font-size:14px;font-weight:bold">{{trans "Track Orders"}}</p><p style="margin:0;color:#999;font-size:12px;line-height:1.5">{{trans "View order status & history anytime"}}</p></td><td width="33.33%" align="center" style="padding:0 8px;text-align:center;vertical-align:top"><div style="color:#17a957;font-size:31px;line-height:1">♡</div><p style="margin:12px 0 5px;color:#222;font-size:14px;font-weight:bold">{{trans "Save Favorites"}}</p><p style="margin:0;color:#999;font-size:12px;line-height:1.5">{{trans "Create a wishlist of your picks"}}</p></td><td width="33.33%" align="center" style="padding:0 8px;text-align:center;vertical-align:top"><div style="color:#ffad16;font-size:29px;line-height:1">ϟ</div><p style="margin:12px 0 5px;color:#222;font-size:14px;font-weight:bold">{{trans "Faster Checkout"}}</p><p style="margin:0;color:#999;font-size:12px;line-height:1.5">{{trans "Saved address & payment info"}}</p></td></tr></table></td></tr>
<tr><td style="padding:34px 0 4px"><table width="100%" cellpadding="0" cellspacing="0" role="presentation"><tr><td bgcolor="#fff9ee" style="padding:18px 20px;border-left:4px solid #f5b323;border-radius:5px;background:#fff9ee;color:#8a6510;font-size:13px;line-height:1.5">{{trans 'If you did not create this account, please <a href="%contact_url" style="color:#8a6510;font-weight:bold;text-decoration:underline">contact our support team</a> immediately.' contact_url=$this.getUrl($store,'contact/',[_nosid:1]) |raw}}</td></tr></table></td></tr>
</table>
{{template config_path="design/email/footer_template"}}
@@ -0,0 +1,2 @@
<!--@subject {{trans "Please confirm your %store_name account" store_name=$store.frontend_name}} @-->
{{template config_path="design/email/header_template"}}<h1>{{trans "Confirm your account"}}</h1><p class="greeting">{{trans "%name," name=$customer.name}}</p><p>{{trans "You must confirm your %email email before you can sign in." email=$customer.email}}</p><table width="100%" cellpadding="0" cellspacing="0" border="0" role="presentation"><tr><td align="center" style="padding:30px 0"><table width="280" cellpadding="0" cellspacing="0" border="0" role="presentation" align="center" style="width:280px;border-collapse:collapse"><tr><td width="280" height="54" bgcolor="#17a957" align="center" valign="middle" style="width:280px;height:54px;padding:0;background-color:#17a957;text-align:center;vertical-align:middle"><a href="{{var this.getUrl($store,'customer/account/confirm/',[_query:[id:$customer.id,key:$customer.confirmation,back_url:$back_url,email:$customer.email],_nosid:1])}}" style="display:inline-block;padding:15px 30px;border:0;color:#ffffff;font-family:Arial,sans-serif;font-size:16px;line-height:24px;font-weight:bold;text-align:center;text-decoration:none;white-space:nowrap">{{trans "Confirm Your Account"}}</a></td></tr></table></td></tr></table>{{template config_path="design/email/footer_template"}}
@@ -0,0 +1,2 @@
<!--@subject {{trans "Welcome to %store_name" store_name=$store.frontend_name}} @-->
{{template config_path="design/email/header_template"}}<h1>{{trans "Welcome to %store_name" store_name=$store.frontend_name}}</h1><p class="greeting">{{trans "%name," name=$customer.name}}</p><p>{{trans "Your account has been created. Set a password to sign in."}}</p><table width="100%" cellpadding="0" cellspacing="0" border="0" role="presentation"><tr><td align="center" style="padding:30px 0"><table width="280" cellpadding="0" cellspacing="0" border="0" role="presentation" align="center" style="width:280px;border-collapse:collapse"><tr><td width="280" height="54" bgcolor="#17a957" align="center" valign="middle" style="width:280px;height:54px;padding:0;background-color:#17a957;text-align:center;vertical-align:middle"><a href="{{var this.getUrl($store,'customer/account/createPassword/',[_query:[id:$customer.id,token:$customer.rp_token],_nosid:1])}}" style="display:inline-block;padding:15px 30px;border:0;color:#ffffff;font-family:Arial,sans-serif;font-size:16px;line-height:24px;font-weight:bold;text-align:center;text-decoration:none;white-space:nowrap">{{trans "Create Password"}}</a></td></tr></table></td></tr></table><p><strong>{{trans "Email:"}}</strong> {{var customer.email}}</p>{{template config_path="design/email/footer_template"}}
@@ -0,0 +1,2 @@
<!--@subject {{trans "Reset your %store_name password" store_name=$store.frontend_name}} @-->
{{template config_path="design/email/header_template"}}<h1>{{trans "Reset your password"}}</h1><p class="greeting">{{trans "%name," name=$customer.name}}</p><p>{{trans "If you requested this change, set a new password here:"}}</p><table width="100%" cellpadding="0" cellspacing="0" border="0" role="presentation"><tr><td align="center" style="padding:30px 0"><table width="280" cellpadding="0" cellspacing="0" border="0" role="presentation" align="center" style="width:280px;border-collapse:collapse"><tr><td width="280" height="54" bgcolor="#17a957" align="center" valign="middle" style="width:280px;height:54px;padding:0;background-color:#17a957;text-align:center;vertical-align:middle"><a href="{{var this.getUrl($store,'customer/account/createPassword/',[_query:[id:$customer.id,token:$customer.rp_token,email:$customer.email],_nosid:1])}}" style="display:inline-block;padding:15px 30px;border:0;color:#ffffff;font-family:Arial,sans-serif;font-size:16px;line-height:24px;font-weight:bold;text-align:center;text-decoration:none;white-space:nowrap">{{trans "Set a New Password"}}</a></td></tr></table></td></tr></table>{{template config_path="design/email/footer_template"}}
@@ -0,0 +1,7 @@
<!--@subject {{trans "Reset your %store_name password" store_name=$store.frontend_name}} @-->
<!--@vars {"var store.frontend_name":"Store Name","var customer.name":"Customer Name","var this.getUrl($store,'customer/account/createPassword/',[_query:[id:$customer.id,token:$customer.rp_token,email:$customer.email],_nosid:1])":"Reset Password URL"} @-->
{{template config_path="design/email/header_template"}}
<div class="esun-password"><h1>{{trans "Dear Valued Customer:"}}</h1><p>{{trans "This is an automated email from %store_name in response to your request to reset your password. Please do not reply to this email." store_name=$store.frontend_name}}</p><p>{{trans "To reset your password and access your account, click the button below:"}}</p>
<table width="100%" cellpadding="0" cellspacing="0" border="0" role="presentation"><tr><td align="center" style="padding:30px 0"><table width="280" cellpadding="0" cellspacing="0" border="0" role="presentation" align="center" style="width:280px;border-collapse:collapse"><tr><td width="280" height="54" bgcolor="#17a957" align="center" valign="middle" style="width:280px;height:54px;padding:0;background-color:#17a957;text-align:center;vertical-align:middle"><a href="{{var this.getUrl($store,'customer/account/createPassword/',[_query:[id:$customer.id,token:$customer.rp_token,email:$customer.email],_nosid:1])}}" style="display:inline-block;padding:15px 30px;border:0;color:#ffffff;font-family:Arial,sans-serif;font-size:16px;line-height:24px;font-weight:bold;text-align:center;text-decoration:none;white-space:nowrap">{{trans "Set a new password"}}</a></td></tr></table></td></tr></table>
<p>{{trans "The link will take you to our Reset Password page. Choose a new password to access your account."}}</p><p>{{trans "If you did not request this change, you can safely ignore this email. Your password will remain unchanged."}}</p><p>{{trans "Yours sincerely,"}}<br>{{var store.frontend_name}} {{trans "Customer Care Team"}}</p></div>
{{template config_path="design/email/footer_template"}}
@@ -0,0 +1,16 @@
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"
layout="1column">
<head>
<css src="Magento_Customer::css/esun-account.css" />
</head>
<body>
<attribute name="class" value="esun-login-page" />
<referenceBlock name="page.main.title" remove="true" />
<referenceBlock name="breadcrumbs" remove="true" />
<referenceBlock name="customer_form_register" template="Magento_Customer::form/register.phtml" />
</body>
</page>
@@ -0,0 +1,24 @@
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"
layout="1column">
<head>
<css src="Magento_Customer::css/esun-account.css" />
</head>
<body>
<attribute name="class" value="esun-login-page" />
<referenceBlock name="page.main.title" remove="true" />
<referenceBlock name="breadcrumbs" remove="true" />
<referenceBlock name="forgotPassword" template="Magento_Customer::account/forgotpassword.phtml" />
<referenceBlock name="captcha">
<action method="setImgWidth">
<argument name="width" xsi:type="number">240</argument>
</action>
<action method="setImgHeight">
<argument name="height" xsi:type="number">64</argument>
</action>
</referenceBlock>
</body>
</page>
@@ -0,0 +1,21 @@
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"
layout="1column">
<head>
<css src="Magento_Customer::css/esun-account.css" />
</head>
<body>
<attribute name="class" value="esun-login-page" />
<!-- 去掉默认页面标题("客户登录"文字) -->
<referenceBlock name="page.main.title" remove="true" />
<!-- 去掉面包屑 -->
<referenceBlock name="breadcrumbs" remove="true" />
<!-- 去掉右侧/侧栏容器,让主区域全宽 -->
<referenceContainer name="sidebar.additional" remove="true" />
<referenceBlock name="customer_form_login" template="Magento_Customer::form/login.phtml" />
</body>
</page>
@@ -0,0 +1,11 @@
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="page.main.title">
<arguments>
<argument name="css_class" xsi:type="string">esun-address-form-title</argument>
</arguments>
</referenceBlock>
</body>
</page>
@@ -0,0 +1,13 @@
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="page.main.title" remove="true"/>
<referenceBlock name="address_grid" remove="true"/>
<referenceBlock name="address_book">
<arguments>
<argument name="view_model" xsi:type="object">Esun\Customer\ViewModel\AddressBook</argument>
</arguments>
</referenceBlock>
</body>
</page>
@@ -0,0 +1,89 @@
<?php
/**
* @var \Magento\Customer\Block\Account\Forgotpassword $block
* @var \Magento\Framework\Escaper $escaper
*/
?>
<div class="esun-login" id="esun-forgotpassword">
<div class="esun-login__intro">
<div class="esun-login__intro-inner">
<h1 class="esun-login__title"><?= $escaper->escapeHtml(__('Welcome eSUN')) ?></h1>
<p class="esun-login__subtitle">
<?= $escaper->escapeHtml(__('Embark On A 3D Journey')) ?><br>
<?= $escaper->escapeHtml(__('A Provider Of 3D Printing Material Solutions')) ?>
</p>
</div>
</div>
<div class="esun-login__form-wrap">
<div class="esun-login__block" id="forgot-password-wrapper">
<p class="esun-hint">
<?= $escaper->escapeHtml(__('We Will Send You An Email To Reset Your Password')) ?>
</p>
<form class="esun-form"
action="<?= $escaper->escapeUrl($block->getUrl('customer/account/forgotpasswordpost')) ?>"
method="post"
id="form-validate"
data-mage-init='{"validation":{}}'
autocomplete="off">
<?= $block->getBlockHtml('formkey') ?>
<fieldset class="esun-fieldset">
<div class="esun-field esun-field--required field required">
<label class="esun-label" for="email_address"><span><?= $escaper->escapeHtml(__('Email')) ?></span></label>
<div class="esun-control">
<input type="email"
name="email"
id="email_address"
class="esun-input"
placeholder="<?= $escaper->escapeHtmlAttr(__('Your Email')) ?>"
title="<?= $escaper->escapeHtmlAttr(__('Email')) ?>"
value="<?= $escaper->escapeHtmlAttr($block->getEmailValue()) ?>"
data-validate="{required:true, 'validate-email':true}"
autofocus
/>
</div>
</div>
<?= $block->getChildHtml('form_additional_info') ?>
</fieldset>
<div class="esun-actions esun-actions--center">
<button type="submit" class="esun-btn">
<span><?= $escaper->escapeHtml(__('Send')) ?></span>
</button>
<a class="esun-cancel-link" href="<?= $escaper->escapeUrl($block->getUrl('customer/account/login')) ?>">
<?= $escaper->escapeHtml(__('Cancel')) ?>
</a>
</div>
</form>
</div>
</div>
<div class="esun-modal-overlay" id="esun-forgotpassword-modal">
<div class="esun-modal" role="dialog" aria-modal="true" aria-labelledby="esun-fp-modal-message">
<button type="button" class="esun-modal__close" id="esun-forgotpassword-modal-close" aria-label="<?= $escaper->escapeHtmlAttr(__('Close')) ?>">&times;</button>
<p class="esun-modal__message" id="esun-fp-modal-message">
<?= $escaper->escapeHtml(__('We have contacted you email')) ?><br>
<?= $escaper->escapeHtml(__('Please check it.')) ?>
</p>
<div class="esun-modal__actions">
<button type="button" class="esun-btn" id="esun-forgotpassword-modal-confirm">
<span><?= $escaper->escapeHtml(__('Confirm')) ?></span>
</button>
</div>
</div>
</div>
</div>
<script type="text/x-magento-init">
{
"#esun-forgotpassword": {
"Magento_Customer/js/esun-forgotpassword": {
"redirectUrl": "<?= $escaper->escapeUrl($block->getUrl('customer/account/login')) ?>"
}
}
}
</script>
@@ -0,0 +1,163 @@
<?php
/**
* eSUN customer address book.
*
* @var \Magento\Customer\Block\Address\Book $block
* @var \Magento\Framework\Escaper $escaper
* @var \Esun\Customer\ViewModel\AddressBook $viewModel
*/
$viewModel = $block->getData('view_model');
$defaultShippingId = (int) $block->getDefaultShipping();
$defaultBillingId = (int) $block->getDefaultBilling();
$defaultShipping = $defaultShippingId ? $block->getAddressById($defaultShippingId) : null;
$defaultBilling = $defaultBillingId ? $block->getAddressById($defaultBillingId) : null;
$additionalAddresses = $block->getAdditionalAddresses();
$shippingAddresses = [];
if ($defaultShipping instanceof \Magento\Customer\Api\Data\AddressInterface) {
$shippingAddresses[] = $defaultShipping;
}
if (is_array($additionalAddresses)) {
foreach ($additionalAddresses as $address) {
if ($address instanceof \Magento\Customer\Api\Data\AddressInterface) {
$shippingAddresses[] = $address;
}
}
}
?>
<section class="esun-address-book" data-mage-init='{"Esun_Customer/js/address-book":{}}'>
<h1 class="esun-address-book__title"><?= $escaper->escapeHtml(__('Manage Address Book')) ?></h1>
<nav class="esun-address-book__tabs" aria-label="<?= $escaper->escapeHtmlAttr(__('Address type')) ?>">
<button class="esun-address-book__tab is-active"
type="button"
data-address-tab="shipping"
aria-selected="true">
<?= $escaper->escapeHtml(__('Shipping Address')) ?>
</button>
<button class="esun-address-book__tab"
type="button"
data-address-tab="billing"
aria-selected="false">
<?= $escaper->escapeHtml(__('Billing Address')) ?>
</button>
<a class="esun-address-book__add" href="<?= $escaper->escapeUrl($block->getAddAddressUrl()) ?>">
<span class="esun-address-book__add-icon" aria-hidden="true">+</span>
<?= $escaper->escapeHtml(__('Add New Address')) ?>
</a>
</nav>
<div class="esun-address-book__panel is-active" data-address-panel="shipping">
<?php if ($shippingAddresses): ?>
<div class="esun-address-book__grid">
<?php foreach ($shippingAddresses as $address): ?>
<?php $addressId = (int) $address->getId(); ?>
<article class="esun-address-card">
<div class="esun-address-card__content">
<div class="esun-address-card__identity">
<strong><?= $escaper->escapeHtml($viewModel->getName($address)) ?></strong>
<?php if ($address->getTelephone()): ?>
<a href="tel:<?= $escaper->escapeHtmlAttr($address->getTelephone()) ?>">
<?= $escaper->escapeHtml($address->getTelephone()) ?>
</a>
<?php endif; ?>
</div>
<address>
<?php foreach ($viewModel->getStreetLines($address) as $streetLine): ?>
<span><?= $escaper->escapeHtml($streetLine) ?></span>
<?php endforeach; ?>
<?php if ($locality = $viewModel->getLocalityLine($address)): ?>
<span><?= $escaper->escapeHtml($locality) ?></span>
<?php endif; ?>
<?php if ($country = $viewModel->getCountryName($address)): ?>
<span><?= $escaper->escapeHtml($country) ?></span>
<?php endif; ?>
</address>
</div>
<div class="esun-address-card__actions">
<?php if ($addressId === $defaultShippingId): ?>
<span class="esun-address-card__default">
<?= $escaper->escapeHtml(__('Default')) ?>
</span>
<?php endif; ?>
<?php if ($addressId !== $defaultShippingId && $addressId !== $defaultBillingId): ?>
<a class="action delete"
href="#"
role="delete-address"
data-address="<?= $escaper->escapeHtmlAttr((string) $addressId) ?>">
<?= $escaper->escapeHtml(__('Delete')) ?>
</a>
<?php endif; ?>
<a class="action edit"
href="<?= $escaper->escapeUrl($block->getAddressEditUrl($addressId)) ?>">
<?= $escaper->escapeHtml(__('Edit')) ?>
</a>
</div>
</article>
<?php endforeach; ?>
</div>
<?php else: ?>
<div class="esun-address-book__empty">
<?= $escaper->escapeHtml(__('You have no shipping address in your address book.')) ?>
</div>
<?php endif; ?>
</div>
<div class="esun-address-book__panel" data-address-panel="billing" hidden>
<?php if ($defaultBilling): ?>
<div class="esun-address-book__grid">
<article class="esun-address-card">
<div class="esun-address-card__content">
<div class="esun-address-card__identity">
<strong><?= $escaper->escapeHtml($viewModel->getName($defaultBilling)) ?></strong>
<?php if ($defaultBilling->getTelephone()): ?>
<a href="tel:<?= $escaper->escapeHtmlAttr($defaultBilling->getTelephone()) ?>">
<?= $escaper->escapeHtml($defaultBilling->getTelephone()) ?>
</a>
<?php endif; ?>
</div>
<address>
<?php foreach ($viewModel->getStreetLines($defaultBilling) as $streetLine): ?>
<span><?= $escaper->escapeHtml($streetLine) ?></span>
<?php endforeach; ?>
<?php if ($locality = $viewModel->getLocalityLine($defaultBilling)): ?>
<span><?= $escaper->escapeHtml($locality) ?></span>
<?php endif; ?>
<?php if ($country = $viewModel->getCountryName($defaultBilling)): ?>
<span><?= $escaper->escapeHtml($country) ?></span>
<?php endif; ?>
</address>
</div>
<div class="esun-address-card__actions">
<span class="esun-address-card__default">
<?= $escaper->escapeHtml(__('Default')) ?>
</span>
<a class="action edit"
href="<?= $escaper->escapeUrl($block->getAddressEditUrl($defaultBillingId)) ?>">
<?= $escaper->escapeHtml(__('Edit')) ?>
</a>
</div>
</article>
</div>
<?php else: ?>
<div class="esun-address-book__empty">
<p><?= $escaper->escapeHtml(__('You have no default billing address in your address book.')) ?></p>
<a class="action primary" href="<?= $escaper->escapeUrl($block->getAddAddressUrl()) ?>">
<?= $escaper->escapeHtml(__('Add New Address')) ?>
</a>
</div>
<?php endif; ?>
</div>
</section>
<script type="text/x-magento-init">
{
".esun-address-book": {
"address": {
"deleteAddress": "a[role='delete-address']",
"deleteUrlPrefix": "<?= $escaper->escapeJs($escaper->escapeUrl($block->getDeleteUrl())) ?>id/"
}
}
}
</script>
@@ -0,0 +1,101 @@
<?php
/**
*
* @var \Magento\Customer\Block\Form\Login $block
* @var \Magento\Framework\Escaper $escaper
*/
?>
<?php
$postActionUrl = $block->getPostActionUrl();
?>
<div class="esun-login">
<div class="esun-login__intro">
<div class="esun-login__intro-inner">
<h1 class="esun-login__title"><?= $escaper->escapeHtml(__('Welcome eSUN')) ?></h1>
<p class="esun-login__subtitle">
<?= $escaper->escapeHtml(__('Embark On A 3D Journey')) ?><br>
<?= $escaper->escapeHtml(__('A Provider Of 3D Printing Material Solutions')) ?>
</p>
</div>
</div>
<div class="esun-login__form-wrap">
<div class="esun-login__block" id="login-form-wrapper">
<form class="esun-form"
action="<?= $escaper->escapeUrl($postActionUrl) ?>"
method="post"
id="login-form"
data-mage-init='{"validation":{}}'>
<?= $block->getBlockHtml('formkey') ?>
<input name="context" type="hidden" value="checkout" />
<fieldset class="esun-fieldset">
<?= $block->getChildHtml('form_fields_before') ?>
<div class="esun-field field required">
<label class="esun-label" for="email"><span><?= $escaper->escapeHtml(__('Email')) ?></span></label>
<div class="esun-control">
<input name="login[username]"
id="email"
type="email"
class="esun-input"
placeholder="<?= $escaper->escapeHtmlAttr(__('Your Email')) ?>"
title="<?= $escaper->escapeHtmlAttr(__('Email')) ?>"
value="<?= $escaper->escapeHtmlAttr($block->getUsername()) ?>"
autofocus
data-validate="{required:true, 'validate-email':true}" />
</div>
</div>
<div class="esun-field field required">
<label class="esun-label" for="pass"><span><?= $escaper->escapeHtml(__('Password')) ?></span></label>
<div class="esun-control esun-control--password">
<input name="login[password]"
type="password"
class="esun-input"
id="pass"
placeholder="<?= $escaper->escapeHtmlAttr(__('Your Password')) ?>"
title="<?= $escaper->escapeHtmlAttr(__('Password')) ?>"
data-validate="{required:true}"
autocomplete="off" />
<button type="button" class="esun-password-toggle" aria-label="<?= $escaper->escapeHtmlAttr(__('Show/Hide Password')) ?>">
<span class="esun-icon-eye"></span>
</button>
</div>
</div>
<?= $block->getChildHtml('form_additional_info') ?>
</fieldset>
<div class="esun-actions">
<div class="esun-actions__left">
<button type="submit" class="esun-btn">
<span><?= $escaper->escapeHtml(__('Log In')) ?></span>
</button>
</div>
<div class="esun-actions__right">
<a class="esun-btn" href="<?= $escaper->escapeUrl($block->getUrl('customer/account/create')) ?>">
<?= $escaper->escapeHtml(__('Create an Account')) ?>
</a>
</div>
</div>
<div class="forgot-box">
<a class="esun-link" href="<?= $escaper->escapeUrl($block->getForgotPasswordUrl()) ?>">
<?= $escaper->escapeHtml(__('Forgot Your Password?')) ?>
</a>
</div>
</form>
</div>
</div>
</div>
<script type="text/x-magento-init">
{
".esun-login": {
"Magento_Customer/js/esun-login-password-toggle": {}
}
}
</script>
@@ -0,0 +1,192 @@
<?php
/**
* @var \Magento\Customer\Block\Form\Register $block
* @var \Magento\Framework\Escaper $escaper
*/
$subscriptionPromotion = $block->getData('subscription_promotion');
$showSubscriptionReminder = $subscriptionPromotion instanceof
\Esun\CustomerCoupon\ViewModel\RegistrationSubscriptionPromotion
&& $subscriptionPromotion->isReminderEnabled();
$subscriptionReminderMessage = $showSubscriptionReminder
? $subscriptionPromotion->getReminderMessage()
: '';
$subscriptionDiscountLabel = $showSubscriptionReminder
? $subscriptionPromotion->getDiscountLabel()
: '';
$subscriptionModalConfig = $showSubscriptionReminder
? [
'modalTitle' => (string)__('Do you want to give up this offer?'),
'subscribeButtonText' => (string)__('Subscribe and Get %1', $subscriptionDiscountLabel),
'declineButtonText' => (string)__('Give Up Offer and Continue')
]
: [];
?>
<div class="esun-login">
<div class="esun-login__intro">
<div class="esun-login__intro-inner">
<h1 class="esun-login__title"><?= $escaper->escapeHtml(__('Welcome eSUN')) ?></h1>
<p class="esun-login__subtitle">
<?= $escaper->escapeHtml(__('Embark On A 3D Journey')) ?><br>
<?= $escaper->escapeHtml(__('A Provider Of 3D Printing Material Solutions')) ?>
</p>
</div>
</div>
<div class="esun-login__form-wrap">
<div class="esun-login__block esun-login__block--wide" id="register-form-wrapper">
<form class="esun-form"
action="<?= $escaper->escapeUrl($block->getUrl('customer/account/createPost')) ?>"
method="post"
id="form-validate"
data-mage-init='{"validation":{}}'
autocomplete="off">
<?= $block->getBlockHtml('formkey') ?>
<?= $block->getChildHtml('form_fields_before') ?>
<fieldset class="esun-fieldset">
<div class="esun-field-row">
<div class="esun-field field required">
<label class="esun-label" for="lastname"><span><?= $escaper->escapeHtml(__('Last Name')) ?></span></label>
<div class="esun-control">
<input type="text"
id="lastname"
name="lastname"
class="esun-input"
placeholder="<?= $escaper->escapeHtmlAttr(__('Last Name')) ?>"
title="<?= $escaper->escapeHtmlAttr(__('Last Name')) ?>"
value="<?= $escaper->escapeHtmlAttr($block->getFormData()->getLastname()) ?>"
data-validate="{required:true}"
/>
</div>
</div>
<div class="esun-field field required">
<label class="esun-label" for="firstname"><span><?= $escaper->escapeHtml(__('First Name')) ?></span></label>
<div class="esun-control">
<input type="text"
id="firstname"
name="firstname"
class="esun-input"
placeholder="<?= $escaper->escapeHtmlAttr(__('First Name')) ?>"
title="<?= $escaper->escapeHtmlAttr(__('First Name')) ?>"
value="<?= $escaper->escapeHtmlAttr($block->getFormData()->getFirstname()) ?>"
data-validate="{required:true}"
/>
</div>
</div>
</div>
<div class="esun-field field required">
<label class="esun-label" for="email_address"><span><?= $escaper->escapeHtml(__('Email')) ?></span></label>
<div class="esun-control">
<input type="email"
name="email"
id="email_address"
class="esun-input"
placeholder="<?= $escaper->escapeHtmlAttr(__('Your Email')) ?>"
title="<?= $escaper->escapeHtmlAttr(__('Email')) ?>"
value="<?= $escaper->escapeHtmlAttr($block->getFormData()->getEmail()) ?>"
data-validate="{required:true, 'validate-email':true}"
/>
</div>
</div>
<div class="esun-field field required">
<label class="esun-label" for="password"><span><?= $escaper->escapeHtml(__('Password')) ?></span></label>
<div class="esun-control esun-control--password">
<input type="password"
name="password"
id="password"
class="esun-input"
placeholder="<?= $escaper->escapeHtmlAttr(__('Your Password')) ?>"
title="<?= $escaper->escapeHtmlAttr(__('Password')) ?>"
data-validate="{required:true, 'validate-password':true}"
autocomplete="off"
/>
<button type="button" class="esun-password-toggle" aria-label="<?= $escaper->escapeHtmlAttr(__('Show/Hide Password')) ?>">
<span class="esun-icon-eye"></span>
</button>
</div>
<p class="esun-field-note"><?= $escaper->escapeHtml(__('6-16 characters, combination of letters and numbers')) ?></p>
</div>
<div class="esun-field field required">
<label class="esun-label" for="password-confirmation"><span><?= $escaper->escapeHtml(__('Confirm Password')) ?></span></label>
<div class="esun-control esun-control--password">
<input type="password"
name="password_confirmation"
id="password-confirmation"
class="esun-input validate-cpassword"
placeholder="<?= $escaper->escapeHtmlAttr(__('Your Password')) ?>"
title="<?= $escaper->escapeHtmlAttr(__('Confirm Password')) ?>"
data-validate="{required:true}"
autocomplete="off"
/>
<button type="button" class="esun-password-toggle" aria-label="<?= $escaper->escapeHtmlAttr(__('Show/Hide Password')) ?>">
<span class="esun-icon-eye"></span>
</button>
</div>
</div>
<?= $block->getChildHtml('form_additional_info') ?>
<div class="esun-checkbox-field">
<input type="checkbox" id="agreement" name="agreement" value="1" data-validate="{required:true}" />
<label for="agreement">
<?= $escaper->escapeHtml(__('I have read and agree to the User')) ?>
<a href="#"><?= $escaper->escapeHtml(__('Registration Agreement')) ?></a>
<?= $escaper->escapeHtml(__('and the')) ?>
<a href="#"><?= $escaper->escapeHtml(__('Privacy Policy.')) ?></a>
</label>
</div>
<div class="esun-checkbox-field<?= $showSubscriptionReminder
? ' esun-checkbox-field--subscription'
: '' ?>"
<?php if ($showSubscriptionReminder): ?>data-role="subscription-reminder"<?php endif; ?>>
<input type="checkbox"
id="is_subscribed"
name="is_subscribed"
value="1"
<?php if ($showSubscriptionReminder): ?>aria-describedby="subscription-reminder-message"<?php endif; ?> />
<label for="is_subscribed">
<?= $escaper->escapeHtml(__('Subscribe to our weekly newsletters, security advisories, and promotional offers. (You can opt-out at any time).')) ?>
</label>
<?php if ($showSubscriptionReminder): ?>
<div class="esun-subscription-confirmation"
id="subscription-reminder-message"
data-role="subscription-confirmation">
<p><?= $escaper->escapeHtml($subscriptionReminderMessage) ?></p>
<p><?= $escaper->escapeHtml(
__('You can still create your account without subscribing.')
) ?></p>
</div>
<?php endif; ?>
</div>
</fieldset>
<div class="esun-actions">
<button type="submit" class="esun-btn esun-btn--block" title="<?= $escaper->escapeHtmlAttr(__('Create Account')) ?>">
<span><?= $escaper->escapeHtml(__('Create Account')) ?></span>
</button>
</div>
</form>
</div>
</div>
</div>
<script type="text/x-magento-init">
{
".esun-login": {
"Magento_Customer/js/esun-login-password-toggle": {}
<?php if ($showSubscriptionReminder): ?>,
"Magento_Customer/js/esun-register-subscription":
<?= /* @noEscape */ json_encode(
$subscriptionModalConfig,
JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_AMP | JSON_HEX_QUOT
) ?>
<?php endif; ?>
}
}
</script>
@@ -0,0 +1,737 @@
:root {
--esun-green: #1e9e5a;
--esun-green-dark: #178049;
--esun-text-dark: #1a1a1a;
--esun-text-gray: #8a8a8a;
--esun-placeholder: #a3a3a3;
--esun-border: #d9dde1;
--esun-bg-mint: #e9f7f1;
--esun-required: #e02020;
}
.esun-login-page .block-new-customer {
display: none;
}
/* ---------------------------------------------------------------------
0. 兜底重置:以防有第三方模块给裸的 fieldset/legend 加了默认边框
--------------------------------------------------------------------- */
.esun-login-page fieldset.esun-fieldset {
border: 0;
margin: 0;
padding: 0;
min-width: 0;
}
/* ---------------------------------------------------------------------
1. 页面整体:登录 / 找回密码 / 注册 三个入口页公用同一个 body class
--------------------------------------------------------------------- */
.esun-login-page .page-wrapper {
display: flex;
flex-direction: column;
min-height: 100vh;
}
.esun-login-page .page-main {
max-width: none;
padding: 0;
margin: 0;
}
.esun-login-page .columns {
flex: 1 0 auto;
display: flex;
width: 100%;
}
.esun-login-page .columns .column.main {
padding: 0;
flex: 1 0 auto;
display: flex;
flex-direction: column;
}
/* 背景铺满整个视口宽度和高度,内容区域另外限宽居中(见 .esun-login) */
.esun-login-page .column.main,
.esun-login-page .page-main {
background:
radial-gradient(
circle at 15% 20%,
#d7f0e6 0%,
rgba(215, 240, 230, 0) 45%
),
linear-gradient(
120deg,
var(--esun-bg-mint) 0%,
#ffffff 60%,
#ffffff 100%
);
}
/* ---------------------------------------------------------------------
2. 分屏容器(登录 / 找回密码 / 注册 共用)
--------------------------------------------------------------------- */
.esun-login {
display: flex;
flex-wrap: wrap;
width: 100%;
flex: 1 0 auto;
min-height: 720px;
align-items: center;
max-width: 1600px;
margin: 0 auto;
padding: 60px 8%;
box-sizing: border-box;
}
.esun-login__intro {
flex: 1 1 420px;
padding-right: 40px;
}
.esun-login__intro-inner {
max-width: 420px;
}
.esun-login__title {
font-size: 40px;
font-weight: 800;
color: var(--esun-text-dark);
margin: 0 0 24px;
line-height: 1.2;
}
.esun-login__subtitle {
font-size: 18px;
color: var(--esun-text-dark);
line-height: 1.7;
margin: 0;
}
.esun-login__form-wrap {
flex: 1 1 420px;
display: flex;
justify-content: center;
}
.esun-login__block {
width: 100%;
max-width: 460px;
}
/* 注册页表单更宽,占两列,需要更大的最大宽度 */
.esun-login__block--wide {
max-width: 520px;
}
/* ---------------------------------------------------------------------
3. 表单公共部分(输入框 / label / 必填星号)
--------------------------------------------------------------------- */
.esun-form {
width: 100%;
}
.esun-fieldset {
margin: 0;
border: 0;
padding: 0;
}
.esun-hint {
font-size: 13px;
font-weight: 700;
letter-spacing: 0.4px;
color: var(--esun-text-dark);
text-transform: uppercase;
margin: 0 0 26px;
}
.esun-field {
margin: 0 0 22px;
}
.esun-field--required .esun-label span:after {
content: "*";
color: var(--esun-required);
margin-left: 2px;
}
/* 姓/名 两列布局(注册页) */
.esun-field-row {
display: flex;
gap: 24px;
margin-bottom: 22px;
}
.esun-field-row .esun-field {
flex: 1 1 0;
margin-bottom: 0;
}
.esun-label {
display: block;
font-size: 15px;
color: var(--esun-text-dark);
margin: 0 0 8px;
font-weight: 400;
}
.esun-control {
position: relative;
}
.esun-login input[type="text"],
.esun-login input[type="password"],
.esun-login input[type="number"],
.esun-login input[type="email"] {
width: 100%;
height: 48px;
box-sizing: border-box;
border: 1px solid var(--esun-border);
border-radius: 24px;
padding: 0 20px;
margin: 0;
font-size: 15px;
color: var(--esun-text-dark);
background: #fff;
box-shadow: none;
transition: border-color 0.2s ease;
}
.esun-input::placeholder {
color: var(--esun-placeholder);
opacity: 1;
}
.esun-input:focus {
outline: none;
box-shadow: none;
border-color: var(--esun-green);
}
.esun-field-note {
font-size: 12px;
color: var(--esun-text-gray);
margin: 8px 0 0;
}
/* 密码显隐按钮 */
.esun-control--password .esun-input {
padding-right: 46px;
}
.esun-password-toggle {
position: absolute;
right: 16px;
/* Keep the icon centered in the 48px input when validation text is added. */
top: 24px;
transform: translateY(-50%);
border: 0;
background: transparent;
padding: 0;
cursor: pointer;
width: 20px;
height: 20px;
display: flex;
align-items: center;
justify-content: center;
}
.esun-icon-eye {
display: inline-block;
width: 20px;
height: 20px;
}
.esun-icon-eye:before {
content: "";
display: block;
width: 20px;
height: 20px;
background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23a3a3a3" stroke-width="1.6"><path d="M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7-10-7-10-7z"/><circle cx="12" cy="12" r="3"/><line x1="3" y1="21" x2="21" y2="3"/></svg>');
background-size: contain;
background-repeat: no-repeat;
}
.esun-password-toggle--visible .esun-icon-eye:before {
background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%231e9e5a" stroke-width="1.6"><path d="M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7-10-7-10-7z"/><circle cx="12" cy="12" r="3"/></svg>');
}
input.mage-error,
select.mage-error,
textarea.mage-error {
border-color: #ed8380 !important;
}
/* Forgot-password CAPTCHA: readable, compact, and isolated from other forms. */
#esun-forgotpassword .field.captcha {
margin: 0 0 24px;
}
#esun-forgotpassword .field.captcha > .label {
color: var(--esun-text-dark);
display: block;
font-size: 15px;
font-weight: 400;
line-height: 1.4;
margin: 0 0 8px;
}
#esun-forgotpassword .control.captcha > .input-text {
margin: 0;
}
#esun-forgotpassword .control.captcha > .nested {
margin-top: 14px;
}
#esun-forgotpassword .field.captcha.no-label {
margin: 0;
}
#esun-forgotpassword .control.captcha-image {
align-items: center;
display: flex;
flex-wrap: wrap;
gap: 12px;
margin: 0;
}
#esun-forgotpassword .captcha-img {
background: #fff;
border: 1px solid var(--esun-border) !important;
border-radius: 10px;
box-sizing: border-box;
display: block;
height: 64px;
margin: 0;
max-width: 100%;
object-fit: contain;
width: 240px;
}
#esun-forgotpassword .captcha-reload {
align-items: center;
background: #fff;
border: 1px solid var(--esun-border);
border-radius: 22px;
box-shadow: none;
color: var(--esun-green-dark);
display: inline-flex;
font-size: 14px;
font-weight: 700;
height: 44px;
justify-content: center;
line-height: 1;
margin: 0;
padding: 0 18px;
transition:
background-color 0.2s ease,
border-color 0.2s ease,
color 0.2s ease;
white-space: nowrap;
}
#esun-forgotpassword .captcha-reload:hover,
#esun-forgotpassword .captcha-reload:focus {
background: var(--esun-bg-mint);
border-color: var(--esun-green);
box-shadow: none;
color: var(--esun-green-dark);
}
#esun-forgotpassword .captcha-reload:focus-visible {
outline: 2px solid var(--esun-green);
outline-offset: 2px;
}
#esun-forgotpassword .captcha-note,
#esun-forgotpassword .field.captcha .mage-error {
color: var(--esun-text-gray);
font-size: 12px;
line-height: 1.5;
margin-top: 8px;
}
/* 勾选框(注册协议 / 订阅) */
.esun-checkbox-field {
margin-bottom: 10px;
}
.esun-checkbox-field input[type="checkbox"] {
width: 16px;
height: 16px;
margin: 3px 0 0;
accent-color: var(--esun-green);
flex: 0 0 auto;
}
.esun-checkbox-field label {
font-size: 13px;
color: var(--esun-text-gray);
line-height: 1.6;
font-weight: 400;
}
.esun-checkbox-field a {
color: var(--esun-text-dark);
text-decoration: underline;
}
.esun-subscription-confirmation {
color: #18a957;
display: none;
font-size: 18px;
font-weight: 600;
line-height: 1.6;
text-align: center;
}
.esun-subscription-confirmation p {
margin: 0 0 10px;
}
.esun-subscription-confirmation p:last-child {
color: var(--esun-text-dark);
font-size: 14px;
font-weight: 400;
margin-bottom: 0;
}
.modal-popup.esun-subscription-modal .modal-inner-wrap {
background: #fff;
border-radius: 12px;
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
box-sizing: border-box;
margin: 0 auto;
max-width: 560px;
min-height: 0;
overflow: hidden;
top: 50%;
transform: translateY(-200vh);
width: calc(100% - 40px);
}
.modal-popup.esun-subscription-modal._show .modal-inner-wrap {
transform: translateY(-50%);
}
.modal-popup.esun-subscription-modal .modal-header {
padding: 44px 64px 0;
text-align: center;
}
.modal-popup.esun-subscription-modal .modal-title {
border: 0;
color: var(--esun-text-dark);
font-size: 24px;
font-weight: 700;
line-height: 1.35;
margin: 0;
padding: 0;
}
.modal-popup.esun-subscription-modal .action-close {
background: transparent;
border: 0;
color: var(--esun-text-dark);
height: 32px;
padding: 0;
right: 18px;
top: 18px;
transition:
color 160ms ease,
transform 160ms ease;
width: 32px;
}
.modal-popup.esun-subscription-modal .action-close:hover,
.modal-popup.esun-subscription-modal .action-close:focus {
color: var(--esun-green);
transform: rotate(90deg);
}
.modal-popup.esun-subscription-modal .modal-content {
padding: 22px 40px 4px;
}
.esun-subscription-modal .modal-footer {
display: flex;
flex-wrap: wrap;
gap: 10px;
justify-content: center;
padding: 24px 40px 40px;
}
.esun-subscription-modal .modal-footer .action {
border-radius: 24px;
box-shadow: none;
box-sizing: border-box;
font-size: 15px;
font-weight: 700;
line-height: 20px;
margin: 0;
min-height: 48px;
padding: 13px 24px;
transition:
background-color 160ms ease,
border-color 160ms ease,
color 160ms ease;
}
.esun-subscription-modal .modal-footer .action.secondary {
background: #fff;
border: 1px solid var(--esun-border);
color: var(--esun-text-dark);
}
.esun-subscription-modal .modal-footer .action.secondary:hover,
.esun-subscription-modal .modal-footer .action.secondary:focus {
background: var(--esun-bg-mint);
border-color: var(--esun-green);
color: var(--esun-green-dark);
}
.esun-subscription-modal .modal-footer .action.primary {
background: var(--esun-green);
border: 1px solid var(--esun-green);
color: #fff;
}
.esun-subscription-modal .modal-footer .action.primary:hover,
.esun-subscription-modal .modal-footer .action.primary:focus {
background: var(--esun-green-dark);
border-color: var(--esun-green-dark);
color: #fff;
}
@media (max-width: 767px) {
.esun-login__form-wrap {
flex: 1 1 320px;
}
.modal-popup.esun-subscription-modal.modal-slide {
left: 0;
}
.modal-popup.esun-subscription-modal .modal-inner-wrap {
height: auto;
max-height: calc(100vh - 32px);
position: absolute;
width: calc(100% - 32px);
}
.modal-popup.esun-subscription-modal .modal-header {
padding: 40px 48px 0;
}
.modal-popup.esun-subscription-modal .modal-title {
font-size: 21px;
}
.modal-popup.esun-subscription-modal .modal-content {
padding: 18px 24px 4px;
}
.esun-subscription-confirmation {
font-size: 16px;
}
.esun-subscription-modal .modal-footer {
flex-direction: column-reverse;
padding: 22px 24px 28px;
}
.esun-subscription-modal .modal-footer .action {
width: 100%;
}
}
@media (prefers-reduced-motion: reduce) {
.modal-popup.esun-subscription-modal .action-close,
.esun-subscription-modal .modal-footer .action {
transition: none;
}
}
/* ---------------------------------------------------------------------
4. 按钮 / 底部操作区
--------------------------------------------------------------------- */
.esun-actions {
display: flex;
align-items: center;
justify-content: space-between;
margin-top: 8px;
flex-wrap: wrap;
gap: 16px;
}
.esun-actions--center {
justify-content: flex-start;
gap: 24px;
}
.esun-btn {
display: inline-block;
background: var(--esun-green);
border: 0;
border-radius: 24px;
color: #fff;
font-size: 15px;
font-weight: 700;
letter-spacing: 0.5px;
padding: 14px 40px;
line-height: normal;
cursor: pointer;
box-shadow: none;
transition: background-color 0.2s ease;
}
.esun-btn:hover,
.esun-btn:focus {
background: var(--esun-green-dark);
border: none;
color: #fff;
}
.esun-actions__right a {
color: #fff;
}
.esun-btn--block {
width: 100%;
text-align: center;
}
.esun-link {
font-size: 13px;
font-weight: 700;
letter-spacing: 0.5px;
color: var(--esun-text-gray) !important;
text-decoration: underline;
text-transform: uppercase;
}
.esun-link:hover {
color: var(--esun-green);
}
.esun-cancel-link {
font-size: 15px;
font-weight: 700;
color: var(--esun-text-gray);
text-decoration: underline;
text-transform: none;
}
.esun-cancel-link:hover {
color: var(--esun-green);
}
/* ---------------------------------------------------------------------
5. 找回密码成功弹窗
--------------------------------------------------------------------- */
.esun-modal-overlay {
position: fixed;
inset: 0;
background: rgba(20, 30, 26, 0.35);
display: none;
align-items: center;
justify-content: center;
z-index: 900;
padding: 20px;
}
.esun-modal-overlay.esun-modal-overlay--open {
display: flex;
}
.esun-modal {
background: #fff;
border-radius: 12px;
width: 100%;
max-width: 560px;
padding: 56px 40px 40px;
position: relative;
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
text-align: center;
}
.esun-modal__close {
position: absolute;
top: 20px;
right: 20px;
width: 24px;
height: 24px;
border: 0;
background: transparent;
cursor: pointer;
color: var(--esun-text-dark);
font-size: 20px;
line-height: 1;
}
.esun-modal__message {
font-size: 20px;
color: var(--esun-text-dark);
line-height: 1.6;
margin: 0 0 32px;
}
.esun-modal__actions {
display: flex;
justify-content: center;
}
/* ---------------------------------------------------------------------
6. 响应式
--------------------------------------------------------------------- */
@media (max-width: 768px) {
.esun-login {
flex-direction: column;
padding: 40px 24px;
min-height: auto;
}
.forgot-box {
text-align: center;
}
.esun-login__intro {
padding-right: 0;
margin-bottom: 40px;
text-align: center;
flex: auto;
}
.esun-login__intro-inner {
max-width: none;
}
.esun-login__title {
font-size: 30px;
}
.esun-actions {
justify-content: center;
text-align: center;
}
.esun-field-row {
flex-direction: column;
gap: 22px;
}
.esun-modal {
padding: 40px 24px 28px;
}
#esun-forgotpassword .control.captcha-image {
align-items: flex-start;
flex-direction: column;
}
#esun-forgotpassword .captcha-reload {
height: 42px;
}
}
@@ -0,0 +1,77 @@
define([
'jquery',
'mage/validation'
], function ($) {
'use strict';
$.widget('mage.esunForgotpassword', {
options: {
redirectUrl: ''
},
/** @inheritdoc */
_create: function () {
this.$form = this.element.find('#form-validate');
this.$modal = this.element.find('#esun-forgotpassword-modal');
this.$form.on('submit', $.proxy(this._onSubmit, this));
this.element.on('click', '#esun-forgotpassword-modal-confirm', $.proxy(this._onConfirm, this));
this.element.on('click', '#esun-forgotpassword-modal-close', $.proxy(this._closeModal, this));
},
/**
*
* @param {Event} event
* @private
*/
_onSubmit: function (event) {
var self = this,
$form = this.$form;
if (!$form.validation('isValid')) {
return;
}
event.preventDefault();
$.ajax({
url: $form.attr('action'),
data: $form.serialize(),
type: 'post',
dataType: 'html',
showLoader: true
}).done(function () {
self._openModal();
}).fail(function () {
// 网络/服务器异常时,退回默认行为,直接提交表单
$form.off('submit').trigger('submit');
});
},
/**
* 打开成功提示弹窗
* @private
*/
_openModal: function () {
this.$modal.addClass('esun-modal-overlay--open');
},
/**
* 关闭弹窗(不跳转)
* @private
*/
_closeModal: function () {
this.$modal.removeClass('esun-modal-overlay--open');
},
/**
* 点击 Confirm 后跳转回登录页
* @private
*/
_onConfirm: function () {
window.location.href = this.options.redirectUrl;
}
});
return $.mage.esunForgotpassword;
});
@@ -0,0 +1,34 @@
define([
'jquery'
], function ($) {
'use strict';
$.widget('mage.esunLoginPasswordToggle', {
options: {},
/** @inheritdoc */
_create: function () {
this.element.on('click', '.esun-password-toggle', $.proxy(this._toggle, this));
},
/**
*
* @param {Event} event
* @private
*/
_toggle: function (event) {
var $button = $(event.currentTarget),
$input = $button.siblings('.esun-input');
if ($input.attr('type') === 'password') {
$input.attr('type', 'text');
$button.addClass('esun-password-toggle--visible');
} else {
$input.attr('type', 'password');
$button.removeClass('esun-password-toggle--visible');
}
}
});
return $.mage.esunLoginPasswordToggle;
});

Some files were not shown because too many files have changed in this diff Show More