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,89 @@
<?php
/**
* @var \Magento\Customer\Block\Account\Forgotpassword $block
* @var \Magento\Framework\Escaper $escaper
*/
?>
<div class="esun-login" id="esun-forgotpassword">
<div class="esun-login__intro">
<div class="esun-login__intro-inner">
<h1 class="esun-login__title"><?= $escaper->escapeHtml(__('Welcome eSUN')) ?></h1>
<p class="esun-login__subtitle">
<?= $escaper->escapeHtml(__('Embark On A 3D Journey')) ?><br>
<?= $escaper->escapeHtml(__('A Provider Of 3D Printing Material Solutions')) ?>
</p>
</div>
</div>
<div class="esun-login__form-wrap">
<div class="esun-login__block" id="forgot-password-wrapper">
<p class="esun-hint">
<?= $escaper->escapeHtml(__('We Will Send You An Email To Reset Your Password')) ?>
</p>
<form class="esun-form"
action="<?= $escaper->escapeUrl($block->getUrl('customer/account/forgotpasswordpost')) ?>"
method="post"
id="form-validate"
data-mage-init='{"validation":{}}'
autocomplete="off">
<?= $block->getBlockHtml('formkey') ?>
<fieldset class="esun-fieldset">
<div class="esun-field esun-field--required field required">
<label class="esun-label" for="email_address"><span><?= $escaper->escapeHtml(__('Email')) ?></span></label>
<div class="esun-control">
<input type="email"
name="email"
id="email_address"
class="esun-input"
placeholder="<?= $escaper->escapeHtmlAttr(__('Your Email')) ?>"
title="<?= $escaper->escapeHtmlAttr(__('Email')) ?>"
value="<?= $escaper->escapeHtmlAttr($block->getEmailValue()) ?>"
data-validate="{required:true, 'validate-email':true}"
autofocus
/>
</div>
</div>
<?= $block->getChildHtml('form_additional_info') ?>
</fieldset>
<div class="esun-actions esun-actions--center">
<button type="submit" class="esun-btn">
<span><?= $escaper->escapeHtml(__('Send')) ?></span>
</button>
<a class="esun-cancel-link" href="<?= $escaper->escapeUrl($block->getUrl('customer/account/login')) ?>">
<?= $escaper->escapeHtml(__('Cancel')) ?>
</a>
</div>
</form>
</div>
</div>
<div class="esun-modal-overlay" id="esun-forgotpassword-modal">
<div class="esun-modal" role="dialog" aria-modal="true" aria-labelledby="esun-fp-modal-message">
<button type="button" class="esun-modal__close" id="esun-forgotpassword-modal-close" aria-label="<?= $escaper->escapeHtmlAttr(__('Close')) ?>">&times;</button>
<p class="esun-modal__message" id="esun-fp-modal-message">
<?= $escaper->escapeHtml(__('We have contacted you email')) ?><br>
<?= $escaper->escapeHtml(__('Please check it.')) ?>
</p>
<div class="esun-modal__actions">
<button type="button" class="esun-btn" id="esun-forgotpassword-modal-confirm">
<span><?= $escaper->escapeHtml(__('Confirm')) ?></span>
</button>
</div>
</div>
</div>
</div>
<script type="text/x-magento-init">
{
"#esun-forgotpassword": {
"Magento_Customer/js/esun-forgotpassword": {
"redirectUrl": "<?= $escaper->escapeUrl($block->getUrl('customer/account/login')) ?>"
}
}
}
</script>
@@ -0,0 +1,163 @@
<?php
/**
* eSUN customer address book.
*
* @var \Magento\Customer\Block\Address\Book $block
* @var \Magento\Framework\Escaper $escaper
* @var \Esun\Customer\ViewModel\AddressBook $viewModel
*/
$viewModel = $block->getData('view_model');
$defaultShippingId = (int) $block->getDefaultShipping();
$defaultBillingId = (int) $block->getDefaultBilling();
$defaultShipping = $defaultShippingId ? $block->getAddressById($defaultShippingId) : null;
$defaultBilling = $defaultBillingId ? $block->getAddressById($defaultBillingId) : null;
$additionalAddresses = $block->getAdditionalAddresses();
$shippingAddresses = [];
if ($defaultShipping instanceof \Magento\Customer\Api\Data\AddressInterface) {
$shippingAddresses[] = $defaultShipping;
}
if (is_array($additionalAddresses)) {
foreach ($additionalAddresses as $address) {
if ($address instanceof \Magento\Customer\Api\Data\AddressInterface) {
$shippingAddresses[] = $address;
}
}
}
?>
<section class="esun-address-book" data-mage-init='{"Esun_Customer/js/address-book":{}}'>
<h1 class="esun-address-book__title"><?= $escaper->escapeHtml(__('Manage Address Book')) ?></h1>
<nav class="esun-address-book__tabs" aria-label="<?= $escaper->escapeHtmlAttr(__('Address type')) ?>">
<button class="esun-address-book__tab is-active"
type="button"
data-address-tab="shipping"
aria-selected="true">
<?= $escaper->escapeHtml(__('Shipping Address')) ?>
</button>
<button class="esun-address-book__tab"
type="button"
data-address-tab="billing"
aria-selected="false">
<?= $escaper->escapeHtml(__('Billing Address')) ?>
</button>
<a class="esun-address-book__add" href="<?= $escaper->escapeUrl($block->getAddAddressUrl()) ?>">
<span class="esun-address-book__add-icon" aria-hidden="true">+</span>
<?= $escaper->escapeHtml(__('Add New Address')) ?>
</a>
</nav>
<div class="esun-address-book__panel is-active" data-address-panel="shipping">
<?php if ($shippingAddresses): ?>
<div class="esun-address-book__grid">
<?php foreach ($shippingAddresses as $address): ?>
<?php $addressId = (int) $address->getId(); ?>
<article class="esun-address-card">
<div class="esun-address-card__content">
<div class="esun-address-card__identity">
<strong><?= $escaper->escapeHtml($viewModel->getName($address)) ?></strong>
<?php if ($address->getTelephone()): ?>
<a href="tel:<?= $escaper->escapeHtmlAttr($address->getTelephone()) ?>">
<?= $escaper->escapeHtml($address->getTelephone()) ?>
</a>
<?php endif; ?>
</div>
<address>
<?php foreach ($viewModel->getStreetLines($address) as $streetLine): ?>
<span><?= $escaper->escapeHtml($streetLine) ?></span>
<?php endforeach; ?>
<?php if ($locality = $viewModel->getLocalityLine($address)): ?>
<span><?= $escaper->escapeHtml($locality) ?></span>
<?php endif; ?>
<?php if ($country = $viewModel->getCountryName($address)): ?>
<span><?= $escaper->escapeHtml($country) ?></span>
<?php endif; ?>
</address>
</div>
<div class="esun-address-card__actions">
<?php if ($addressId === $defaultShippingId): ?>
<span class="esun-address-card__default">
<?= $escaper->escapeHtml(__('Default')) ?>
</span>
<?php endif; ?>
<?php if ($addressId !== $defaultShippingId && $addressId !== $defaultBillingId): ?>
<a class="action delete"
href="#"
role="delete-address"
data-address="<?= $escaper->escapeHtmlAttr((string) $addressId) ?>">
<?= $escaper->escapeHtml(__('Delete')) ?>
</a>
<?php endif; ?>
<a class="action edit"
href="<?= $escaper->escapeUrl($block->getAddressEditUrl($addressId)) ?>">
<?= $escaper->escapeHtml(__('Edit')) ?>
</a>
</div>
</article>
<?php endforeach; ?>
</div>
<?php else: ?>
<div class="esun-address-book__empty">
<?= $escaper->escapeHtml(__('You have no shipping address in your address book.')) ?>
</div>
<?php endif; ?>
</div>
<div class="esun-address-book__panel" data-address-panel="billing" hidden>
<?php if ($defaultBilling): ?>
<div class="esun-address-book__grid">
<article class="esun-address-card">
<div class="esun-address-card__content">
<div class="esun-address-card__identity">
<strong><?= $escaper->escapeHtml($viewModel->getName($defaultBilling)) ?></strong>
<?php if ($defaultBilling->getTelephone()): ?>
<a href="tel:<?= $escaper->escapeHtmlAttr($defaultBilling->getTelephone()) ?>">
<?= $escaper->escapeHtml($defaultBilling->getTelephone()) ?>
</a>
<?php endif; ?>
</div>
<address>
<?php foreach ($viewModel->getStreetLines($defaultBilling) as $streetLine): ?>
<span><?= $escaper->escapeHtml($streetLine) ?></span>
<?php endforeach; ?>
<?php if ($locality = $viewModel->getLocalityLine($defaultBilling)): ?>
<span><?= $escaper->escapeHtml($locality) ?></span>
<?php endif; ?>
<?php if ($country = $viewModel->getCountryName($defaultBilling)): ?>
<span><?= $escaper->escapeHtml($country) ?></span>
<?php endif; ?>
</address>
</div>
<div class="esun-address-card__actions">
<span class="esun-address-card__default">
<?= $escaper->escapeHtml(__('Default')) ?>
</span>
<a class="action edit"
href="<?= $escaper->escapeUrl($block->getAddressEditUrl($defaultBillingId)) ?>">
<?= $escaper->escapeHtml(__('Edit')) ?>
</a>
</div>
</article>
</div>
<?php else: ?>
<div class="esun-address-book__empty">
<p><?= $escaper->escapeHtml(__('You have no default billing address in your address book.')) ?></p>
<a class="action primary" href="<?= $escaper->escapeUrl($block->getAddAddressUrl()) ?>">
<?= $escaper->escapeHtml(__('Add New Address')) ?>
</a>
</div>
<?php endif; ?>
</div>
</section>
<script type="text/x-magento-init">
{
".esun-address-book": {
"address": {
"deleteAddress": "a[role='delete-address']",
"deleteUrlPrefix": "<?= $escaper->escapeJs($escaper->escapeUrl($block->getDeleteUrl())) ?>id/"
}
}
}
</script>
@@ -0,0 +1,101 @@
<?php
/**
*
* @var \Magento\Customer\Block\Form\Login $block
* @var \Magento\Framework\Escaper $escaper
*/
?>
<?php
$postActionUrl = $block->getPostActionUrl();
?>
<div class="esun-login">
<div class="esun-login__intro">
<div class="esun-login__intro-inner">
<h1 class="esun-login__title"><?= $escaper->escapeHtml(__('Welcome eSUN')) ?></h1>
<p class="esun-login__subtitle">
<?= $escaper->escapeHtml(__('Embark On A 3D Journey')) ?><br>
<?= $escaper->escapeHtml(__('A Provider Of 3D Printing Material Solutions')) ?>
</p>
</div>
</div>
<div class="esun-login__form-wrap">
<div class="esun-login__block" id="login-form-wrapper">
<form class="esun-form"
action="<?= $escaper->escapeUrl($postActionUrl) ?>"
method="post"
id="login-form"
data-mage-init='{"validation":{}}'>
<?= $block->getBlockHtml('formkey') ?>
<input name="context" type="hidden" value="checkout" />
<fieldset class="esun-fieldset">
<?= $block->getChildHtml('form_fields_before') ?>
<div class="esun-field field required">
<label class="esun-label" for="email"><span><?= $escaper->escapeHtml(__('Email')) ?></span></label>
<div class="esun-control">
<input name="login[username]"
id="email"
type="email"
class="esun-input"
placeholder="<?= $escaper->escapeHtmlAttr(__('Your Email')) ?>"
title="<?= $escaper->escapeHtmlAttr(__('Email')) ?>"
value="<?= $escaper->escapeHtmlAttr($block->getUsername()) ?>"
autofocus
data-validate="{required:true, 'validate-email':true}" />
</div>
</div>
<div class="esun-field field required">
<label class="esun-label" for="pass"><span><?= $escaper->escapeHtml(__('Password')) ?></span></label>
<div class="esun-control esun-control--password">
<input name="login[password]"
type="password"
class="esun-input"
id="pass"
placeholder="<?= $escaper->escapeHtmlAttr(__('Your Password')) ?>"
title="<?= $escaper->escapeHtmlAttr(__('Password')) ?>"
data-validate="{required:true}"
autocomplete="off" />
<button type="button" class="esun-password-toggle" aria-label="<?= $escaper->escapeHtmlAttr(__('Show/Hide Password')) ?>">
<span class="esun-icon-eye"></span>
</button>
</div>
</div>
<?= $block->getChildHtml('form_additional_info') ?>
</fieldset>
<div class="esun-actions">
<div class="esun-actions__left">
<button type="submit" class="esun-btn">
<span><?= $escaper->escapeHtml(__('Log In')) ?></span>
</button>
</div>
<div class="esun-actions__right">
<a class="esun-btn" href="<?= $escaper->escapeUrl($block->getUrl('customer/account/create')) ?>">
<?= $escaper->escapeHtml(__('Create an Account')) ?>
</a>
</div>
</div>
<div class="forgot-box">
<a class="esun-link" href="<?= $escaper->escapeUrl($block->getForgotPasswordUrl()) ?>">
<?= $escaper->escapeHtml(__('Forgot Your Password?')) ?>
</a>
</div>
</form>
</div>
</div>
</div>
<script type="text/x-magento-init">
{
".esun-login": {
"Magento_Customer/js/esun-login-password-toggle": {}
}
}
</script>
@@ -0,0 +1,192 @@
<?php
/**
* @var \Magento\Customer\Block\Form\Register $block
* @var \Magento\Framework\Escaper $escaper
*/
$subscriptionPromotion = $block->getData('subscription_promotion');
$showSubscriptionReminder = $subscriptionPromotion instanceof
\Esun\CustomerCoupon\ViewModel\RegistrationSubscriptionPromotion
&& $subscriptionPromotion->isReminderEnabled();
$subscriptionReminderMessage = $showSubscriptionReminder
? $subscriptionPromotion->getReminderMessage()
: '';
$subscriptionDiscountLabel = $showSubscriptionReminder
? $subscriptionPromotion->getDiscountLabel()
: '';
$subscriptionModalConfig = $showSubscriptionReminder
? [
'modalTitle' => (string)__('Do you want to give up this offer?'),
'subscribeButtonText' => (string)__('Subscribe and Get %1', $subscriptionDiscountLabel),
'declineButtonText' => (string)__('Give Up Offer and Continue')
]
: [];
?>
<div class="esun-login">
<div class="esun-login__intro">
<div class="esun-login__intro-inner">
<h1 class="esun-login__title"><?= $escaper->escapeHtml(__('Welcome eSUN')) ?></h1>
<p class="esun-login__subtitle">
<?= $escaper->escapeHtml(__('Embark On A 3D Journey')) ?><br>
<?= $escaper->escapeHtml(__('A Provider Of 3D Printing Material Solutions')) ?>
</p>
</div>
</div>
<div class="esun-login__form-wrap">
<div class="esun-login__block esun-login__block--wide" id="register-form-wrapper">
<form class="esun-form"
action="<?= $escaper->escapeUrl($block->getUrl('customer/account/createPost')) ?>"
method="post"
id="form-validate"
data-mage-init='{"validation":{}}'
autocomplete="off">
<?= $block->getBlockHtml('formkey') ?>
<?= $block->getChildHtml('form_fields_before') ?>
<fieldset class="esun-fieldset">
<div class="esun-field-row">
<div class="esun-field field required">
<label class="esun-label" for="lastname"><span><?= $escaper->escapeHtml(__('Last Name')) ?></span></label>
<div class="esun-control">
<input type="text"
id="lastname"
name="lastname"
class="esun-input"
placeholder="<?= $escaper->escapeHtmlAttr(__('Last Name')) ?>"
title="<?= $escaper->escapeHtmlAttr(__('Last Name')) ?>"
value="<?= $escaper->escapeHtmlAttr($block->getFormData()->getLastname()) ?>"
data-validate="{required:true}"
/>
</div>
</div>
<div class="esun-field field required">
<label class="esun-label" for="firstname"><span><?= $escaper->escapeHtml(__('First Name')) ?></span></label>
<div class="esun-control">
<input type="text"
id="firstname"
name="firstname"
class="esun-input"
placeholder="<?= $escaper->escapeHtmlAttr(__('First Name')) ?>"
title="<?= $escaper->escapeHtmlAttr(__('First Name')) ?>"
value="<?= $escaper->escapeHtmlAttr($block->getFormData()->getFirstname()) ?>"
data-validate="{required:true}"
/>
</div>
</div>
</div>
<div class="esun-field field required">
<label class="esun-label" for="email_address"><span><?= $escaper->escapeHtml(__('Email')) ?></span></label>
<div class="esun-control">
<input type="email"
name="email"
id="email_address"
class="esun-input"
placeholder="<?= $escaper->escapeHtmlAttr(__('Your Email')) ?>"
title="<?= $escaper->escapeHtmlAttr(__('Email')) ?>"
value="<?= $escaper->escapeHtmlAttr($block->getFormData()->getEmail()) ?>"
data-validate="{required:true, 'validate-email':true}"
/>
</div>
</div>
<div class="esun-field field required">
<label class="esun-label" for="password"><span><?= $escaper->escapeHtml(__('Password')) ?></span></label>
<div class="esun-control esun-control--password">
<input type="password"
name="password"
id="password"
class="esun-input"
placeholder="<?= $escaper->escapeHtmlAttr(__('Your Password')) ?>"
title="<?= $escaper->escapeHtmlAttr(__('Password')) ?>"
data-validate="{required:true, 'validate-password':true}"
autocomplete="off"
/>
<button type="button" class="esun-password-toggle" aria-label="<?= $escaper->escapeHtmlAttr(__('Show/Hide Password')) ?>">
<span class="esun-icon-eye"></span>
</button>
</div>
<p class="esun-field-note"><?= $escaper->escapeHtml(__('6-16 characters, combination of letters and numbers')) ?></p>
</div>
<div class="esun-field field required">
<label class="esun-label" for="password-confirmation"><span><?= $escaper->escapeHtml(__('Confirm Password')) ?></span></label>
<div class="esun-control esun-control--password">
<input type="password"
name="password_confirmation"
id="password-confirmation"
class="esun-input validate-cpassword"
placeholder="<?= $escaper->escapeHtmlAttr(__('Your Password')) ?>"
title="<?= $escaper->escapeHtmlAttr(__('Confirm Password')) ?>"
data-validate="{required:true}"
autocomplete="off"
/>
<button type="button" class="esun-password-toggle" aria-label="<?= $escaper->escapeHtmlAttr(__('Show/Hide Password')) ?>">
<span class="esun-icon-eye"></span>
</button>
</div>
</div>
<?= $block->getChildHtml('form_additional_info') ?>
<div class="esun-checkbox-field">
<input type="checkbox" id="agreement" name="agreement" value="1" data-validate="{required:true}" />
<label for="agreement">
<?= $escaper->escapeHtml(__('I have read and agree to the User')) ?>
<a href="#"><?= $escaper->escapeHtml(__('Registration Agreement')) ?></a>
<?= $escaper->escapeHtml(__('and the')) ?>
<a href="#"><?= $escaper->escapeHtml(__('Privacy Policy.')) ?></a>
</label>
</div>
<div class="esun-checkbox-field<?= $showSubscriptionReminder
? ' esun-checkbox-field--subscription'
: '' ?>"
<?php if ($showSubscriptionReminder): ?>data-role="subscription-reminder"<?php endif; ?>>
<input type="checkbox"
id="is_subscribed"
name="is_subscribed"
value="1"
<?php if ($showSubscriptionReminder): ?>aria-describedby="subscription-reminder-message"<?php endif; ?> />
<label for="is_subscribed">
<?= $escaper->escapeHtml(__('Subscribe to our weekly newsletters, security advisories, and promotional offers. (You can opt-out at any time).')) ?>
</label>
<?php if ($showSubscriptionReminder): ?>
<div class="esun-subscription-confirmation"
id="subscription-reminder-message"
data-role="subscription-confirmation">
<p><?= $escaper->escapeHtml($subscriptionReminderMessage) ?></p>
<p><?= $escaper->escapeHtml(
__('You can still create your account without subscribing.')
) ?></p>
</div>
<?php endif; ?>
</div>
</fieldset>
<div class="esun-actions">
<button type="submit" class="esun-btn esun-btn--block" title="<?= $escaper->escapeHtmlAttr(__('Create Account')) ?>">
<span><?= $escaper->escapeHtml(__('Create Account')) ?></span>
</button>
</div>
</form>
</div>
</div>
</div>
<script type="text/x-magento-init">
{
".esun-login": {
"Magento_Customer/js/esun-login-password-toggle": {}
<?php if ($showSubscriptionReminder): ?>,
"Magento_Customer/js/esun-register-subscription":
<?= /* @noEscape */ json_encode(
$subscriptionModalConfig,
JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_AMP | JSON_HEX_QUOT
) ?>
<?php endif; ?>
}
}
</script>