ltsecurityinc安防产品在线商城代码

This commit is contained in:
2026-09-14 17:47:10 +08:00
parent 57d8444c15
commit 6a3c9c5bd8
14539 changed files with 1775310 additions and 0 deletions
@@ -0,0 +1,83 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
// phpcs:disable Magento2.Templates.ThisInTemplate
/** @var $block \Magento\Checkout\Block\Cart\Grid */
?>
<?php $mergedCells = ($this->helper(Magento\Tax\Helper\Data::class)->displayCartBothPrices() ? 2 : 1); ?>
<?= $block->getChildHtml('form_before') ?>
<form action="<?= $block->escapeUrl($block->getUrl('checkout/cart/updatePost')) ?>"
method="post"
id="form-validate"
data-mage-init='{"Magento_Checkout/js/action/update-shopping-cart":
{"validationURL" : "<?= $block->escapeUrl($block->getUrl('checkout/cart/updateItemQty')) ?>",
"updateCartActionContainer": "#update_cart_action_container"}
}'
class="form form-cart">
<?= $block->getBlockHtml('formkey') ?>
<div class="cart table-wrapper<?= $mergedCells == 2 ? ' detailed' : '' ?>">
<?php if ($block->getPagerHtml()): ?>
<div class="cart-products-toolbar cart-products-toolbar-top toolbar"
data-attribute="cart-products-toolbar-top"><?= $block->getPagerHtml() ?>
</div>
<?php endif ?>
<table id="shopping-cart-table"
class="cart items data table"
data-mage-init='{"shoppingCart":{"emptyCartButton": "#empty_cart_button",
"updateCartActionContainer": "#update_cart_action_container"}}'>
<caption class="table-caption"><?= $block->escapeHtml(__('Shopping Cart Items')) ?></caption>
<thead>
<tr>
<th class="col item" scope="col"><span><?= $block->escapeHtml(__('Item')) ?></span></th>
<th class="col price" scope="col"><span><?= $block->escapeHtml(__('Price')) ?></span></th>
<th class="col qty" scope="col"><span><?= $block->escapeHtml(__('Qty')) ?></span></th>
<th class="col subtotal" scope="col"><span><?= $block->escapeHtml(__('Subtotal')) ?></span></th>
<th class="col actions" scope="col"><span><?= $block->escapeHtml(__('Actions')) ?></span></th>
</tr>
</thead>
<?php foreach ($block->getItems() as $_item): ?>
<?= $block->getItemHtml($_item) ?>
<?php endforeach ?>
</table>
<?php if ($block->getPagerHtml()): ?>
<div class="cart-products-toolbar cart-products-toolbar-bottom toolbar"
data-attribute="cart-products-toolbar-bottom"><?= $block->getPagerHtml() ?>
</div>
<?php endif ?>
</div>
<div class="cart main actions">
<?php if ($block->getContinueShoppingUrl()) :?>
<a class="action continue"
href="<?= $block->escapeUrl($block->getContinueShoppingUrl()) ?>"
title="<?= $block->escapeHtmlAttr(__('Continue Shopping')) ?>">
<span><?= $block->escapeHtml(__('Continue Shopping')) ?></span>
</a>
<?php endif; ?>
<?php if ($block->getViewModel()->isClearShoppingCartEnabled()): ?>
<button type="button"
name="update_cart_action"
data-cart-empty=""
value="empty_cart"
title="<?= $block->escapeHtmlAttr(__('Clear Shopping Cart')) ?>"
class="action clear" id="empty_cart_button">
<span><?= $block->escapeHtml(__('Clear Shopping Cart')) ?></span>
</button>
<?php endif ?>
<button type="submit"
name="update_cart_action"
data-cart-item-update=""
value="update_qty"
title="<?= $block->escapeHtmlAttr(__('Update Shopping Cart')) ?>"
class="action update">
<span><?= $block->escapeHtml(__('Update Shopping Cart')) ?></span>
</button>
<input type="hidden" value="" id="update_cart_action_container" data-cart-item-update=""/>
</div>
</form>
<?= $block->getChildHtml('checkout.cart.order.actions') ?>
<?= $block->getChildHtml('shopping.cart.table.after') ?>
@@ -0,0 +1,151 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
// phpcs:disable Magento2.Templates.ThisInTemplate
// phpcs:disable Generic.Files.LineLength
/** @var $block Renderer */
use Magento\Checkout\Block\Cart\Item\Renderer;
use Magento\Msrp\Helper\Data;
$_item = $block->getItem();
$product = $_item->getProduct();
$isVisibleProduct = $product->isVisibleInSiteVisibility();
/** @var Data $helper */
$helper = $this->helper(Magento\Msrp\Helper\Data::class);
$canApplyMsrp = $helper->isShowBeforeOrderConfirm($product) && $helper->isMinimalPriceLessMsrp($product);
?>
<tbody class="cart item">
<tr class="item-info">
<td data-th="<?= $block->escapeHtml(__('Item')) ?>" class="col item">
<?php if ($block->hasProductUrl()):?>
<a href="<?= $block->escapeUrl($block->getProductUrl()) ?>"
title="<?= $block->escapeHtml($block->getProductName()) ?>"
tabindex="-1"
class="product-item-photo">
<?php else:?>
<span class="product-item-photo">
<?php endif;?>
<?= $block->getImage($block->getProductForThumbnail(), 'cart_page_product_thumbnail')->toHtml() ?>
<?php if ($block->hasProductUrl()):?>
</a>
<?php else: ?>
</span>
<?php endif; ?>
<div class="product-item-details">
<strong class="product-item-name">
<?php if ($block->hasProductUrl()):?>
<a href="<?= $block->escapeUrl($block->getProductUrl()) ?>"><?= $block->escapeHtml($block->getProductName()) ?></a>
<?php else: ?>
<?= $block->escapeHtml($block->getProductName()) ?>
<?php endif; ?>
<br/>
<?= $block->escapeHtml($block->getItem()->getSku());?>
</strong>
<?php if ($_options = $block->getOptionList()):?>
<dl class="item-options">
<?php foreach ($_options as $_option) : ?>
<?php $_formatedOptionValue = $block->getFormatedOptionValue($_option) ?>
<dt><?= $block->escapeHtml($_option['label']) ?></dt>
<dd>
<?php if (isset($_formatedOptionValue['full_view'])): ?>
<?= $block->escapeHtml($_formatedOptionValue['full_view'], ['span', 'a']) ?>
<?php else: ?>
<?= $block->escapeHtml($_formatedOptionValue['value'], ['span', 'a']) ?>
<?php endif; ?>
</dd>
<?php endforeach; ?>
</dl>
<?php endif;?>
<?php if ($messages = $block->getMessages()): ?>
<?php foreach ($messages as $message): ?>
<div class= "cart item message <?= $block->escapeHtmlAttr($message['type']) ?>">
<div><?= $block->escapeHtml($message['text']) ?></div>
</div>
<?php endforeach; ?>
<?php endif; ?>
<?php $addInfoBlock = $block->getProductAdditionalInformationBlock(); ?>
<?php if ($addInfoBlock): ?>
<?= $addInfoBlock->setItem($_item)->toHtml() ?>
<?php endif;?>
</div>
</td>
<?php if ($canApplyMsrp): ?>
<td class="col msrp" data-th="<?= $block->escapeHtml(__('Price')) ?>">
<span class="pricing msrp">
<span class="msrp notice"><?= $block->escapeHtml(__('See price before order confirmation.')) ?></span>
<?php $helpLinkId = 'cart-msrp-help-' . $_item->getId(); ?>
<a href="#" class="action help map"
id="<?= ($block->escapeHtmlAttr($helpLinkId)) ?>"
data-mage-init='{"addToCart":{
"origin": "info",
"helpLinkId": "#<?= $block->escapeJs($block->escapeHtml($helpLinkId)) ?>",
"productName": "<?= $block->escapeJs($block->escapeHtml($product->getName())) ?>",
"showAddToCart": false
}
}'>
<span><?= $block->escapeHtml(__("What's this?")) ?></span>
</a>
</span>
</td>
<?php else: ?>
<td class="col price" data-th="<?= $block->escapeHtml(__('Price')) ?>">
<?= $block->getUnitPriceHtml($_item) ?>
</td>
<?php endif; ?>
<td class="col qty" data-th="<?= $block->escapeHtml(__('Qty')) ?>">
<div class="field qty">
<label class="label" for="cart-<?= $block->escapeHtmlAttr($_item->getId()) ?>-qty">
<span><?= $block->escapeHtml(__('Qty')) ?></span>
</label>
<div class="control qty qty-controls-wrap">
<a class="icon-minus qty-minus"></a>
<a class="icon-plus qty-plus"></a>
<input id="cart-<?= $block->escapeHtmlAttr($_item->getId()) ?>-qty"
name="cart[<?= $block->escapeHtmlAttr($_item->getId()) ?>][qty]"
data-cart-item-id="<?= $block->escapeHtmlAttr($_item->getSku()) ?>"
value="<?= $block->escapeHtmlAttr($block->getQty()) ?>"
type="number"
min="0"
size="4"
step="any"
title="<?= $block->escapeHtmlAttr(__('Qty')) ?>"
class="input-text qty"
data-validate="{required:true,'validate-greater-than-zero':true}"
data-item-qty="<?= $block->escapeHtmlAttr($block->getQty()) ?>"
data-role="cart-item-qty"/>
</div>
</div>
</td>
<td class="col subtotal" data-th="<?= $block->escapeHtml(__('Subtotal')) ?>">
<?php if ($canApplyMsrp): ?>
<span class="cart msrp subtotal">--</span>
<?php else: ?>
<?= $block->getRowTotalHtml($_item) ?>
<?php endif; ?>
</td>
<td class="col actions" data-th="<?= $block->escapeHtml(__('Actions')) ?>">
<a href="#"
title="<?= $block->escapeHtmlAttr(__('Remove item')) ?>"
class="action action-delete"
data-post='<?= /* @noEscape */ $this->helper('Magento\Checkout\Helper\Cart')->getDeletePostJson($_item) ?>'>
<span>
<?= $block->escapeHtml(__('Remove item')) ?>
</span>
</a>
</td>
</tr>
<tr class="item-actions">
<td colspan="5">
<div class="actions-toolbar">
<?= /* @noEscape */ $block->getActions($_item) ?>
</div>
</td>
</tr>
</tbody>
@@ -0,0 +1,85 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
/** @var $block Sidebar */
/** @var SecureHtmlRenderer $secureRenderer */
use Magento\Checkout\Block\Cart\Sidebar;
use Magento\Framework\View\Helper\SecureHtmlRenderer;
$athlete = $this->helper('Olegnax\Athlete2\Helper\Helper');
$cartBtnText = __('Cart');
$cartAddedText = __('Product added to cart');
$moveSticky = '';
if( $athlete->getConfig( 'athlete2_settings/header/header_layout' ) === 'header_1'){
$moveSticky ='ox-move-sticky ox-move-sticky-header.main.right ox-move-item ox-move-item-header.main.right';
}
?>
<div data-block="minicart" class="minicart-wrapper <?= $block->escapeHtmlAttr($moveSticky) ?>">
<a class="action showcart" href="<?= $block->escapeUrl($block->getShoppingCartUrl()) ?>"
data-bind="scope: 'minicart_content'">
<img class="lts-header-icon lts-header-icon--cart"
src="<?= $block->escapeUrl($block->getViewFileUrl('Magento_Theme::images/lts-header/header_cart_icon.png')) ?>"
width="20" height="20" alt="" aria-hidden="true"/>
<span class="text"><?= $block->escapeHtml($cartBtnText) ?></span>
<span class="counter qty">
<span class="counter-number">
<!-- ko text: getCartParam('summary_count').toLocaleString(window.LOCALE) -->0<!-- /ko -->
</span>
</span>
</a>
<?php if ($block->getIsNeedToDisplaySideBar()):
$minicart_type = $athlete->getConfig( 'athlete2_settings/header/minicart_type' );
?>
<div class="block block-minicart empty"
data-role="OXmodalMinicart"
data-mage-init='{"OXmodalMinicart":{
"triggerTarget":".showcart",
"overlayClass":"ox-slideout-shadow",
"timeout": "500",
"closeButtonTrigger":"#btn-minicart-close",
"closeOnEscape": true,
"closeOnMouseLeave": <?php echo 'dropdown-hover' == $block->escapeHtmlAttr($minicart_type) ? 'true' : 'false'; ?>,
"hoverOpen": <?php echo 'dropdown-hover' == $block->escapeHtmlAttr($minicart_type) ? 'true' : 'false'; ?>,
"type": "<?php echo 'slideout' == $block->escapeHtmlAttr($minicart_type) ? 'slideout' : ''; ?>",
"positionSlideout": "right",
"htmlClass":"ox-fixed"
}}'>
<div id="minicart-content-wrapper" data-bind="scope: 'minicart_content'">
<div class="message success"><span class="text"><?= $block->escapeHtml(__($cartAddedText)) ?></span></div>
<?php
$promo = $block->getLayout()->createBlock( 'Magento\Cms\Block\Block' )->setBlockId( 'athlete_cart_promotion' )->toHtml();
if ( !empty( $promo ) ) :
?>
<div class="athlete_cart_promotion-content"><?php echo $promo; ?></div>
<?php endif; ?>
<!-- ko template: getTemplate() --><!-- /ko -->
</div>
<?= $block->getChildHtml('minicart.addons') ?>
</div>
<?php else :?>
<?php $scriptString = <<<script
require(['jquery'], function ($) {
$('a.action.showcart').on('click', function() {
$(document.body).trigger('processStart');
});
});
script;
?>
<?= /* @noEscape */ $secureRenderer->renderTag('script', [], $scriptString, false); ?>
<?php endif ?>
<?= /* @noEscape */ $secureRenderer->renderTag('script', [], 'window.checkout = ' .
/* @noEscape */ $block->getSerializedConfig(), false); ?>
<script type="text/x-magento-init">
{
"[data-block='minicart']": {
"Magento_Ui/js/core/app": <?= /* @noEscape */ $block->getJsLayout() ?>
}
}
</script>
</div>
@@ -0,0 +1,32 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
/** @var $block Cart */
use Magento\Checkout\Block\Cart;
?>
<div class="cart-empty">
<?= $block->getChildHtml('checkout_cart_empty_widget') ?>
<div class="athlete2-icon-cart empty-cart-icon"></div>
<p class="cart-empty-big-text"><?= $block->escapeHtml(__('Your cart is empty.')) ?></p>
<p><?= $block->escapeHtml(
__(
'<a class="button" href="%1">Continue shopping.</a>',
$block->escapeUrl($block->getContinueShoppingUrl())
),
['a']
) ?>
</p>
<?= $block->getChildHtml('shopping.cart.table.after') ?>
</div>
<script type="text/x-magento-init">
{
"*": {
"Magento_Checkout/js/empty-cart": {}
}
}
</script>
@@ -0,0 +1,15 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
// phpcs:disable Magento2.Templates.ThisInTemplate
/** @var $block Cart */
use Magento\Checkout\Block\Cart;
?>
<h1 class="page-title"><span><?= $block->escapeHtml(__('Shopping Cart')) ?></span></h1>
@@ -0,0 +1,23 @@
<?php
$at_settings = $this->helper('Olegnax\Athlete2\Helper\Helper')->getConfig('athlete2_settings/header');
$header_classes = 'header--layout-' . substr($at_settings['header_layout'], -1);
if( $at_settings['header_fullwidth'] ) {
$header_classes .= ' header--full-width';
}
?>
<div class="page-header <?= $block->escapeHtmlAttr($header_classes) ?>">
<div class="sticky-wrapper">
<div class="container-fluid">
<div class="row">
<div class="col header__content-wrapper">
<div class="logo__container">
<?php echo $this->getChildHtml( "logo" ); ?>
</div>
<div class="flex-right flex-row">
</div>
</div>
</div>
</div>
</div>
</div>
@@ -0,0 +1,84 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
/** @var $block \Magento\Checkout\Block\Onepage */
/** @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */
?>
<div id="checkout" data-bind="scope:'checkout'" class="checkout-container">
<div id="checkout-loader" data-role="checkout-loader" class="loading-mask" data-mage-init='{"checkoutLoader": {}}'>
<div class="loader">
<img src="<?= $block->escapeUrl($block->getViewFileUrl('images/loader-1.gif')) ?>"
alt="<?= $block->escapeHtmlAttr(__('Loading...')) ?>">
</div>
</div>
<?= /* @noEscape */ $secureRenderer->renderStyleAsTag("position: absolute;", "#checkout-loader img") ?>
<!-- ko template: getTemplate() --><!-- /ko -->
<script type="text/x-magento-init">
{
"#checkout": {
"Magento_Ui/js/core/app": <?= /* @noEscape */ $block->getJsLayout() ?>
}
}
</script>
<?php $serializedCheckoutConfig = /* @noEscape */ $block->getSerializedCheckoutConfig();
$scriptString = <<<script
window.checkoutConfig = {$serializedCheckoutConfig};
// Create aliases for customer.js model from customer module
window.isCustomerLoggedIn = window.checkoutConfig.isCustomerLoggedIn;
window.customerData = window.checkoutConfig.customerData;
script;
?>
<?= /* @noEscape */ $secureRenderer->renderTag('script', [], $scriptString, false) ?>
<?php $scriptString = <<<script
require([
'mage/url',
'Magento_Ui/js/block-loader'
], function(url, blockLoader) {
blockLoader("{$block->escapeJs($block->escapeUrl($block->getViewFileUrl('images/loader-1.gif')))}");
return url.setBaseUrl('{$block->escapeJs($block->escapeUrl($block->getBaseUrl()))}');
})
script;
?>
<?= /* @noEscape */ $secureRenderer->renderTag('script', [], $scriptString, false) ?>
</div>
<div id="shipping-address-tip-modal">
<div class="modal-body-content">
<?= $this->getLayout()->createBlock('Magento\Cms\Block\Block')->setBlockId('lts_shipping_notice')->toHtml(); ?>
</div>
</div>
<script type="text/javascript">
require([
"jquery",
"Magento_Ui/js/modal/modal"
],function($, modal) {
var options = {
type: 'popup',
responsive: true,
title: 'Shipping Notice',
modalClass: 'shipping_tip',
responsive: true,
buttons: [{
text: $.mage.__('Ok'),
class: '',
click: function () {
this.closeModal();
}
}]
};
// 美国之外不配送提示
var popup = modal(options, $('#shipping-address-tip-modal'));
setTimeout(() => {
var selectedAddress = $('.shipping-address-item.selected-item .shipping-address-country').text();
if(selectedAddress && selectedAddress !=='United States'){
$('#shipping-address-tip-modal').modal('openModal');
}
}, 5000);
});
</script>
@@ -0,0 +1,30 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
use Magento\Checkout\Block\Onepage\Success;
// @codingStandardsIgnoreFile
?>
<?php /** @var $block Success */ ?>
<div class="checkout-success">
<?php if ($block->getOrderId()):?>
<?php if ($block->getCanViewOrder()) :?>
<p class="your-order-is"><?= $block->escapeHtml(__('Your order number is: %1', sprintf('<a href="%s" class="order-number"><strong>%s</strong></a>', $block->escapeUrl($block->getViewOrderUrl()), $block->getOrderId())), ['a', 'strong']) ?></p>
<?php else :?>
<p class="your-order-is"><?= $block->escapeHtml(__('Your order # is: %1', sprintf('<span class="order-number">%s</span>', $block->getOrderId())), ['span']) ?></p>
<?php endif;?>
<p><?= $block->escapeHtml(__('We\'ll email you an order confirmation with details and tracking info.')) ?></p>
<?php endif;?>
<?= $block->getAdditionalInfoHtml() ?>
<div class="actions-toolbar">
<div class="primary">
<a class="action primary continue" href="<?= $block->escapeUrl($block->getContinueUrl()) ?>"><span><?= $block->escapeHtml(__('Continue Shopping')) ?></span></a>
</div>
</div>
</div>