init
This commit is contained in:
@@ -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>
|
||||
Reference in New Issue
Block a user