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,987 @@
body.esun-cart-is-open {
overflow: hidden;
}
.header-top-link-item.header-minicart .esun-cart-wrapper {
position: static;
}
.header-top-link-item.header-minicart .esun-cart-wrapper > .action.showcart,
.header-top-link-item.header-minicart
.esun-cart-wrapper
> .action.showcart:hover,
.header-top-link-item.header-minicart
.esun-cart-wrapper
> .action.showcart:focus,
.header-top-link-item.header-minicart
.esun-cart-wrapper
> .action.showcart:active {
padding: 0;
border: 0;
background-color: transparent;
color: inherit;
outline: 0;
box-shadow: none;
}
.header-top-link-item.header-minicart .esun-cart-wrapper .esun-cart-backdrop {
position: fixed;
inset: 0;
z-index: 10000;
display: block;
width: 100%;
height: 100%;
padding: 0;
border: 0;
border-radius: 0;
background: rgba(0, 0, 0, 0.35);
opacity: 0;
visibility: hidden;
pointer-events: none;
transition:
opacity 0.25s ease,
visibility 0.25s ease;
}
.header-top-link-item.header-minicart
.esun-cart-wrapper.active
.esun-cart-backdrop {
opacity: 1;
visibility: visible;
pointer-events: auto;
}
.header-top-link-item.header-minicart
.esun-cart-wrapper
.block-minicart.esun-cart-drawer {
position: fixed !important;
top: 0 !important;
right: 0 !important;
bottom: 0 !important;
left: auto !important;
z-index: 10001 !important;
display: none;
width: 620px !important;
min-width: 0 !important;
max-width: calc(100vw - 48px) !important;
height: 100vh;
height: 100dvh;
max-height: none !important;
margin: 0 !important;
padding: 0 !important;
border: 0 !important;
border-radius: 0 !important;
background: #fff;
box-shadow: -10px 0 34px rgba(0, 0, 0, 0.18) !important;
transform: translateX(100%);
transition: transform 0.3s ease;
overflow-x: hidden;
overflow-y: auto;
overscroll-behavior: contain;
scrollbar-color: #18aa59 #e1e1e1;
scrollbar-width: thin;
}
.header-top-link-item.header-minicart
.esun-cart-wrapper.active
.block-minicart.esun-cart-drawer {
transform: translateX(0);
}
.header-top-link-item.header-minicart .esun-cart-drawer::before,
.header-top-link-item.header-minicart .esun-cart-drawer::after {
display: none !important;
}
.esun-cart-drawer #minicart-content-wrapper {
display: flex;
flex-direction: column;
width: 100%;
height: auto;
min-height: 100%;
overflow: visible;
}
.header-top-link-item.header-minicart
.esun-cart-wrapper
.block-minicart.esun-cart-drawer::-webkit-scrollbar {
width: 7px;
}
.header-top-link-item.header-minicart
.esun-cart-wrapper
.block-minicart.esun-cart-drawer::-webkit-scrollbar-thumb {
border-radius: 7px;
background: #18aa59;
}
.header-top-link-item.header-minicart
.esun-cart-wrapper
.block-minicart.esun-cart-drawer::-webkit-scrollbar-track {
background: #e1e1e1;
}
.esun-cart-drawer__contents {
display: contents;
}
.esun-cart-drawer__header {
display: flex;
flex: 0 0 auto;
align-items: center;
justify-content: space-between;
min-height: 72px;
padding: 14px 28px;
border-bottom: 1px solid #e7e7e7;
}
.esun-cart-drawer__title-wrap {
display: flex;
align-items: center;
min-width: 0;
}
.esun-cart-drawer__icon {
display: inline-block;
width: 42px;
height: 42px;
margin-right: 14px;
border-radius: 50%;
background-color: #18aa59;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='20' r='1'/%3E%3Ccircle cx='18' cy='20' r='1'/%3E%3Cpath d='M3 4h2l2.2 10.2a2 2 0 0 0 2 1.6h7.9a2 2 0 0 0 2-1.6L20.5 8H6'/%3E%3C/svg%3E");
background-repeat: no-repeat;
background-position: center;
background-size: 21px 21px;
}
.esun-cart-drawer__title,
.esun-cart-drawer__count {
color: #222;
font-size: 20px;
line-height: 1.3;
}
.esun-cart-drawer__count {
margin-left: 7px;
font-weight: 700;
}
.esun-cart-drawer .action.close {
position: static !important;
width: 40px;
height: 40px;
padding: 0;
border: 0;
background: transparent;
color: #7c8189;
box-shadow: none;
}
.esun-cart-drawer .action.close::before {
content: "\00d7";
font-family: Arial, sans-serif;
font-size: 30px;
font-weight: 300;
line-height: 38px;
}
.esun-cart-drawer .action.close span {
position: absolute;
width: 1px;
height: 1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
}
.esun-cart-progress {
flex: 0 0 auto;
min-height: 132px;
padding: 22px 38px 16px;
}
.esun-cart-progress + .esun-cart-progress {
margin-top: 14px;
}
.esun-cart-progress__name {
color: #202427;
display: block;
font-size: 13px;
margin-bottom: 3px;
}
.esun-cart-progress__message {
min-height: 21px;
margin-bottom: 26px;
color: #179f54;
font-size: 14px;
font-weight: 700;
}
.esun-cart-progress__rail {
position: relative;
height: 8px;
margin: 0 8px 52px;
border-radius: 8px;
background: #d9dcde;
}
.esun-cart-progress__fill {
position: absolute;
inset: 0 auto 0 0;
max-width: 100%;
border-radius: inherit;
background: #19aa59;
transition: width 0.25s ease;
}
.esun-cart-progress__step {
position: absolute;
top: 50%;
width: 104px;
color: #42464a;
text-align: center;
transform: translate(-50%, -50%);
}
.esun-cart-progress__step:first-of-type {
transform: translate(0, -50%);
}
.esun-cart-progress__step:last-of-type {
transform: translate(-100%, -50%);
}
.esun-cart-progress__marker {
display: block;
width: 22px;
height: 22px;
margin: 0 auto;
border: 3px solid #b8cfdd;
border-radius: 50%;
background: #fff;
box-sizing: border-box;
}
.esun-cart-progress__step.is-active .esun-cart-progress__marker {
border-color: #19aa59;
background: #19aa59;
box-shadow: inset 0 0 0 4px #fff;
}
.esun-cart-progress__step.is-free-shipping .esun-cart-progress__marker {
border-color: #ff8a00;
}
.esun-cart-progress__value,
.esun-cart-progress__label {
position: absolute;
top: 22px;
left: 50%;
display: block;
width: 116px;
transform: translateX(-50%);
}
.esun-cart-progress__value {
padding: 3px 7px;
border-radius: 12px;
background: #e9f7ef;
color: #333;
font-size: 11px;
font-weight: 700;
box-sizing: border-box;
}
.esun-cart-progress__step.is-free-shipping .esun-cart-progress__value {
background: #fff4e4;
color: #f27d00;
}
.esun-cart-progress__label {
top: 50px;
font-size: 11px;
font-weight: 600;
}
.esun-cart-items-panel {
flex: 0 0 auto;
width: auto;
height: auto !important;
max-height: none !important;
min-height: 0;
margin: 0 28px;
overflow: visible !important;
}
.esun-cart-drawer .minicart-items {
display: block;
width: 100%;
height: auto !important;
max-height: none !important;
margin-top: 20px;
padding: 0 4px 0 0;
list-style: none;
overflow: visible !important;
}
.esun-cart-drawer .minicart-items-wrapper,
.esun-cart-drawer [data-action="scroll"] {
height: auto !important;
max-height: none !important;
overflow: visible !important;
}
.esun-cart-drawer .minicart-items .product-item {
position: relative;
margin: 0 0 12px;
padding: 16px;
border: 1px solid #d8dcde;
border-radius: 12px;
background: #fff;
}
.esun-cart-drawer .minicart-items .product-item:first-child {
border-color: #87dbaa;
}
.esun-cart-drawer .product-item .product {
position: relative;
display: flex;
align-items: stretch;
}
.esun-cart-drawer .product-image-container {
flex: 0 0 104px;
width: 104px !important;
height: 104px;
margin-right: 18px;
}
.esun-cart-drawer .product-image-wrapper {
display: block;
width: 100%;
height: 100%;
padding: 0 !important;
}
.esun-cart-drawer .product-image-photo {
position: static;
width: 100%;
height: 100%;
border-radius: 8px;
object-fit: contain;
}
.esun-cart-drawer .product-item-details {
display: flex;
flex: 1 1 auto;
flex-direction: column;
min-width: 0;
padding: 0;
}
.esun-cart-drawer .esun-cart-item__heading {
align-items: flex-start;
display: flex;
gap: 18px;
justify-content: space-between;
min-width: 0;
}
.esun-cart-drawer .product-item-name {
flex: 1 1 auto;
min-width: 0;
margin-bottom: 6px;
overflow: hidden;
color: #343434;
font-size: 15px;
font-weight: 600;
line-height: 1.35;
text-overflow: ellipsis;
white-space: nowrap;
}
.esun-cart-drawer .product.options {
display: flex;
flex-direction: column;
align-items: flex-start;
gap: 2px;
min-width: 0;
color: #686d72;
font-size: 12px;
line-height: 1.5;
}
.esun-cart-drawer .esun-cart-item__option {
display: flex;
width: 100%;
min-width: 0;
align-items: baseline;
}
.esun-cart-drawer .product.options .label {
flex: 0 0 auto;
margin-right: 5px;
}
.esun-cart-drawer .product.options .values {
min-width: 0;
overflow-wrap: anywhere;
}
.esun-cart-item__bottom {
display: flex;
align-items: flex-end;
justify-content: space-between;
gap: 14px;
margin-top: auto;
padding-top: 10px;
}
.esun-cart-item__qty {
display: inline-flex;
align-items: center;
height: 34px;
border: 1px solid #d7dbde;
border-radius: 17px;
overflow: hidden;
}
.esun-cart-item__qty-button,
.esun-cart-item__qty .item-qty {
width: 34px;
height: 32px;
margin: 0;
padding: 0;
border: 0;
border-radius: 0;
background: #fff;
color: #353535;
line-height: 32px;
text-align: center;
outline: 0;
box-shadow: none !important;
}
.esun-cart-drawer .esun-cart-item__qty-button:hover,
.esun-cart-drawer .esun-cart-item__qty-button:focus,
.esun-cart-drawer .esun-cart-item__qty-button:active {
border: 0 !important;
background: #f1f6f3;
outline: 0;
box-shadow: none !important;
}
.minicart-items .esun-cart-item__qty .item-qty {
width: 42px;
border-right: 1px solid #e2e4e5;
border-left: 1px solid #e2e4e5;
appearance: textfield;
}
.esun-cart-item__qty .item-qty::-webkit-inner-spin-button,
.esun-cart-item__qty .item-qty::-webkit-outer-spin-button {
margin: 0;
appearance: none;
}
.esun-cart-item__qty .update-cart-item {
position: absolute !important;
width: 1px !important;
height: 1px !important;
padding: 0 !important;
overflow: hidden !important;
clip: rect(0, 0, 0, 0) !important;
}
.esun-cart-item__price {
display: flex;
align-items: baseline;
gap: 8px;
white-space: nowrap;
}
.esun-cart-item__price strong,
.esun-cart-item__price .price {
color: #252525;
font-size: 17px;
}
.esun-cart-item__price .old-price,
.esun-cart-item__price .old-price .price {
color: #8a8d90;
font-size: 11px;
text-decoration: line-through;
}
.esun-cart-drawer .product-item .action {
flex: 0 0 auto;
position: static;
color: #555;
font-size: 13px;
text-decoration: underline;
width: auto;
}
.esun-cart-drawer .product-item .action.delete::before {
display: none;
}
.esun-cart-drawer .product-item .esun-cart-item__remove > span {
position: static;
width: auto;
height: auto;
margin: 0;
padding: 0;
overflow: visible;
clip: auto;
clip-path: none;
white-space: nowrap;
}
.esun-cart-totals {
display: block;
flex: 0 0 auto;
margin: 18px 28px 0;
padding: 16px 0 18px;
border-top: 1px solid #d9dcde;
border-bottom: 1px solid #d9dcde;
}
.esun-cart-total-row {
display: flex;
align-items: center;
justify-content: space-between;
min-height: 29px;
color: #555b60;
font-size: 14px;
}
.esun-cart-total-row .price {
color: inherit;
font-size: inherit;
}
.esun-cart-total-row__pending {
color: #81868a;
font-size: 12px;
}
.esun-cart-total-row--grand {
min-height: 42px;
margin-top: 7px;
padding-top: 9px;
border-top: 1px solid #eceeef;
color: #222;
font-size: 20px;
}
.header-top-link-item.header-minicart
.esun-cart-totals
.action.primary.checkout {
display: block;
width: 100%;
min-height: 44px;
margin-top: 12px;
border-radius: 22px;
background: #18aa59;
color: #fff;
font-weight: 700;
}
.esun-cart-drawer .esun-coupon--mini {
margin-top: 14px;
padding-top: 14px;
border-top: 1px solid #eceeef;
}
.esun-cart-drawer .esun-coupon__title {
margin-bottom: 9px;
color: #292d30;
font-size: 14px;
font-weight: 700;
}
.esun-cart-drawer .esun-coupon__label {
position: absolute;
width: 1px;
height: 1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
}
.esun-cart-drawer .esun-coupon__controls {
display: flex;
gap: 8px;
}
.esun-cart-drawer .esun-coupon__input {
min-width: 0;
height: 40px;
padding: 0 14px;
border: 1px solid #cfd4d7;
border-radius: 20px;
font-size: 13px;
}
.esun-cart-drawer .esun-coupon__button {
flex: 0 0 auto;
min-width: 82px;
height: 40px;
padding: 0 17px;
border: 1px solid #18aa59 !important;
border-radius: 20px;
background: #fff;
color: #168b4b;
font-size: 13px;
font-weight: 700;
}
.esun-cart-drawer .esun-coupon__button:hover {
background: #18aa59;
}
.esun-cart-drawer .esun-coupon__applied {
display: flex;
align-items: center;
justify-content: space-between;
gap: 14px;
min-height: 38px;
color: #4e5357;
font-size: 13px;
}
.esun-cart-drawer .esun-coupon__applied > span {
min-width: 0;
overflow-wrap: anywhere;
}
.esun-cart-drawer .esun-coupon__applied strong {
color: #168b4b;
}
.esun-cart-drawer .esun-coupon__remove {
display: inline !important;
flex: 0 0 auto;
width: auto !important;
min-width: 0 !important;
max-width: none !important;
height: auto !important;
min-height: 0 !important;
margin: 0 !important;
padding: 0 !important;
border: 0 !important;
border-radius: 0 !important;
background: transparent !important;
box-shadow: none !important;
color: #168b4b;
font-size: 12px;
font-weight: 700;
line-height: 1.4 !important;
text-decoration: underline;
white-space: nowrap;
}
.esun-cart-drawer .esun-coupon__remove:hover,
.esun-cart-drawer .esun-coupon__remove:focus,
.esun-cart-drawer .esun-coupon__remove:active {
border: 0 !important;
background: transparent !important;
box-shadow: none !important;
color: #116d3c;
}
.esun-cart-drawer .esun-coupon__message {
margin-top: 8px;
font-size: 12px;
}
.esun-cart-drawer .esun-coupon__message.is-error {
color: #c62828;
}
.esun-cart-drawer .esun-coupon__message.is-success {
color: #168b4b;
}
.header-top-link-item.header-minicart
.esun-cart-totals
.action.esun-cart-viewcart {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
min-height: 44px;
margin-top: 10px;
border: 1px solid #18aa59;
border-radius: 22px;
background: #fff;
color: #18aa59;
font-weight: 700;
text-align: center;
text-decoration: none;
box-sizing: border-box;
}
.header-top-link-item.header-minicart
.esun-cart-totals
.action.esun-cart-viewcart:hover,
.header-top-link-item.header-minicart
.esun-cart-totals
.action.esun-cart-viewcart:focus {
background: #f1f8f4;
color: #138849;
text-decoration: none;
}
.esun-cart-services {
flex: 0 0 auto;
margin: 0 28px;
padding: 14px 0 22px;
}
.esun-cart-service {
padding: 12px 16px;
background: #f5f6f6;
color: #444;
font-size: 11px;
}
.esun-cart-service + .esun-cart-service {
margin-top: 12px;
}
.esun-cart-service h3 {
margin: 0 0 8px;
color: #333;
font-size: 15px;
font-weight: 700;
}
.esun-cart-service p,
.esun-cart-service ul {
margin: 6px 0 0;
}
.esun-cart-service ul {
padding-left: 18px;
}
.esun-cart-service--payment .esun-payment-methods {
display: grid !important;
grid-template-columns: repeat(6, minmax(0, 1fr));
gap: 8px;
margin-top: 6px;
}
.esun-cart-service--payment .esun-payment-methods span {
display: flex;
align-items: center;
justify-content: center;
min-width: 0;
height: 44px;
padding: 6px 8px;
border: 1px solid #d9dcdf;
border-radius: 6px;
background: #fff;
box-sizing: border-box;
}
.esun-cart-service--payment .esun-payment-methods img {
display: block;
width: auto;
max-width: 100%;
height: 26px;
object-fit: contain;
}
.esun-cart-empty {
display: flex;
flex: 1 1 auto;
flex-direction: column;
align-items: center;
justify-content: center;
min-height: 260px;
gap: 20px;
padding: 30px;
color: #464b4f;
}
.esun-cart-wrapper.has-cart-items .esun-cart-empty:not(.esun-cart-loading),
.esun-cart-wrapper:has(#mini-cart > .product-item)
.esun-cart-empty:not(.esun-cart-loading),
.esun-cart-wrapper.is-cart-syncing .esun-cart-empty:not(.esun-cart-loading) {
display: none !important;
}
.esun-cart-wrapper.has-no-cart-items:not(:has(#mini-cart > .product-item))
.esun-cart-items-panel,
.esun-cart-wrapper.has-no-cart-items:not(:has(#mini-cart > .product-item))
.esun-cart-totals {
display: none !important;
}
.esun-cart-wrapper:has(#mini-cart > .product-item) .esun-cart-items-panel {
display: block !important;
}
.esun-cart-wrapper:has(#mini-cart > .product-item) .esun-cart-totals {
display: block !important;
}
.esun-cart-loading {
gap: 14px;
}
.esun-cart-loading__spinner {
width: 30px;
height: 30px;
border: 3px solid #dcefe3;
border-top-color: #159447;
border-radius: 50%;
animation: esun-cart-spin 0.8s linear infinite;
}
@keyframes esun-cart-spin {
to {
transform: rotate(360deg);
}
}
.header-top-link-item.header-minicart .esun-cart-empty .action.primary {
display: inline-flex;
width: auto;
min-width: 176px;
height: auto;
min-height: 44px;
padding: 11px 28px;
border-radius: 22px;
background: #18aa59;
color: #fff;
font-size: 14px;
font-weight: 700;
line-height: 22px;
white-space: nowrap;
box-sizing: border-box;
}
.header-top-link-item.header-minicart .esun-cart-empty .action.primary:hover,
.header-top-link-item.header-minicart .esun-cart-empty .action.primary:focus {
background: #148a47;
color: #fff;
text-decoration: none;
}
@media (max-width: 600px) {
.esun-cart-service--payment .esun-payment-methods {
grid-template-columns: repeat(6, minmax(0, 1fr));
}
.catalog-product-view .esun-product-service--payment {
padding: 0 !important;
}
.header-top-link-item.header-minicart
.esun-cart-wrapper
.block-minicart.esun-cart-drawer {
width: 100vw !important;
max-width: 100vw !important;
}
.esun-cart-drawer__header {
min-height: 62px;
padding: 10px 16px;
}
.esun-cart-drawer__icon {
width: 36px;
height: 36px;
margin-right: 9px;
}
.esun-cart-drawer__title,
.esun-cart-drawer__count {
font-size: 17px;
}
.esun-cart-progress {
min-height: 122px;
padding: 18px 19px 12px;
}
.esun-cart-progress__step {
width: 72px;
}
.esun-cart-progress__value,
.esun-cart-progress__label {
width: 84px;
font-size: 9px;
}
.esun-cart-items-panel {
flex-basis: auto;
min-height: 0;
margin: 0 16px;
}
.esun-cart-drawer .minicart-items .product-item {
padding: 12px;
}
.esun-cart-drawer .product-image-container {
flex-basis: 82px;
width: 82px !important;
height: 82px;
margin-right: 11px;
}
.esun-cart-drawer .product-item-details {
padding-right: 0;
}
.esun-cart-drawer .product-item .action.delete {
font-size: 12px;
}
.esun-cart-item__bottom {
flex-wrap: wrap;
}
.esun-cart-totals,
.esun-cart-services {
margin-right: 16px;
margin-left: 16px;
}
}
@media (prefers-reduced-motion: reduce) {
.header-top-link-item.header-minicart
.esun-cart-wrapper
.esun-cart-backdrop,
.header-top-link-item.header-minicart
.esun-cart-wrapper
.block-minicart.esun-cart-drawer,
.esun-cart-progress__fill {
transition: none;
}
}
.esun-free-gift-label {
display: inline-flex;
align-items: center;
width: fit-content;
margin-top: 4px;
padding: 2px 8px;
border-radius: 999px;
background: #e8f7ef;
color: #138a4b;
font-size: 11px;
font-weight: 700;
}
.esun-cart-item__qty--locked {
align-items: center;
height: auto;
gap: 4px;
border: 0;
border-radius: 0;
overflow: visible;
background: transparent;
color: #353535;
line-height: 1.4;
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,310 @@
.checkout-cart-index .esun-cart-recommended {
--esun-green: #12ad5c;
--esun-green-dark: #0c914c;
--esun-text: #242424;
}
.checkout-cart-index .esun-cart-recommended .esun-recommended-products__slider {
cursor: grab;
min-width: 0;
overflow-x: auto !important;
overflow-y: hidden;
overscroll-behavior-x: contain;
scrollbar-width: none;
scroll-behavior: smooth;
scroll-snap-type: x mandatory;
touch-action: pan-x pan-y;
width: 100%;
}
.checkout-cart-index .esun-cart-recommended .esun-recommended-products__slider::-webkit-scrollbar {
display: none;
}
.checkout-cart-index .esun-cart-recommended .esun-recommended-products__slider.is-dragging {
cursor: grabbing;
scroll-behavior: auto;
user-select: none;
}
.checkout-cart-index .esun-cart-recommended .esun-recommended-products__wrapper {
align-items: stretch;
display: flex;
flex-wrap: nowrap;
gap: 22px;
transform: none !important;
width: 100% !important;
}
.checkout-cart-index .esun-cart-recommended .esun-recommended-products__item {
background: #fff;
border: 1px solid #eef2ef;
border-radius: 18px;
box-shadow: 0 8px 22px rgba(23, 50, 36, .08);
box-sizing: border-box;
flex: 0 0 calc((100% - 88px) / 5);
height: auto;
min-height: 374px;
min-width: 0;
overflow: hidden;
padding: 14px;
scroll-snap-align: start;
}
.checkout-cart-index .esun-cart-recommended .esun-category-card__image {
background: #fafbfa;
border-radius: 12px;
display: block;
height: 178px;
overflow: hidden;
position: relative;
}
.checkout-cart-index .esun-cart-recommended .esun-category-card__badge {
background: var(--esun-green) !important;
border-radius: 999px;
color: #fff !important;
font-size: 10px;
font-weight: 800;
left: 10px;
line-height: 1;
padding: 6px 9px;
position: absolute;
top: 10px;
z-index: 2;
}
.checkout-cart-index .esun-cart-recommended .esun-category-card__image .product-image-container,
.checkout-cart-index .esun-cart-recommended .esun-category-card__image .product-image-wrapper {
height: 100%;
width: 100% !important;
}
.checkout-cart-index .esun-cart-recommended .esun-category-card__image .product-image-wrapper {
padding-bottom: 0 !important;
}
.checkout-cart-index .esun-cart-recommended .esun-category-card__image .product-image-photo {
height: 100%;
inset: 0;
margin: auto;
max-height: none;
object-fit: contain;
position: absolute;
width: 100%;
}
.checkout-cart-index .esun-cart-recommended .esun-category-card__details {
display: flex;
flex: 1;
flex-direction: column;
min-width: 0;
padding: 14px 2px 2px;
}
.checkout-cart-index .esun-cart-recommended .esun-category-card__name {
display: -webkit-box;
font-size: 15px;
font-weight: 750;
line-height: 1.35;
margin: 0 0 10px;
min-height: 41px;
overflow: hidden;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
}
.checkout-cart-index .esun-cart-recommended .esun-category-card__name a {
color: var(--esun-text);
text-decoration: none;
}
.checkout-cart-index .esun-cart-recommended .esun-category-card__tags {
display: flex;
flex-wrap: wrap;
gap: 5px;
margin: 0 0 10px;
max-height: 24px;
overflow: hidden;
}
.checkout-cart-index .esun-cart-recommended .esun-category-card__tags span {
background: #f6f8f7;
border: 1px solid #e4e9e6;
border-radius: 999px;
color: #727a75;
font-size: 10px;
font-weight: 700;
line-height: 20px;
max-width: 100%;
overflow: hidden;
padding: 0 8px;
text-overflow: ellipsis;
white-space: nowrap;
}
.checkout-cart-index .esun-cart-recommended .esun-category-card__swatches {
align-items: center;
display: flex;
flex-wrap: wrap;
gap: 6px;
margin: 0 0 12px;
max-height: 22px;
min-height: 22px;
overflow: hidden;
}
.checkout-cart-index .esun-cart-recommended .esun-category-card__swatch {
align-items: center;
appearance: none;
background: #fff;
border: 1px solid #dfe5e1;
border-radius: 50%;
display: inline-flex;
flex: 0 0 18px;
height: 18px;
justify-content: center;
padding: 2px;
width: 18px;
}
.checkout-cart-index .esun-cart-recommended .esun-category-card__swatch > span,
.checkout-cart-index .esun-cart-recommended .esun-category-card__swatch img {
border-radius: 50%;
height: 100%;
object-fit: cover;
width: 100%;
}
.checkout-cart-index .esun-cart-recommended .esun-category-card__inner {
display: flex;
flex: 1;
flex-direction: column;
margin-top: auto;
}
.checkout-cart-index .esun-cart-recommended .esun-category-card__footer {
align-items: center;
display: flex;
gap: 10px;
justify-content: space-between;
margin-top: auto;
min-height: 42px;
}
.checkout-cart-index .esun-cart-recommended .esun-category-card__price {
align-items: baseline;
display: flex;
flex-wrap: wrap;
gap: 6px;
min-width: 0;
}
.checkout-cart-index .esun-cart-recommended .esun-category-card__final-price {
color: var(--esun-green);
font-size: 16px;
font-weight: 800;
}
.checkout-cart-index .esun-cart-recommended .esun-category-card__regular-price {
color: #a8b0ab;
font-size: 11px;
font-weight: 700;
text-decoration: line-through;
}
.checkout-cart-index .esun-cart-recommended .esun-recommended-products__actions,
.checkout-cart-index .esun-cart-recommended .esun-recommended-products__actions form {
border: 0 !important;
margin: 0 !important;
padding: 0 !important;
width: auto !important;
}
.checkout-cart-index .esun-cart-recommended .action.tocart.esun-category-card__cart {
align-items: center;
background: var(--esun-green) !important;
border: 0 !important;
border-radius: 50% !important;
box-shadow: none !important;
color: #fff !important;
display: inline-flex !important;
height: 42px !important;
justify-content: center;
min-height: 42px !important;
min-width: 42px !important;
padding: 0 !important;
width: 42px !important;
}
.checkout-cart-index .esun-cart-recommended .action.tocart.esun-category-card__cart:hover,
.checkout-cart-index .esun-cart-recommended .action.tocart.esun-category-card__cart:focus {
background: var(--esun-green-dark) !important;
}
.checkout-cart-index .esun-cart-recommended .esun-category-card__cart svg {
fill: none !important;
height: 18px !important;
max-height: 18px !important;
max-width: 18px !important;
stroke: currentColor;
stroke-linecap: round;
stroke-linejoin: round;
stroke-width: 1.9;
width: 18px !important;
}
.checkout-cart-index .esun-cart-recommended .esun-category-card__cart span {
clip: rect(0, 0, 0, 0);
clip-path: inset(50%);
height: 1px;
overflow: hidden;
position: absolute;
white-space: nowrap;
width: 1px;
}
.checkout-cart-index .esun-cart-recommended .esun-recommended-products__previous.is-disabled,
.checkout-cart-index .esun-cart-recommended .esun-recommended-products__next.is-disabled,
.checkout-cart-index .esun-cart-recommended .esun-recommended-products__previous:disabled,
.checkout-cart-index .esun-cart-recommended .esun-recommended-products__next:disabled {
cursor: default;
opacity: .35;
}
@media (max-width: 1439px) {
.checkout-cart-index .esun-cart-recommended .esun-recommended-products__wrapper {
gap: 20px;
}
.checkout-cart-index .esun-cart-recommended .esun-recommended-products__item {
flex-basis: calc((100% - 60px) / 4);
}
}
@media (max-width: 1023px) {
.checkout-cart-index .esun-cart-recommended .esun-recommended-products__wrapper {
gap: 18px;
}
.checkout-cart-index .esun-cart-recommended .esun-recommended-products__item {
flex-basis: calc((100% - 36px) / 3);
}
}
@media (max-width: 767px) {
.checkout-cart-index .esun-cart-recommended .esun-recommended-products__wrapper {
gap: 16px;
}
.checkout-cart-index .esun-cart-recommended .esun-recommended-products__item {
flex-basis: calc((100% - 16px) / 2);
}
}
@media (max-width: 479px) {
.checkout-cart-index .esun-cart-recommended .esun-recommended-products__item {
flex-basis: 86%;
}
}
@@ -0,0 +1,761 @@
.checkout-index-index .am-checkout {
width: 83.333333%;
margin: 0 auto;
max-width: 1600px;
}
.field-tooltip {
display: none;
}
.checkout-index-index .esun-checkout-services {
display: flex;
flex-direction: column;
gap: 22px;
margin-top: 20px;
}
.checkout-index-index dl.item-options {
margin-bottom: 0;
}
.checkout-index-index .esun-checkout-service--payment {
background: #f5f6f6;
color: #444;
font-size: 12px;
padding: 20px 22px;
}
.checkout-index-index .esun-checkout-service--payment h2 {
color: #333;
font-size: 19px;
font-weight: 700;
margin: 0 0 12px;
}
.checkout-index-index .esun-checkout-service--payment .esun-payment-methods {
align-items: center;
display: grid;
grid-template-columns: repeat(6, minmax(0, 1fr));
gap: 8px;
}
.checkout-index-index
.esun-checkout-service--payment
.esun-payment-methods
span {
display: flex;
align-items: center;
justify-content: center;
min-width: 0;
height: 44px;
padding: 6px 8px;
border: 1px solid #d9dcdf;
border-radius: 6px;
background: #fff;
box-sizing: border-box;
}
.checkout-index-index
.esun-checkout-service--payment
.esun-payment-methods
img {
display: block;
width: auto;
max-width: 100%;
height: 26px;
object-fit: contain;
}
.checkout-index-index .esun-checkout-service--delivery {
border-top: 1px solid #d9d9d9;
}
.checkout-index-index
.esun-checkout-service--delivery
.esun-product-accordion__item {
border-bottom: 1px solid #d9d9d9;
}
.checkout-index-index
.esun-checkout-service--delivery
.esun-product-accordion__summary {
align-items: center;
color: #333;
cursor: pointer;
display: flex;
font-size: 14px;
font-weight: 700;
justify-content: space-between;
line-height: 1.35;
list-style: none;
min-height: 56px;
padding: 0 18px 0 0;
}
.checkout-index-index
.esun-checkout-service--delivery
.esun-product-accordion__summary::-webkit-details-marker {
display: none;
}
.checkout-index-index
.esun-checkout-service--delivery
.esun-product-accordion__summary::after {
content: "+";
font-size: 18px;
font-weight: 400;
line-height: 1;
}
.checkout-index-index
.esun-checkout-service--delivery
.esun-product-accordion__item[open]
.esun-product-accordion__summary::after {
content: "×";
}
.checkout-index-index
.esun-checkout-service--delivery
.esun-product-accordion__content {
color: #666;
font-size: 13px;
line-height: 1.6;
padding: 0 0 22px;
}
.checkout-index-index .esun-checkout-services .esun-product-service ul {
list-style: none;
margin: 0;
padding: 0;
}
.checkout-index-index .esun-checkout-services .esun-product-service li {
margin: 0 0 8px;
padding-left: 14px;
position: relative;
}
.checkout-index-index .esun-checkout-services .esun-product-service li::before {
content: "·";
left: 0;
position: absolute;
}
.checkout-index-index .esun-checkout-services .esun-product-service a {
color: #666;
text-decoration: underline;
}
/* Keep checkout form spacing consistent across Amasty checkout sections. */
.checkout-index-index
.amcheckout-main-container
.amcheckout-step-container
.field:not(.choice) {
margin-bottom: 16px;
}
.checkout-index-index
.amcheckout-main-container
.amcheckout-step-container
.field:not(.choice)
> .label {
display: block;
line-height: 1.4;
margin: 0 0 6px;
}
.checkout-index-index
.esun-checkout-address-form
.fieldset.address
> .field
> .label,
.checkout-index-index
.amcheckout-form-login
#customer-email-fieldset
> .field
> .label {
box-sizing: border-box;
float: none;
width: 100%;
padding: 0;
text-align: left;
}
.checkout-index-index
.esun-checkout-address-form
.fieldset.address
> .field
> .control,
.checkout-index-index
.amcheckout-form-login
#customer-email-fieldset
> .field
> .control {
box-sizing: border-box;
float: none;
width: 100%;
}
.checkout-index-index
.amcheckout-form-login
.amcheckout-email
.amcheckout-wrapper {
min-width: 0;
}
.checkout-index-index .amcheckout-form-login .amcheckout-email .note {
width: 100%;
margin: 6px 0 0;
line-height: 1.4;
}
.checkout-index-index
.esun-checkout-address-form
.field.street
.control
.nested
.field {
margin-top: 10px;
margin-bottom: 0;
}
.checkout-index-index .am-checkout input[type="text"],
.checkout-index-index .am-checkout input[type="password"],
.checkout-index-index .am-checkout input[type="url"],
.checkout-index-index .am-checkout input[type="tel"],
.checkout-index-index .am-checkout input[type="search"],
.checkout-index-index .am-checkout input[type="number"]:not(.qty),
.checkout-index-index .am-checkout input[type="email"],
.checkout-index-index .am-checkout select,
.checkout-index-index .am-checkout textarea {
box-sizing: border-box;
width: 100%;
border: 1px solid #aeb5b1;
border-radius: 12px;
background-color: #fff;
box-shadow: none;
color: #303437;
font-size: 14px;
transition:
border-color 0.2s ease,
box-shadow 0.2s ease;
}
.checkout-index-index .am-checkout input[type="text"],
.checkout-index-index .am-checkout input[type="password"],
.checkout-index-index .am-checkout input[type="url"],
.checkout-index-index .am-checkout input[type="tel"],
.checkout-index-index .am-checkout input[type="search"],
.checkout-index-index .am-checkout input[type="number"]:not(.qty),
.checkout-index-index .am-checkout input[type="email"] {
height: 42px;
padding: 0 16px;
}
.checkout-index-index .am-checkout select {
height: 42px;
padding: 0 44px 0 16px;
appearance: none;
-webkit-appearance: none;
background-color: #fff;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='8' viewBox='0 0 14 8'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%235b625e' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
background-repeat: no-repeat;
background-position: right 16px center;
background-size: 14px 8px;
}
.checkout-index-index .am-checkout textarea {
min-height: 96px;
padding: 11px 14px;
line-height: 1.5;
resize: vertical;
}
.checkout-index-index
.am-checkout
input:not([type="checkbox"]):not([type="radio"]):not(.qty):focus,
.checkout-index-index .am-checkout select:focus,
.checkout-index-index .am-checkout textarea:focus {
border-color: #18aa59;
box-shadow: 0 0 0 3px rgba(24, 170, 89, 0.12);
outline: 0;
}
.checkout-index-index
.am-checkout
input.mage-error:not([type="checkbox"]):not([type="radio"]),
.checkout-index-index .am-checkout select.mage-error,
.checkout-index-index .am-checkout textarea.mage-error {
border-color: #d94b4b;
box-shadow: 0 0 0 3px rgba(217, 75, 75, 0.1);
}
/* New shipping address modal lives outside .am-checkout. */
.checkout-index-index .new-shipping-address-modal .modal-inner-wrap {
display: flex;
flex-direction: column;
overflow: hidden;
border-radius: 18px;
background: #fff;
}
.checkout-index-index .new-shipping-address-modal .modal-header {
flex: 0 0 auto;
padding: 26px 32px 16px;
}
.checkout-index-index .new-shipping-address-modal .modal-title {
margin: 0;
padding: 0 48px 14px 0;
border-bottom: 1px solid #dce3df;
color: #292d30;
font-size: 28px;
font-weight: 700;
line-height: 1.25;
}
.checkout-index-index .new-shipping-address-modal .action-close {
top: 16px;
right: 18px;
color: #7d8581;
}
.checkout-index-index .new-shipping-address-modal .modal-content {
flex: 1 1 auto;
overflow-x: hidden;
overflow-y: auto;
padding: 6px 32px 26px;
}
.checkout-index-index .new-shipping-address-modal .esun-checkout-address-form {
width: 100%;
max-width: none;
}
.checkout-index-index
.new-shipping-address-modal
.esun-checkout-address-form
.fieldset.address
> .field:not(.choice)
> .label,
.checkout-index-index
.new-shipping-address-modal
.esun-checkout-address-form
.fieldset.address
> .field:not(.choice)
> .control {
display: block;
width: 100%;
min-width: 0;
max-width: none;
}
.checkout-index-index
.new-shipping-address-modal
.esun-checkout-address-form
.fieldset.address
> .field:not(.choice)
> .label {
margin: 0 0 6px;
color: #303437;
font-size: 14px;
font-weight: 600;
line-height: 1.4;
}
.checkout-index-index
.new-shipping-address-modal
input:not([type="checkbox"]):not([type="radio"]),
.checkout-index-index .new-shipping-address-modal select {
box-sizing: border-box;
width: 100%;
height: 42px;
padding: 0 16px;
border: 1px solid #aeb5b1;
border-radius: 12px;
background-color: #fff;
box-shadow: none;
color: #303437;
font-size: 14px;
}
.checkout-index-index .new-shipping-address-modal select {
padding-right: 44px;
appearance: none;
-webkit-appearance: none;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='8' viewBox='0 0 14 8'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%235b625e' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
background-repeat: no-repeat;
background-position: right 16px center;
background-size: 14px 8px;
}
.checkout-index-index
.new-shipping-address-modal
input:not([type="checkbox"]):not([type="radio"]):focus,
.checkout-index-index .new-shipping-address-modal select:focus {
border-color: #18aa59;
box-shadow: 0 0 0 3px rgba(24, 170, 89, 0.12);
outline: 0;
}
.checkout-index-index .new-shipping-address-modal .field.choice {
display: flex;
align-items: center;
justify-content: flex-start;
gap: 9px;
margin-top: 2px;
}
.checkout-index-index .new-shipping-address-modal .field.choice .label {
margin: 0;
font-size: 14px;
font-weight: 400;
}
.checkout-index-index .new-shipping-address-modal .modal-footer {
display: flex;
flex: 0 0 auto;
align-items: center;
justify-content: flex-end;
gap: 12px;
padding: 18px 32px 22px;
border-top: 1px solid #e2e7e4;
background: #fff;
}
.checkout-index-index .new-shipping-address-modal .modal-footer .action {
display: inline-flex;
align-items: center;
justify-content: center;
box-sizing: border-box;
min-width: 112px;
height: 42px;
margin: 0;
padding: 0 22px;
border-radius: 21px;
box-shadow: none;
font-size: 14px;
font-weight: 700;
line-height: 1;
}
.checkout-index-index
.new-shipping-address-modal
.modal-footer
.action-hide-popup {
order: 1;
border: 1px solid #18aa59;
background: #fff;
color: #168b4b;
}
.checkout-index-index
.new-shipping-address-modal
.modal-footer
.action-save-address {
order: 2;
border: 1px solid #18aa59;
background: #18aa59;
color: #fff;
}
.checkout-index-index
.new-shipping-address-modal
.modal-footer
.action-hide-popup:hover,
.checkout-index-index
.new-shipping-address-modal
.modal-footer
.action-hide-popup:focus {
border-color: #148f4b;
background: #f2fbf6;
color: #148f4b;
}
.checkout-index-index
.new-shipping-address-modal
.modal-footer
.action-save-address:hover,
.checkout-index-index
.new-shipping-address-modal
.modal-footer
.action-save-address:focus {
border-color: #148f4b;
background: #148f4b;
color: #fff;
}
.checkout-index-index .am-checkout.-classic .checkout-block {
border: 1px solid #dcefe4;
border-radius: 14px;
box-shadow: none;
transition:
border-color 0.2s ease,
box-shadow 0.2s ease;
}
.checkout-index-index .am-checkout.-classic .checkout-block:hover {
border-color: #cce8d8;
box-shadow: none;
}
.checkout-index-index .am-checkout.-classic .checkout-block:focus-within {
border-color: #b8dfca;
box-shadow: 0 6px 20px rgba(24, 170, 89, 0.1);
}
.opc-block-summary .mark .value {
display: none;
}
@media (min-width: 768px) {
.checkout-index-index .new-shipping-address-modal .modal-inner-wrap {
left: 50%;
width: min(860px, calc(100% - 48px));
max-width: 860px;
max-height: calc(100vh - 48px);
margin: 24px 0 0;
transform: translateX(-50%);
}
.checkout-index-index .esun-checkout-address-form .fieldset.address {
display: grid;
grid-template-columns: repeat(6, minmax(0, 1fr));
gap: 18px 20px;
margin-right: 0;
margin-left: 0;
}
.checkout-index-index
.esun-checkout-address-form
.fieldset.address
> .field {
grid-column: 1 / -1;
width: auto;
margin-bottom: 0;
padding-right: 0;
padding-left: 0;
}
.checkout-index-index
.esun-checkout-address-form
.fieldset.address
> .field[name$=".firstname"],
.checkout-index-index
.esun-checkout-address-form
.fieldset.address
> .field[name$=".lastname"] {
grid-column: span 3;
order: 10;
}
.checkout-index-index
.esun-checkout-address-form
.fieldset.address
> .field[name$=".company"] {
order: 15;
}
.checkout-index-index
.esun-checkout-address-form
.fieldset.address
> .field.street {
order: 20;
}
.checkout-index-index
.esun-checkout-address-form
.fieldset.address
> .field[name$=".city"] {
order: 30;
}
.checkout-index-index
.esun-checkout-address-form
.fieldset.address
> .field[name$=".country_id"],
.checkout-index-index
.esun-checkout-address-form
.fieldset.address
> .field[name$=".region_id"],
.checkout-index-index
.esun-checkout-address-form
.fieldset.address
> .field[name$=".region"],
.checkout-index-index
.esun-checkout-address-form
.fieldset.address
> .field[name$=".postcode"] {
grid-column: span 2;
}
.checkout-index-index
.esun-checkout-address-form
.fieldset.address
> .field[name$=".country_id"] {
order: 40;
}
.checkout-index-index
.esun-checkout-address-form
.fieldset.address
> .field[name$=".region_id"],
.checkout-index-index
.esun-checkout-address-form
.fieldset.address
> .field[name$=".region"] {
order: 41;
}
.checkout-index-index
.esun-checkout-address-form
.fieldset.address
> .field[name$=".postcode"] {
order: 42;
}
.checkout-index-index
.esun-checkout-address-form
.fieldset.address
> .field[name$=".telephone"] {
grid-column: 1 / -1;
order: 18;
}
.checkout-index-index
.esun-checkout-address-form
.fieldset.address
> .field.choice {
order: 100;
}
}
@media (max-width: 767px) {
.checkout-index-index .modal-popup.new-shipping-address-modal {
right: 0;
left: 0;
width: auto;
}
.checkout-index-index
.modal-popup.new-shipping-address-modal
.modal-inner-wrap[class] {
width: auto;
height: calc(100dvh - 24px);
min-height: 0;
max-height: calc(100dvh - 24px);
margin: 12px;
border-radius: 16px;
background: #fff;
}
.checkout-index-index .new-shipping-address-modal .modal-header {
padding: 20px 20px 12px;
}
.checkout-index-index .new-shipping-address-modal .modal-title {
padding: 0 40px 12px 0;
font-size: 22px;
}
.checkout-index-index .new-shipping-address-modal .action-close {
top: 9px;
right: 10px;
}
.checkout-index-index .new-shipping-address-modal .modal-content {
padding: 4px 20px 20px;
}
.checkout-index-index
.new-shipping-address-modal
.esun-checkout-address-form
.fieldset.address
> .field {
width: 100%;
margin-bottom: 14px;
padding: 0;
}
.checkout-index-index
.new-shipping-address-modal
input:not([type="checkbox"]):not([type="radio"]),
.checkout-index-index .new-shipping-address-modal select {
height: 42px;
border-radius: 10px;
font-size: 16px;
}
.checkout-index-index .new-shipping-address-modal .modal-footer {
gap: 10px;
padding: 14px 20px 18px;
}
.checkout-index-index .new-shipping-address-modal .modal-footer .action {
flex: 1 1 0;
min-width: 0;
padding: 0 14px;
}
.checkout-index-index .opc-estimated-wrapper {
display: none;
}
.checkout-index-index .am-checkout {
width: 100%;
}
.checkout-index-index .am-checkout.-classic .checkout-block {
margin: 0 0 16px;
padding: 18px 14px;
border-radius: 12px;
}
.checkout-index-index .esun-checkout-address-form .fieldset.address {
margin-right: 0;
margin-left: 0;
}
.checkout-index-index
.esun-checkout-address-form
.fieldset.address
> .field {
margin-bottom: 14px;
padding-right: 0;
padding-left: 0;
}
.checkout-index-index
.amcheckout-main-container
.amcheckout-step-container
.field:not(.choice)
> .label {
margin-bottom: 5px;
}
.checkout-index-index
.amcheckout-main-container
.amcheckout-step-container
input:not([type="checkbox"]):not([type="radio"]),
.checkout-index-index
.amcheckout-main-container
.amcheckout-step-container
select,
.checkout-index-index
.amcheckout-main-container
.amcheckout-step-container
textarea {
box-sizing: border-box;
font-size: 16px;
}
.checkout-index-index .am-checkout input[type="text"],
.checkout-index-index .am-checkout input[type="password"],
.checkout-index-index .am-checkout input[type="url"],
.checkout-index-index .am-checkout input[type="tel"],
.checkout-index-index .am-checkout input[type="search"],
.checkout-index-index .am-checkout input[type="number"]:not(.qty),
.checkout-index-index .am-checkout input[type="email"],
.checkout-index-index .am-checkout select {
height: 42px;
border-radius: 10px;
}
.checkout-index-index .am-checkout textarea {
border-radius: 10px;
}
}
@@ -0,0 +1,167 @@
.modal-popup.esun-test-mode-modal .modal-inner-wrap {
background: linear-gradient(180deg, #f1faf5 0, #fff 190px);
border: 1px solid #dcefe4;
border-radius: 24px;
box-shadow: 0 24px 70px rgba(11, 45, 28, 0.2);
box-sizing: border-box;
margin: 0 auto;
max-width: 520px;
min-height: 0;
overflow: hidden;
top: 50%;
transform: translateY(-200vh);
width: calc(100% - 40px);
}
.modal-popup.esun-test-mode-modal._show .modal-inner-wrap {
transform: translateY(-50%);
}
.modal-popup.esun-test-mode-modal .modal-header {
padding: 42px 56px 0;
text-align: center;
}
.modal-popup.esun-test-mode-modal .modal-title {
border: 0;
color: #161916;
font-size: 26px;
font-weight: 700;
line-height: 1.35;
margin: 0;
padding: 0;
}
.modal-popup.esun-test-mode-modal .modal-title::before {
align-items: center;
background: #e1f5e9;
border: 1px solid #c8ead6;
border-radius: 50%;
color: #18aa59;
content: "!";
display: flex;
font-size: 34px;
font-weight: 700;
height: 70px;
justify-content: center;
line-height: 1;
margin: 0 auto 22px;
width: 70px;
}
.modal-popup.esun-test-mode-modal .action-close {
background: transparent;
border: 0;
color: #646b67;
height: 36px;
padding: 0;
right: 18px;
top: 18px;
transition: color 160ms ease, transform 160ms ease;
width: 36px;
}
.modal-popup.esun-test-mode-modal .action-close:hover,
.modal-popup.esun-test-mode-modal .action-close:focus {
color: #18aa59;
transform: rotate(90deg);
}
.modal-popup.esun-test-mode-modal .modal-content {
padding: 18px 48px 0;
text-align: center;
}
.esun-test-mode-modal__message {
color: #505652;
font-size: 16px;
line-height: 1.7;
margin: 0;
white-space: pre-line;
}
.esun-test-mode-modal .modal-footer {
display: flex;
justify-content: center;
padding: 28px 40px 40px;
}
.esun-test-mode-modal .modal-footer .action-primary {
align-items: center;
background: #18aa59;
border: 1px solid #18aa59;
border-radius: 999px;
box-shadow: none;
color: #fff;
display: inline-flex;
font-size: 16px;
font-weight: 700;
justify-content: center;
line-height: 20px;
margin: 0;
min-height: 50px;
min-width: 190px;
padding: 14px 32px;
text-transform: none;
transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}
.esun-test-mode-modal .modal-footer .action-primary:hover,
.esun-test-mode-modal .modal-footer .action-primary:focus,
.esun-test-mode-modal .modal-footer .action-primary:active {
background: #148f4b;
border-color: #148f4b;
color: #fff;
transform: translateY(-1px);
}
@media (max-width: 767px) {
.modal-popup.esun-test-mode-modal.modal-slide {
left: 0;
}
.modal-popup.esun-test-mode-modal .modal-inner-wrap {
height: auto;
max-height: calc(100vh - 32px);
position: absolute;
width: calc(100% - 32px);
}
.modal-popup.esun-test-mode-modal .modal-header {
padding: 36px 42px 0;
}
.modal-popup.esun-test-mode-modal .modal-title {
font-size: 22px;
}
.modal-popup.esun-test-mode-modal .modal-title::before {
font-size: 29px;
height: 60px;
margin-bottom: 18px;
width: 60px;
}
.modal-popup.esun-test-mode-modal .modal-content {
padding: 16px 24px 0;
}
.esun-test-mode-modal__message {
font-size: 15px;
}
.esun-test-mode-modal .modal-footer {
padding: 24px 24px 30px;
}
.esun-test-mode-modal .modal-footer .action-primary {
width: 100%;
}
}
@media (prefers-reduced-motion: reduce) {
.modal-popup.esun-test-mode-modal .action-close,
.esun-test-mode-modal .modal-footer .action-primary {
transition: none;
}
}
@@ -0,0 +1,88 @@
define([
'jquery',
'Esun_Cart/js/model/coupon-service'
], function ($, couponService) {
'use strict';
return function (config, element) {
var $page = $(element),
submitTimer;
$page.on('click', '[data-esun-qty-change]', function () {
var $button = $(this),
$input = $button.siblings('[data-role="cart-item-qty"]'),
currentQty = parseFloat($input.val()) || 1,
difference = parseFloat($button.attr('data-esun-qty-change')) || 0,
nextQty = Math.max(1, currentQty + difference);
if (nextQty === currentQty) {
return;
}
$input.val(nextQty).trigger('change');
window.clearTimeout(submitTimer);
submitTimer = window.setTimeout(function () {
$page.find('.action.update').trigger('click');
}, 350);
});
$page.on('submit', '[data-role="esun-coupon-form"]', function (event) {
event.preventDefault();
saveCoupon($(this), false);
});
$page.on('click', '[data-role="esun-coupon-form"] .esun-coupon__remove', function (event) {
event.preventDefault();
saveCoupon($(this).closest('form'), true);
});
$(document).on('esun:customerCouponApplied.esunCartPage', function () {
window.location.reload();
});
function saveCoupon($form, remove) {
var $message = $form.find('[data-role="esun-coupon-message"]'),
$buttons = $form.find('button'),
couponCode = $.trim($form.find('[name="coupon_code"]').val() || '');
if ($form.data('loading')) {
return;
}
if (!remove && !couponCode) {
$message
.removeClass('is-success')
.addClass('is-error')
.text($.mage.__('Please enter a coupon code.'));
return;
}
$form.data('loading', true).addClass('is-loading');
$buttons.prop('disabled', true);
$message.removeClass('is-success is-error').empty();
(remove ? couponService.remove() : couponService.apply(couponCode)).done(function (response) {
if (response && response.success) {
window.location.reload();
return;
}
$message
.addClass('is-error')
.text(response && response.message
? response.message
: $.mage.__('We could not update the coupon code.'));
}).fail(function (xhr) {
var response = xhr.responseJSON || {};
$message
.addClass('is-error')
.text(response.message ||
$.mage.__('We could not update the coupon code. Please try again.'));
}).always(function () {
$form.data('loading', false).removeClass('is-loading');
$buttons.prop('disabled', false);
});
}
};
});
@@ -0,0 +1,30 @@
define([
'jquery',
'mage/url',
'mage/cookies'
], function ($, urlBuilder) {
'use strict';
function save(code, remove) {
return $.ajax({
url: urlBuilder.build('esun_cart/coupon/save/'),
type: 'post',
dataType: 'json',
data: {
coupon_code: code || '',
remove: remove ? 1 : 0,
form_key: $.mage.cookies.get('form_key')
}
});
}
return {
apply: function (code) {
return save(code, false);
},
remove: function () {
return save('', true);
}
};
});
@@ -0,0 +1,121 @@
define([], function () {
'use strict';
return function (config, element) {
var slider = element.querySelector('.esun-recommended-products__slider'),
wrapper = element.querySelector('.esun-recommended-products__wrapper'),
previous = element.querySelector('.esun-recommended-products__previous'),
next = element.querySelector('.esun-recommended-products__next'),
pointerId = null,
startX = 0,
startScrollLeft = 0,
dragged = false,
lastPointerNavigation = 0;
if (!slider || !wrapper || !previous || !next) {
return;
}
function getMaxScroll() {
return Math.max(0, slider.scrollWidth - slider.clientWidth);
}
function getStep() {
var item = wrapper.querySelector('.esun-recommended-products__item'),
styles = window.getComputedStyle(wrapper),
gap = parseFloat(styles.columnGap || styles.gap) || 0;
return item ? item.getBoundingClientRect().width + gap : slider.clientWidth;
}
function updateNavigation() {
var maxScroll = getMaxScroll(),
atStart = slider.scrollLeft <= 1,
atEnd = slider.scrollLeft >= maxScroll - 1;
previous.disabled = atStart;
next.disabled = atEnd;
previous.classList.toggle('is-disabled', atStart);
next.classList.toggle('is-disabled', atEnd);
element.classList.toggle('has-overflow', maxScroll > 1);
}
function move(direction) {
var target = Math.max(0, Math.min(getMaxScroll(), slider.scrollLeft + direction * getStep()));
if (typeof slider.scrollTo === 'function') {
slider.scrollTo({left: target, behavior: 'smooth'});
} else {
slider.scrollLeft = target;
}
}
function bindButton(button, direction) {
button.addEventListener('pointerdown', function (event) {
if (event.button !== 0) {
return;
}
event.preventDefault();
event.stopPropagation();
lastPointerNavigation = Date.now();
move(direction);
}, true);
button.addEventListener('click', function (event) {
event.preventDefault();
event.stopPropagation();
if (Date.now() - lastPointerNavigation > 400) {
move(direction);
}
}, true);
}
bindButton(previous, -1);
bindButton(next, 1);
slider.addEventListener('scroll', updateNavigation, {passive: true});
slider.addEventListener('keydown', function (event) {
if (event.key === 'ArrowLeft' || event.key === 'ArrowRight') {
event.preventDefault();
move(event.key === 'ArrowLeft' ? -1 : 1);
}
});
slider.addEventListener('pointerdown', function (event) {
if (event.pointerType === 'touch' || event.button !== 0 ||
event.target.closest('button, input, select, textarea')) {
return;
}
pointerId = event.pointerId;
startX = event.clientX;
startScrollLeft = slider.scrollLeft;
dragged = false;
slider.setPointerCapture(pointerId);
slider.classList.add('is-dragging');
});
slider.addEventListener('pointermove', function (event) {
if (event.pointerId !== pointerId) {
return;
}
dragged = dragged || Math.abs(event.clientX - startX) > 4;
slider.scrollLeft = startScrollLeft - (event.clientX - startX);
});
slider.addEventListener('pointerup', function (event) {
if (event.pointerId === pointerId) {
slider.releasePointerCapture(pointerId);
pointerId = null;
slider.classList.remove('is-dragging');
}
});
slider.addEventListener('click', function (event) {
if (dragged) {
event.preventDefault();
event.stopPropagation();
dragged = false;
}
}, true);
window.addEventListener('resize', updateNavigation);
window.requestAnimationFrame(updateNavigation);
};
});
@@ -0,0 +1,117 @@
define([], function () {
'use strict';
return function (config, element) {
var slider = element.querySelector('.esun-recommended-products__slider'),
wrapper = element.querySelector('.esun-recommended-products__wrapper'),
previous = element.querySelector('.esun-recommended-products__previous'),
next = element.querySelector('.esun-recommended-products__next'),
pointerId = null,
startX = 0,
startScrollLeft = 0,
dragged = false,
pointerNavigation = null;
if (!slider || !wrapper || !previous || !next) {
return;
}
function getMaxScroll() {
return Math.max(0, slider.scrollWidth - slider.clientWidth);
}
function getStep() {
var firstItem = wrapper.querySelector('.esun-recommended-products__item'),
styles = window.getComputedStyle(wrapper),
gap = parseFloat(styles.columnGap || styles.gap) || 0;
return firstItem ? firstItem.getBoundingClientRect().width + gap : slider.clientWidth;
}
function updateNavigation() {
var maxScroll = getMaxScroll(),
atStart = slider.scrollLeft <= 1,
atEnd = slider.scrollLeft >= maxScroll - 1;
previous.disabled = atStart;
next.disabled = atEnd;
previous.classList.toggle('is-disabled', atStart);
next.classList.toggle('is-disabled', atEnd);
element.classList.toggle('has-overflow', maxScroll > 1);
}
function scroll(direction) {
slider.scrollBy({
left: direction * getStep(),
behavior: 'smooth'
});
}
function bindNavigation(button, direction) {
button.addEventListener('pointerdown', function (event) {
if (event.button !== 0) {
return;
}
pointerNavigation = button;
scroll(direction);
}, true);
button.addEventListener('click', function () {
if (pointerNavigation === button) {
pointerNavigation = null;
return;
}
scroll(direction);
});
}
bindNavigation(previous, -1);
bindNavigation(next, 1);
slider.addEventListener('scroll', updateNavigation, {passive: true});
slider.addEventListener('keydown', function (event) {
if (event.key === 'ArrowLeft' || event.key === 'ArrowRight') {
event.preventDefault();
scroll(event.key === 'ArrowLeft' ? -1 : 1);
}
});
slider.addEventListener('pointerdown', function (event) {
if (event.pointerType === 'touch' || event.button !== 0 ||
event.target.closest('button, input, select, textarea')) {
return;
}
pointerId = event.pointerId;
startX = event.clientX;
startScrollLeft = slider.scrollLeft;
dragged = false;
slider.setPointerCapture(pointerId);
slider.classList.add('is-dragging');
});
slider.addEventListener('pointermove', function (event) {
if (event.pointerId !== pointerId) {
return;
}
if (Math.abs(event.clientX - startX) > 4) {
dragged = true;
}
slider.scrollLeft = startScrollLeft - (event.clientX - startX);
});
slider.addEventListener('pointerup', function (event) {
if (event.pointerId === pointerId) {
slider.releasePointerCapture(pointerId);
pointerId = null;
slider.classList.remove('is-dragging');
}
});
slider.addEventListener('click', function (event) {
if (dragged) {
event.preventDefault();
event.stopPropagation();
dragged = false;
}
}, true);
window.addEventListener('resize', updateNavigation);
window.requestAnimationFrame(updateNavigation);
};
});
@@ -0,0 +1,44 @@
define([
'jquery',
'Magento_Ui/js/modal/alert'
], function ($, alert) {
'use strict';
return function (config) {
var buttonSelector = 'button.action.tocart, [data-role="esun-buy-now"], #top-cart-btn-checkout',
formSelector = '[data-role="tocart-form"], #product_addtocart_form';
function showNotice() {
var content = $('<p>', {
'class': 'esun-test-mode-modal__message',
text: config.message
}).prop('outerHTML');
alert({
modalClass: 'esun-test-mode-modal',
title: config.title,
content: content
});
}
document.addEventListener('click', function (event) {
if (event.target.closest(buttonSelector)) {
event.preventDefault();
event.stopImmediatePropagation();
showNotice();
}
}, true);
document.addEventListener('submit', function (event) {
if (event.target.matches(formSelector)) {
event.preventDefault();
event.stopImmediatePropagation();
showNotice();
}
}, true);
if (new URLSearchParams(window.location.search).get('purchase_test_mode') === '1') {
showNotice();
}
};
});
@@ -0,0 +1,18 @@
define([
'uiComponent'
], function (Component) {
'use strict';
return Component.extend({
defaults: {
template: 'Esun_Cart/checkout/services'
},
initialize: function () {
this._super();
this.services = window.checkoutConfig.esunCartServices || {};
return this;
}
});
});
@@ -0,0 +1,519 @@
define([
'Magento_Checkout/js/view/minicart',
'Magento_Customer/js/customer-data',
'jquery',
'ko',
'Magento_Ui/js/modal/alert',
'Magento_Ui/js/modal/confirm',
'mage/url',
'Esun_Cart/js/model/coupon-service',
'Esun_Reward/js/model/reward-service',
'mage/translate',
'mage/cookies'
], function (Minicart, customerData, $, ko, alert, confirm, urlBuilder, couponService, rewardService) {
'use strict';
return Minicart.extend({
initialize: function () {
var result,
self = this;
this.isCartSyncing = ko.observable(true);
this.customer = customerData.get('customer');
this.couponCodeInput = ko.observable('');
this.appliedCouponCode = ko.observable('');
this.couponMessage = ko.observable('');
this.couponMessageType = ko.observable('');
this.isCouponLoading = ko.observable(false);
this.rewardPointsInput = ko.observable(0);
this.rewardMessage = ko.observable('');
this.rewardMessageType = ko.observable('');
this.isRewardLoading = ko.observable(false);
this.cartRefreshInProgress = false;
this.cartRefreshPending = false;
this.itemQtyUpdateInProgress = {};
this.itemRemoveInProgress = {};
this.lastCartRefreshAt = 0;
result = this._super();
this.bindDrawerEvents();
if (!this.openAfterAddRedirect()) {
self.refreshCart(true);
}
return result;
},
update: function (updatedCart) {
this._super(updatedCart);
this.applyCartState(updatedCart);
if (updatedCart && updatedCart.drawer_totals) {
this.appliedCouponCode(updatedCart.drawer_totals.coupon_code || '');
this.couponCodeInput(updatedCart.drawer_totals.coupon_code || '');
}
if (updatedCart && updatedCart.reward) {
this.rewardPointsInput(Number(updatedCart.reward.applied_points || 0));
}
},
applyCartState: function (cart) {
var hasItems = Boolean(
cart && (
Number(cart.summary_count) > 0 ||
cart.items && cart.items.length
)
);
$('[data-block="minicart"]')
.toggleClass('has-cart-items', hasItems)
.toggleClass('has-no-cart-items', !hasItems);
},
bindDrawerEvents: function () {
var $minicart = $('[data-block="minicart"]'),
self = this;
$minicart.off('.esunCartDrawer')
.on('dropdowndialogopen.esunCartDrawer', function () {
self.refreshCart(false);
$('body').addClass('esun-cart-is-open');
$minicart.find('.action.showcart').attr('aria-expanded', 'true');
window.setTimeout(function () {
$minicart.find('#btn-minicart-close').trigger('focus');
}, 0);
})
.on('dropdowndialogclose.esunCartDrawer', function () {
$('body').removeClass('esun-cart-is-open');
$minicart.find('.action.showcart').attr('aria-expanded', 'false');
$minicart.find('.action.showcart').trigger('focus');
})
.on('click.esunCartDrawer', '[data-role="esun-cart-backdrop"]', function () {
self.closeMinicart();
})
.on('keydown.esunCartDrawer', '.esun-cart-drawer', function (event) {
self.trapFocus(event, $(this));
});
$(document).off('ajax:addToCart.esunCartDrawer')
.on('ajax:addToCart.esunCartDrawer', function (event, data) {
if (!self.isSuccessfulAddResponse(data && data.response)) {
return;
}
self.refreshCart(true);
window.setTimeout(function () {
self.openMinicartAfterAdd();
}, 150);
})
.off('ajax:removeFromCart.esunCartDrawer')
.on('ajax:removeFromCart.esunCartDrawer', function () {
self.refreshCart(true);
})
.off('esun:customerCouponApplied.esunCartDrawer')
.on('esun:customerCouponApplied.esunCartDrawer', function (event, response) {
self.couponCodeInput(response && response.coupon_code || '');
self.appliedCouponCode(response && response.coupon_code || '');
self.couponMessageType('success');
self.couponMessage(response && response.message || $.mage.__('The coupon code was applied.'));
self.refreshCart(true);
});
},
isSuccessfulAddResponse: function (response) {
var messages;
response = response || {};
messages = String(response.messages || '').toLowerCase();
return !response.backUrl &&
response.success !== false &&
!response.error &&
!response.error_message &&
messages.indexOf('message-error') === -1 &&
messages.indexOf('message error') === -1 &&
!(response.product && response.product.statusText);
},
openMinicartAfterAdd: function () {
var $minicart = $('[data-block="minicart"]'),
$trigger = $minicart.find('.action.showcart');
if (!$minicart.length || !$trigger.length || $minicart.hasClass('active')) {
return;
}
$trigger.trigger('click');
},
openAfterAddRedirect: function () {
var shouldCheck = false,
countBeforeAdd = 0,
self = this;
try {
shouldCheck = window.sessionStorage.getItem('esunOpenMinicartAfterAdd') === '1';
countBeforeAdd = Number(
window.sessionStorage.getItem('esunCartCountBeforeAdd')
) || 0;
window.sessionStorage.removeItem('esunOpenMinicartAfterAdd');
window.sessionStorage.removeItem('esunCartCountBeforeAdd');
} catch (error) {
shouldCheck = false;
}
if (!shouldCheck) {
return false;
}
this.refreshCart(true, function (cart) {
if (Number(cart && cart.summary_count) > countBeforeAdd) {
window.setTimeout(function () {
self.openMinicartAfterAdd();
}, 150);
}
});
return true;
},
refreshCart: function (force, onSuccess) {
var self = this,
now = Date.now(),
request,
safetyTimer;
if (this.cartRefreshInProgress) {
if (force) {
this.cartRefreshPending = true;
}
return;
}
// Avoid a duplicate request when the drawer is opened immediately
// after the initial page-level customer-data synchronization.
if (!force && now - this.lastCartRefreshAt < 3000) {
this.isCartSyncing(false);
return;
}
this.cartRefreshInProgress = true;
this.isCartSyncing(true);
$('[data-block="minicart"]').addClass('is-cart-syncing');
// Do not wait for Magento_Customer's global initializer here. The
// custom theme does not output it on every page, which would leave
// customerData.reload() queued forever.
request = $.ajax({
url: urlBuilder.build('customer/section/load/'),
type: 'get',
dataType: 'json',
cache: false,
data: {
sections: 'cart',
force_new_section_timestamp: true
}
});
safetyTimer = window.setTimeout(function () {
self.cartRefreshInProgress = false;
self.lastCartRefreshAt = Date.now();
self.isCartSyncing(false);
$('[data-block="minicart"]').removeClass('is-cart-syncing');
}, 15000);
request.done(function (sections) {
var cart = sections && sections.cart;
// Release the loading UI before notifying subscribers so a
// renderer error cannot leave the drawer permanently loading.
self.isCartSyncing(false);
if (cart) {
self.update(cart);
$(document).trigger('esun:cartUpdated', [cart]);
if (typeof onSuccess === 'function') {
onSuccess(cart);
}
window.setTimeout(function () {
self.initSidebar();
}, 0);
}
}).always(function () {
var shouldRefreshAgain = self.cartRefreshPending;
window.clearTimeout(safetyTimer);
self.cartRefreshInProgress = false;
self.cartRefreshPending = false;
self.lastCartRefreshAt = Date.now();
self.isCartSyncing(false);
$('[data-block="minicart"]').removeClass('is-cart-syncing');
if (shouldRefreshAgain) {
window.setTimeout(function () {
self.refreshCart(true);
}, 0);
}
});
},
trapFocus: function (event, $drawer) {
var $focusable,
first,
last;
if (event.key !== 'Tab') {
return;
}
$focusable = $drawer.find('a, button, input, select, [tabindex]')
.filter(':visible:not(:disabled)');
if (!$focusable.length) {
return;
}
first = $focusable.get(0);
last = $focusable.get($focusable.length - 1);
if (event.shiftKey && document.activeElement === first) {
event.preventDefault();
last.focus();
} else if (!event.shiftKey && document.activeElement === last) {
event.preventDefault();
first.focus();
}
},
getCartItems: function () {
return this.getCartParamUnsanitizedHtml('items') || [];
},
getDrawerTotals: function () {
return this.getCartParamUnsanitizedHtml('drawer_totals') || {
subtotal: '',
discount: '',
shipping: '',
grand_total: '',
has_shipping_estimate: false,
shipping_description: '',
coupon_code: ''
};
},
getReward: function () {
return this.getCartParamUnsanitizedHtml('reward') || {
logged_in: false, balance: 0, applied_points: 0, maximum: 1500, rate: 100
};
},
updateRewardTotals: function (response) {
var totals = $.extend({}, this.getDrawerTotals());
totals.reward_discount = response.reward_discount || '';
if (response.grand_total) {
totals.grand_total = response.grand_total;
}
this.cart.drawer_totals(totals);
},
saveRewardPoints: function () {
var self = this, points = Math.max(0, parseInt(this.rewardPointsInput(), 10) || 0);
if (this.isRewardLoading()) { return false; }
this.isRewardLoading(true); this.rewardMessage(''); this.rewardMessageType('');
rewardService.apply(points).done(function (response) {
self.rewardMessageType('success'); self.rewardMessage(response.message || '');
self.refreshCart(true, function () { self.updateRewardTotals(response); });
}).fail(function (xhr) {
var response = xhr.responseJSON || {}; self.rewardMessageType('error'); self.rewardMessage(response.message || $.mage.__('Unable to apply reward points.'));
}).always(function () { self.isRewardLoading(false); });
return false;
},
saveCoupon: function (remove) {
var self = this,
couponCode = $.trim(this.couponCodeInput());
if (this.isCouponLoading()) {
return false;
}
if (!remove && !couponCode) {
this.couponMessageType('error');
this.couponMessage($.mage.__('Please enter a coupon code.'));
return false;
}
this.isCouponLoading(true);
this.couponMessage('');
this.couponMessageType('');
(remove ? couponService.remove() : couponService.apply(couponCode)).done(function (response) {
if (!response || !response.success) {
self.couponMessageType('error');
self.couponMessage(response && response.message
? response.message
: $.mage.__('We could not update the coupon code.'));
return;
}
self.couponCodeInput(response.coupon_code || '');
self.appliedCouponCode(response.coupon_code || '');
self.couponMessageType('success');
self.couponMessage(response.message || '');
self.refreshCart(true);
}).fail(function (xhr) {
var response = xhr.responseJSON || {};
self.couponMessageType('error');
self.couponMessage(response.message ||
$.mage.__('We could not update the coupon code. Please try again.'));
}).always(function () {
self.isCouponLoading(false);
});
return false;
},
getProgress: function () {
return this.getCartParamUnsanitizedHtml('purchase_progress') || {
message: '',
progress_percent: 0,
milestones: []
};
},
changeItemQty: function (itemId, difference) {
var $input = $('#cart-item-' + itemId + '-qty'),
quantity = parseFloat($input.val()) || 1,
minimumQty = parseFloat($input.attr('min')) || 1,
nextQuantity = Math.max(minimumQty, quantity + difference);
if (nextQuantity === quantity || this.itemQtyUpdateInProgress[itemId]) {
return;
}
$input.val(nextQuantity);
this.updateItemQty(itemId, nextQuantity, quantity, $input);
},
updateItemQty: function (itemId, quantity, previousQuantity, $input) {
var self = this,
$qtyButtons = $input.closest('[data-role="qty-box"]')
.find('.esun-cart-item__qty-button');
this.itemQtyUpdateInProgress[itemId] = true;
$qtyButtons.prop('disabled', true);
$.ajax({
url: window.checkout.updateItemQtyUrl || urlBuilder.build('checkout/sidebar/updateItemQty/'),
type: 'post',
dataType: 'json',
data: {
item_id: itemId,
item_qty: quantity,
form_key: $.mage.cookies.get('form_key')
}
}).done(function (response) {
if (response && response.success) {
self.refreshCart(true);
return;
}
$input.val(previousQuantity);
alert({
content: response && response.error_message
? response.error_message
: $.mage.__('Unable to update the cart item quantity.')
});
}).fail(function (xhr) {
var response = xhr.responseJSON || {};
$input.val(previousQuantity);
alert({
content: response.error_message || response.message ||
$.mage.__('Unable to update the cart item quantity.')
});
}).always(function () {
delete self.itemQtyUpdateInProgress[itemId];
$qtyButtons.prop('disabled', false);
});
},
removeItem: function (itemId) {
var self = this;
if (this.itemRemoveInProgress[itemId]) {
return false;
}
confirm({
content: $.mage.__('Are you sure you would like to remove this item from the shopping cart?'),
actions: {
confirm: function () {
self.performRemoveItem(itemId);
}
}
});
return false;
},
performRemoveItem: function (itemId) {
var self = this;
this.itemRemoveInProgress[itemId] = true;
$.ajax({
url: window.checkout.removeItemUrl || urlBuilder.build('checkout/sidebar/removeItem/'),
type: 'post',
dataType: 'json',
data: {
item_id: itemId,
form_key: $.mage.cookies.get('form_key')
}
}).done(function (response) {
if (response && response.success) {
self.removeItemFromView(itemId);
self.refreshCart(true);
return;
}
alert({
content: response && response.error_message
? response.error_message
: $.mage.__('Unable to remove the cart item.')
});
}).fail(function (xhr) {
var response = xhr.responseJSON || {};
alert({
content: response.error_message || response.message ||
$.mage.__('Unable to remove the cart item.')
});
}).always(function () {
delete self.itemRemoveInProgress[itemId];
});
},
removeItemFromView: function (itemId) {
var items = this.getCartItems(),
removedQuantity = 0,
remainingItems = $.grep(items, function (item) {
if (Number(item.item_id) === Number(itemId)) {
removedQuantity += Number(item.qty) || 0;
return false;
}
return true;
}),
summaryCount = Math.max(
0,
Number(this.getCartParamUnsanitizedHtml('summary_count') || 0) - removedQuantity
),
cartSnapshot = {
items: remainingItems,
summary_count: summaryCount
};
this.update(cartSnapshot);
$(document).trigger('esun:cartUpdated', [cartSnapshot]);
}
});
});
@@ -0,0 +1,16 @@
<div class="esun-checkout-services">
<section class="esun-checkout-service esun-checkout-service--payment">
<h2 data-bind="i18n: 'Payment & Security'"></h2>
<div data-bind="html: services.paymentSecurity"></div>
</section>
<div class="esun-checkout-service--delivery esun-product-accordion">
<details class="esun-product-accordion__item" open>
<summary class="esun-product-accordion__summary">
<span data-bind="i18n: 'Delivery and Shipping'"></span>
</summary>
<div class="esun-product-accordion__content"
data-bind="html: services.deliveryShipping"></div>
</details>
</div>
</div>
@@ -0,0 +1,270 @@
<!--
/**
* eSUN cart drawer content.
*/
-->
<div class="esun-cart-drawer__contents">
<header class="esun-cart-drawer__header">
<div class="esun-cart-drawer__title-wrap">
<span class="esun-cart-drawer__icon" aria-hidden="true"></span>
<strong id="esun-cart-title" class="esun-cart-drawer__title" translate="'My Shopping Cart'"></strong>
<span class="items-total esun-cart-drawer__count">
(<span text="getCartParam('summary_count') || 0"></span>)
</span>
</div>
<button type="button"
id="btn-minicart-close"
class="action close"
data-action="close"
data-bind="attr: {title: $t('Close')}, click: closeMinicart">
<span translate="'Close'"></span>
</button>
</header>
<!-- ko if: getCartParam('vat_prompt') && getCartParam('vat_prompt').show -->
<div class="cart_list_tips">
<span translate="'If you are an EU VAT registered business, please contact Customer Service to'"></span>
<a data-bind="attr: {href: getCartParam('vat_prompt').apply_url}" translate="'Apply for Tax Exemption'"></a>
<span translate="'and make your purchases through the B2B account to apply the appropriate tax exemption provisions.'"></span>
</div>
<!-- /ko -->
<div class="esun-cart-empty">
<strong translate="'Your shopping cart is empty.'"></strong>
<a class="action primary" data-bind="attr: {href: shoppingCartUrl}" translate="'Continue Shopping'"></a>
</div>
<section class="esun-cart-items-panel">
<ol id="mini-cart"
class="minicart-items"
data-bind="foreach: {data: getCartItems(), as: 'item'}">
<li class="product-item" data-role="product-item">
<div class="product">
<span class="product-image-container">
<span class="product-image-wrapper">
<img class="product-image-photo"
data-bind="attr: {
src: item.product_image.src,
alt: item.product_image.alt,
width: item.product_image.width,
height: item.product_image.height
}"/>
</span>
</span>
<div class="product-item-details">
<div class="esun-cart-item__heading">
<!-- ko if: item.is_esun_free_gift -->
<span class="product-item-name" data-bind="html: item.product_name"></span>
<!-- /ko -->
<!-- ko ifnot: item.is_esun_free_gift -->
<a class="product-item-name"
data-bind="attr: {href: item.product_url},
html: item.product_name"></a>
<!-- /ko -->
<!-- ko if: item.is_esun_free_gift -->
<span class="esun-free-gift-label" data-bind="i18n: 'Free Gift'"></span>
<!-- /ko -->
<!-- ko ifnot: item.is_esun_free_gift -->
<a href="#"
class="action esun-cart-item__remove"
data-bind="attr: {
'data-cart-item': item.item_id,
title: $t('Remove item'),
'aria-label': $t('Remove item')
}, click: $parent.removeItem.bind($parent, item.item_id)">
<span translate="'Remove item'"></span>
</a>
<!-- /ko -->
</div>
<!-- ko if: item.options && item.options.length -->
<div class="product options">
<!-- ko foreach: item.options -->
<div class="esun-cart-item__option">
<span class="label" data-bind="text: label + ':'"></span>
<span class="values" data-bind="html: value"></span>
</div>
<!-- /ko -->
</div>
<!-- /ko -->
<div class="esun-cart-item__bottom">
<!-- ko if: item.is_esun_free_gift -->
<div class="esun-cart-item__qty esun-cart-item__qty--locked">
<span data-bind="i18n: 'Qty'"></span>:
<strong data-bind="text: item.qty"></strong>
</div>
<!-- /ko -->
<!-- ko ifnot: item.is_esun_free_gift -->
<div class="esun-cart-item__qty" data-role="qty-box">
<button type="button"
class="esun-cart-item__qty-button"
data-bind="click: function () {$parent.changeItemQty(item.item_id, -1)},
disable: Number(item.qty) <= Number(item.min_sale_qty || 1),
attr: {'aria-label': $t('Decrease quantity')}">−</button>
<input type="number"
class="item-qty cart-item-qty"
readonly
data-bind="attr: {
id: 'cart-item-' + item.item_id + '-qty',
'data-cart-item': item.item_id,
'data-item-qty': item.qty,
min: item.min_sale_qty || 1,
'aria-label': $t('Quantity')
}, value: item.qty"/>
<button type="button"
class="esun-cart-item__qty-button"
data-bind="click: function () {$parent.changeItemQty(item.item_id, 1)},
attr: {'aria-label': $t('Increase quantity')}">+</button>
<button type="button"
class="update-cart-item"
style="display: none"
data-bind="attr: {
id: 'update-cart-item-' + item.item_id,
'data-cart-item': item.item_id
}"
translate="'Update'">
</button>
</div>
<!-- /ko -->
<div class="esun-cart-item__price">
<strong data-bind="html: item.line_total || item.product_price"></strong>
<!-- ko if: item.original_price -->
<span class="old-price" data-bind="html: item.original_price"></span>
<!-- /ko -->
</div>
</div>
</div>
</div>
</li>
</ol>
</section>
<section class="esun-cart-totals" data-bind="with: getDrawerTotals()">
<div class="esun-cart-total-row subtotal">
<span translate="'Subtotal'"></span>
<span class="price" data-bind="html: $data.subtotal || ''"></span>
</div>
<div class="esun-cart-total-row">
<span translate="'Discount'"></span>
<span data-bind="html: $data.discount || ''"></span>
</div>
<!-- ko if: $data.reward_discount -->
<div class="esun-cart-total-row">
<span>
<span translate="'Points Discount'"></span>
(<span data-bind="text: $parent.getReward().applied_points"></span>
<span translate="'points'"></span>)
</span>
<span data-bind="html: $data.reward_discount"></span>
</div>
<!-- /ko -->
<div class="esun-cart-total-row">
<span translate="'Estimated Shipping'"></span>
<!-- ko if: $data.has_shipping_estimate -->
<span data-bind="html: $data.shipping || '', attr: {title: $data.shipping_description || ''}"></span>
<!-- /ko -->
<!-- ko ifnot: $data.has_shipping_estimate -->
<span class="esun-cart-total-row__pending" translate="'Calculated at checkout'"></span>
<!-- /ko -->
</div>
<div class="esun-cart-total-row esun-cart-total-row--grand">
<strong translate="'Total'"></strong>
<strong data-bind="html: $data.grand_total || ''"></strong>
</div>
<div class="esun-coupon esun-coupon--mini">
<div class="esun-coupon__title" translate="'Discount Code'"></div>
<form class="esun-coupon__form"
data-bind="visible: !$parent.appliedCouponCode(),
submit: function () { return $parent.saveCoupon(false); }">
<label class="esun-coupon__label" for="esun-mini-coupon-code">
<span translate="'Enter discount code'"></span>
</label>
<div class="esun-coupon__controls">
<input class="input-text esun-coupon__input"
id="esun-mini-coupon-code"
type="text"
autocomplete="off"
maxlength="255"
data-bind="value: $parent.couponCodeInput,
disable: $parent.isCouponLoading,
attr: {placeholder: $t('Enter discount code')}"/>
<button class="action esun-coupon__button"
type="submit"
data-bind="disable: $parent.isCouponLoading">
<span translate="'Apply'"></span>
</button>
<button class="action esun-coupon__picker-button"
type="button"
aria-haspopup="dialog"
data-role="open-coupon-picker">
<span translate="'My Coupons'"></span>
</button>
</div>
</form>
<div class="esun-coupon__applied"
data-bind="visible: $parent.appliedCouponCode">
<span>
<span data-bind="text: $t('Applied:')"></span>
<strong data-bind="text: $parent.appliedCouponCode"></strong>
</span>
<button class="action esun-coupon__remove"
type="button"
data-bind="click: function () { $parent.saveCoupon(true); },
disable: $parent.isCouponLoading">
<span translate="'Cancel'"></span>
</button>
<button class="action esun-coupon__picker-button"
type="button"
aria-haspopup="dialog"
data-role="open-coupon-picker">
<span translate="'My Coupons'"></span>
</button>
</div>
<!-- ko if: $parent.couponMessage -->
<div class="esun-coupon__message"
aria-live="polite"
data-bind="text: $parent.couponMessage,
css: 'is-' + $parent.couponMessageType()"></div>
<!-- /ko -->
</div>
<div class="esun-coupon esun-coupon--mini esun-reward-use esun-reward-use--mini">
<div class="esun-coupon__title" translate="'Use Points'"></div>
<!-- ko if: $parent.getReward().logged_in -->
<p class="esun-reward-use__balance"><span data-bind="i18n: 'Available balance:'"></span> <strong data-bind="text: $parent.getReward().balance"></strong> <span data-bind="i18n: 'points'"></span></p>
<form data-bind="submit: function () { return $parent.saveRewardPoints(); }">
<div class="esun-coupon__controls">
<label class="esun-coupon__label" for="esun-mini-reward-points" data-bind="i18n: 'Points to use'"></label>
<input id="esun-mini-reward-points" class="input-text esun-coupon__input" type="number" min="0" data-bind="value: $parent.rewardPointsInput, attr: {max: Math.min(Number($parent.getReward().balance), Number($parent.getReward().maximum))}, disable: $parent.isRewardLoading"/>
<button class="action esun-coupon__button" type="submit" data-bind="disable: $parent.isRewardLoading"><span data-bind="i18n: 'Apply'"></span></button>
</div>
<p class="note"><span data-bind="text: $parent.getReward().rate"></span> <span data-bind="i18n: 'points = $1. Maximum'"></span> <span data-bind="text: $parent.getReward().maximum"></span> <span data-bind="i18n: 'points per order.'"></span></p>
<!-- ko if: $parent.rewardMessage --><div data-bind="text: $parent.rewardMessage, css: 'is-' + $parent.rewardMessageType()"></div><!-- /ko -->
</form>
<!-- /ko -->
<!-- ko ifnot: $parent.getReward().logged_in --><p><a href="/customer/account/login/" data-bind="i18n: 'Sign in to use points.'"></a></p><!-- /ko -->
</div>
<button id="top-cart-btn-checkout"
type="button"
class="action primary checkout"
data-action="close"
translate="'Proceed to Checkout'">
</button>
<a class="action viewcart esun-cart-viewcart"
data-bind="attr: {href: $parent.shoppingCartUrl}"
translate="'My Shopping Cart'">
</a>
</section>
<!-- ko if: isCartSyncing() -->
<div class="esun-cart-empty esun-cart-loading" role="status">
<span class="esun-cart-loading__spinner" aria-hidden="true"></span>
<strong translate="'Loading your cart…'"></strong>
</div>
<!-- /ko -->
<each args="getRegion('sign-in-popup')" render=""></each>
</div>
@@ -0,0 +1,88 @@
<!--
/**
* eSUN cart drawer item.
*/
-->
<li class="product-item" data-role="product-item">
<div class="product">
<span class="product-image-container">
<span class="product-image-wrapper">
<img class="product-image-photo"
data-bind="attr: {src: product_image.src, alt: product_image.alt, width: product_image.width, height: product_image.height}"/>
</span>
</span>
<div class="product-item-details">
<!-- ko if: is_esun_free_gift -->
<span class="product-item-name" data-bind="html: product_name"></span>
<!-- /ko -->
<!-- ko ifnot: is_esun_free_gift -->
<a class="product-item-name"
data-bind="attr: {href: product_url}, html: product_name, click: $parents[1].closeMinicart"></a>
<!-- /ko -->
<!-- ko if: is_esun_free_gift -->
<span class="esun-free-gift-label" data-bind="i18n: 'Free Gift'"></span>
<!-- /ko -->
<!-- ko if: options && options.length -->
<div class="product options" data-bind="foreach: options">
<span class="label" data-bind="text: label + ':'"></span>
<span class="values" data-bind="html: value"></span>
</div>
<!-- /ko -->
<div class="esun-cart-item__bottom">
<!-- ko if: is_esun_free_gift -->
<div class="esun-cart-item__qty esun-cart-item__qty--locked">
<span data-bind="i18n: 'Qty'"></span>:
<strong data-bind="text: qty"></strong>
</div>
<!-- /ko -->
<!-- ko ifnot: is_esun_free_gift -->
<div class="esun-cart-item__qty" data-role="qty-box">
<button type="button"
class="esun-cart-item__qty-button"
data-bind="click: function () {$parents[1].changeItemQty(item_id, -1)},
disable: Number(qty) <= Number(min_sale_qty || 1),
attr: {'aria-label': $t('Decrease quantity')}">−</button>
<input type="number"
class="item-qty cart-item-qty"
readonly
data-bind="attr: {
id: 'cart-item-' + item_id + '-qty',
'data-cart-item': item_id,
'data-item-qty': qty,
min: min_sale_qty || 1,
'aria-label': $t('Quantity')
}, value: qty"/>
<button type="button"
class="esun-cart-item__qty-button"
data-bind="click: function () {$parents[1].changeItemQty(item_id, 1)}, attr: {'aria-label': $t('Increase quantity')}">+</button>
<button type="button"
class="update-cart-item"
style="display: none"
data-bind="attr: {id: 'update-cart-item-' + item_id, 'data-cart-item': item_id}"
translate="'Update'">
</button>
</div>
<!-- /ko -->
<div class="esun-cart-item__price">
<strong data-bind="html: line_total || product_price"></strong>
<!-- ko if: original_price -->
<span class="old-price" data-bind="html: original_price"></span>
<!-- /ko -->
</div>
</div>
</div>
<!-- ko ifnot: is_esun_free_gift -->
<a href="#"
class="action delete"
data-bind="attr: {'data-cart-item': item_id, title: $t('Remove item'), 'aria-label': $t('Remove item')}">
<span translate="'Remove'"></span>
</a>
<!-- /ko -->
</div>
</li>