init
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
?>
|
||||
<?php /** @var $block \Magento\Checkout\Block\Onepage\Success */ ?>
|
||||
|
||||
<?php if ($block->getCanViewOrder() && $block->getCanPrintOrder()) :?>
|
||||
<a href="<?= $block->escapeUrl($block->getPrintUrl()) ?>"
|
||||
class="action print"
|
||||
target="_blank"
|
||||
rel="noopener">
|
||||
<?= $block->escapeHtml(__('Print receipt')) ?>
|
||||
</a>
|
||||
<?= $block->getChildHtml() ?>
|
||||
<?php endif;?>
|
||||
@@ -0,0 +1,141 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
?>
|
||||
<?php
|
||||
/**
|
||||
* Shopping cart template
|
||||
*
|
||||
* @var $block \Magento\Checkout\Block\Cart
|
||||
*/
|
||||
|
||||
if ($block->getItemsCount()) {
|
||||
// phpcs:ignore Magento2.Security.LanguageConstruct.DirectOutput
|
||||
echo $block->getChildHtml('with-items');
|
||||
} else {
|
||||
// phpcs:ignore Magento2.Security.LanguageConstruct.DirectOutput
|
||||
echo $block->getChildHtml('no-items');
|
||||
}
|
||||
?>
|
||||
|
||||
<script>
|
||||
require([
|
||||
'jquery'
|
||||
], function($){
|
||||
$('#shopping-cart-table .cart.item').first().addClass('first-item');
|
||||
|
||||
// 购物车选择销售
|
||||
$('.xiaos_list').change(function(){
|
||||
if($(this).val()){
|
||||
$('.yi_list,.hidden-lab-id').val('');
|
||||
$(this).removeClass('has-error');
|
||||
$('.sale-error-tip').hide();
|
||||
var salespersonId = $(this).val();
|
||||
$.ajax({
|
||||
url: BASE_URL+'stemcell_checkout/cart/getLabsFromSalesperson',
|
||||
data: {salesperson_id: salespersonId},
|
||||
type: 'get',
|
||||
dataType: 'json',
|
||||
cache: false,
|
||||
|
||||
/** @inheritdoc */
|
||||
success: function (res) {
|
||||
var labAccountHtml = '';
|
||||
if(res.labs && res.labs.length > 0){
|
||||
res.labs.forEach(item => {
|
||||
labAccountHtml += '<li data-lab="'+item.lab_id+'" data-lab-id="'+item.lab_code+'">'+item.booking_account+'</li>';
|
||||
});
|
||||
}
|
||||
$('.yi-list-select').html(labAccountHtml);
|
||||
},
|
||||
|
||||
/** @inheritdoc */
|
||||
error: function (res) {
|
||||
console.log('error res', res);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// 购物车产品详细信息Lab选择点击
|
||||
$('.yi_list').click(function(){
|
||||
if($('.yi-list-select').html()){
|
||||
$(this).next().show();
|
||||
}
|
||||
});
|
||||
$('body').click(function (e) {
|
||||
var target = $(e.target);
|
||||
if(!target.is('.yi_list,.yi-list-select-box,.yi-list-select-search')){
|
||||
$('.yi-list-select-box').hide();
|
||||
}
|
||||
});
|
||||
|
||||
// 购物车产品详细信息Lab选择输入后过滤结果列表
|
||||
$('.yi-list-select-search').keyup(function(){
|
||||
const typeLab = $(this).val();
|
||||
$(this).next().children('li').each(function(){
|
||||
const labListText = $(this).text();
|
||||
if(labListText.indexOf(typeLab) != -1){
|
||||
$(this).show();
|
||||
} else {
|
||||
$(this).hide();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$(document).on("click", ".yi-list-select li", function() {
|
||||
const labText = $(this).text();
|
||||
const labId = $(this).attr('data-lab-id');
|
||||
//const salespersonId = $(this).attr('data-salesperson-id');
|
||||
const lab = $(this).attr('data-lab');
|
||||
//const salesperson = $(this).attr('data-salesperson');
|
||||
$(this).parents('div.yi-list-select-box').prev().val(labText);
|
||||
$(this).parents('div.yi-list-select-box').siblings('.hidden-lab-id').val(lab);
|
||||
//$(this).parent().siblings('.hidden-salesperson-id').val(salespersonId);
|
||||
$(this).parents('.details-section').siblings().children('.lab-id.input').val(labId);
|
||||
//$(this).parents('.details-section').siblings('.item-salesperson').children('.salesperson').html(salesperson);
|
||||
});
|
||||
|
||||
// 详细信息同上
|
||||
$('.details_same_btn').click(function(){
|
||||
const labInput = $(this).parents('.cart.item').prev().children().find('.yi_list').val();
|
||||
const labIdHiddenInput = $(this).parents('.cart.item').prev().children().find('.hidden-lab-id').val();
|
||||
const labIdInput = $(this).parents('.cart.item').prev().children().find('.lab-id').val();
|
||||
const cdInput = $(this).parents('.cart.item').prev().children().find('.cd-id').val();
|
||||
const qInput = $(this).parents('.cart.item').prev().children().find('.q-id').val();
|
||||
const personText = $(this).parents('.cart.item').prev().children().find('.salesperson').text();
|
||||
const useTypeRadio = $(this).parents('.cart.item').prev().children().find('.np:checked').val();
|
||||
const discountInput = $(this).parents('.cart.item').prev().children().find('.discount').val();
|
||||
const beizhuText = $(this).parents('.cart.item').prev().children().find('.beizhu').val();
|
||||
|
||||
$(this).parent().children().find('.yi_list').val(labInput);
|
||||
$(this).parent().children().find('.hidden-lab-id').val(labIdHiddenInput);
|
||||
$(this).parent().children().find('.salesperson').text(personText);
|
||||
$(this).parent().children().find('.lab-id').val(labIdInput);
|
||||
$(this).parent().children().find('.cd-id').val(cdInput);
|
||||
$(this).parent().children().find('.q-id').val(qInput);
|
||||
$(this).parent().children().find('.discount').val(discountInput);
|
||||
$(this).parent().children().find('input.np[value='+useTypeRadio+']').prop('checked', true);
|
||||
$(this).parent().children().find('.beizhu').val(beizhuText);
|
||||
});
|
||||
|
||||
// 修改数量更新购物车
|
||||
$('.cart.table-wrapper .col.qty .input-text').change(function(){
|
||||
$('.form.form-cart button.update').trigger('click');
|
||||
});
|
||||
// 修改折扣更新购物车
|
||||
$('.cart.table-wrapper .discount_off input').change(function(){
|
||||
if($(this).val()>0){
|
||||
$('.form.form-cart button.update').trigger('click');
|
||||
}
|
||||
});
|
||||
|
||||
//订单备注
|
||||
$(document).on("change", "#customer_note", function() {
|
||||
var textareaContent = $(this).val();
|
||||
$('#cart-customer-note').val(textareaContent);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
?>
|
||||
<?php
|
||||
/**
|
||||
* Shopping cart additional info
|
||||
* @var $block \Magento\Framework\View\Element\Template
|
||||
*/
|
||||
?>
|
||||
<?php
|
||||
$name = $block->getNameInLayout();
|
||||
foreach ($block->getChildNames($name) as $childName) {
|
||||
// phpcs:ignore Magento2.Security.LanguageConstruct.DirectOutput
|
||||
echo $block->getChildBlock($childName)->setItem($block->getItem())->toHtml();
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,72 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
// phpcs:disable Generic.Files.LineLength.TooLong
|
||||
|
||||
/**
|
||||
* @var \Magento\Framework\View\Element\AbstractBlock $block
|
||||
*/
|
||||
|
||||
// We should use strlen function because coupon code could be "0", converted to bool will lead to false
|
||||
$hasCouponCode = $block->getCouponCode() !== null && strlen($block->getCouponCode()) > 0;
|
||||
?>
|
||||
<div class="block discount"
|
||||
id="block-discount"
|
||||
data-mage-init='{"collapsible":{"active": <?= $hasCouponCode ? 'true' : 'false' ?>, "openedState": "active", "saveState": false}}'>
|
||||
<div class="title" data-role="title">
|
||||
<strong id="block-discount-heading" role="heading" aria-level="2"><?= $block->escapeHtml(__('Apply Discount Code')) ?></strong>
|
||||
</div>
|
||||
<div class="content" data-role="content" aria-labelledby="block-discount-heading">
|
||||
<form id="discount-coupon-form"
|
||||
action="<?= $block->escapeUrl($block->getUrl('checkout/cart/couponPost')) ?>"
|
||||
method="post"
|
||||
data-mage-init='{"discountCode":{"couponCodeSelector": "#coupon_code",
|
||||
"removeCouponSelector": "#remove-coupon",
|
||||
"applyButton": "button.action.apply",
|
||||
"cancelButton": "button.action.cancel"}}'>
|
||||
<div class="fieldset coupon<?= $hasCouponCode ? ' applied' : '' ?>">
|
||||
<input type="hidden" name="remove" id="remove-coupon" value="0" />
|
||||
<div class="field">
|
||||
<label for="coupon_code" class="label">
|
||||
<span><?= $block->escapeHtml(__('Enter discount code')) ?></span>
|
||||
</label>
|
||||
<div class="control">
|
||||
<input type="text"
|
||||
class="input-text"
|
||||
id="coupon_code"
|
||||
name="coupon_code"
|
||||
value="<?= $block->escapeHtmlAttr($block->getCouponCode()) ?>"
|
||||
placeholder="<?= $block->escapeHtmlAttr(__('Enter discount code')) ?>"
|
||||
<?php if ($hasCouponCode): ?>
|
||||
disabled="disabled"
|
||||
<?php endif; ?>
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="actions-toolbar">
|
||||
<?php if (!$hasCouponCode): ?>
|
||||
<div class="primary">
|
||||
<button class="action apply primary" type="button"
|
||||
value="<?= $block->escapeHtmlAttr(__('Apply Discount')) ?>">
|
||||
<span><?= $block->escapeHtml(__('Apply Discount')) ?></span>
|
||||
</button>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<div class="primary">
|
||||
<button type="button" class="action cancel primary"
|
||||
value="<?= $block->escapeHtmlAttr(__('Cancel Coupon')) ?>">
|
||||
<span><?= $block->escapeHtml(__('Cancel Coupon')) ?></span>
|
||||
</button>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php if (!$hasCouponCode): ?>
|
||||
<?= /* @noEscape */ $block->getChildHtml('captcha') ?>
|
||||
<?php endif; ?>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,146 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
// phpcs:disable Magento2.Templates.ThisInTemplate
|
||||
|
||||
/** @var $block \Stemcell\Checkout\Block\Cart\Grid */
|
||||
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
|
||||
$customerSession = $objectManager->create('Magento\Customer\Model\Session');
|
||||
if (!$customerSession->isLoggedIn()) {
|
||||
$url = $this->getUrl('customer/account/login');
|
||||
header("Location: $url");
|
||||
}
|
||||
|
||||
$quote = $block->getQuote();
|
||||
/* @var $formKey \Magento\Framework\Data\Form\FormKey */
|
||||
$formKey = $objectManager->get('Magento\Framework\Data\Form\FormKey');
|
||||
?>
|
||||
<?php $mergedCells = ($this->helper(Magento\Tax\Helper\Data::class)->displayCartBothPrices() ? 2 : 1); ?>
|
||||
<?= $block->getChildHtml('form_before') ?>
|
||||
<form action="<?= $block->escapeUrl($block->getUrl('stemcell_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' : '' ?>">
|
||||
|
||||
<!-- 销售人员选择 -->
|
||||
<div class="xiaos_list_box">
|
||||
<div class="salesperson-list">
|
||||
<b>*销售:</b>
|
||||
<select class="xiaos_list" name="cart[salesperson_id]">
|
||||
<option value="">请选择销售</option>
|
||||
<?php foreach ($block->getSalesperson() as $salesperson): ?>
|
||||
<?php /* @var $salesperson \Stemcell\Customer\Model\Salesperson */ ?>
|
||||
<option <?php if ($salesperson->getId()==$block->getQuoteData('salesperson_id')) echo 'selected' ?> value="<?= $salesperson->getId() ?>" >
|
||||
<?php echo $salesperson->getName() ?>
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<div class="sale-error-tip" style="display:none;">请选择销售</div>
|
||||
</div>
|
||||
<div class="empty_cart">
|
||||
<a href="<?= $block->getUrl('checkout/cart/updatePost').'?'. http_build_query(['update_cart_action'=>'empty_cart', 'form_key'=>$formKey->getFormKey()]) ?>">
|
||||
清空购物车
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 销售人员选择 -->
|
||||
|
||||
<textarea style="display:none;" id="cart-customer-note" name="cart[customer_note]"><?= $quote->getCustomerNote() ?></textarea>
|
||||
<table id="shopping-cart-table"
|
||||
class="cart items data table"
|
||||
data-mage-init='{"shoppingCart":{"emptyCartButton": ".action.clear",
|
||||
"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(__('经销商价格')) ?></span></th>
|
||||
<th class="col qty" scope="col"><span><?= $block->escapeHtml(__('Qty')) ?></span></th>
|
||||
<th class="col subtotal" scope="col"><span><?= $block->escapeHtml(__('总价')) ?></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" style="display: none">
|
||||
<?php if ($block->getContinueShoppingUrl()): ?>
|
||||
<a class="action continue"
|
||||
href="<?= $block->escapeUrl($block->getContinueShoppingUrl()) ?>"
|
||||
title="<?= $block->escapeHtml(__('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->escapeHtml(__('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->escapeHtml(__('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>
|
||||
<input type="hidden" name="goCheckout" value="0" id="go_checkout_url"/>
|
||||
</form>
|
||||
<?= $block->getChildHtml('checkout.cart.order.actions') ?>
|
||||
<?= $block->getChildHtml('shopping.cart.table.after') ?>
|
||||
|
||||
<script>
|
||||
require([
|
||||
'jquery'
|
||||
], function($){
|
||||
// 购物车已经选中过默认选中销售
|
||||
if($('.xiaos_list').val()){
|
||||
var salespersonId = $('.xiaos_list').val();
|
||||
$.ajax({
|
||||
url: BASE_URL+'stemcell_checkout/cart/getLabsFromSalesperson',
|
||||
data: {salesperson_id: salespersonId},
|
||||
type: 'get',
|
||||
dataType: 'json',
|
||||
cache: false,
|
||||
|
||||
/** @inheritdoc */
|
||||
success: function (res) {
|
||||
var labAccountHtml = '';
|
||||
if(res.labs && res.labs.length > 0){
|
||||
res.labs.forEach(item => {
|
||||
labAccountHtml += '<li data-lab="'+item.lab_id+'" data-lab-id="'+item.lab_code+'">'+item.booking_account+'</li>';
|
||||
});
|
||||
}
|
||||
$('.yi-list-select').html(labAccountHtml);
|
||||
},
|
||||
|
||||
/** @inheritdoc */
|
||||
error: function (res) {
|
||||
console.log('error res', res);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
+51
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
/** @var $block \Magento\Catalog\Block\Product\View */
|
||||
?>
|
||||
<?php $_product = $block->getProduct(); ?>
|
||||
<?php $buttonTitle = __('Update Cart'); ?>
|
||||
<?php if ($_product->isSaleable()) :?>
|
||||
<div class="box-tocart update">
|
||||
<fieldset class="fieldset">
|
||||
<?php if ($block->shouldRenderQuantity()) :?>
|
||||
<div class="field qty">
|
||||
<label class="label" for="qty"><span><?= $block->escapeHtml(__('Qty')) ?></span></label>
|
||||
<div class="control">
|
||||
<input type="number"
|
||||
name="qty"
|
||||
id="qty"
|
||||
min="0"
|
||||
value=""
|
||||
title="<?= $block->escapeHtmlAttr(__('Qty')) ?>"
|
||||
class="input-text qty"
|
||||
data-validate="<?= $block->escapeHtml(json_encode($block->getQuantityValidators())) ?>"/>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div class="actions">
|
||||
<button type="submit"
|
||||
title="<?= $block->escapeHtmlAttr($buttonTitle) ?>"
|
||||
class="action primary tocart"
|
||||
id="product-updatecart-button">
|
||||
<span><?= $block->escapeHtml($buttonTitle) ?></span>
|
||||
</button>
|
||||
<?= $block->getChildHtml('', true) ?>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
<script type="text/x-magento-init">
|
||||
{
|
||||
"#product_addtocart_form": {
|
||||
"validation": {},
|
||||
"addToCart": {
|
||||
"cartButtonId": "#product-updatecart-button",
|
||||
"cartForm": "#product_addtocart_form"
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<?php endif; ?>
|
||||
+208
@@ -0,0 +1,208 @@
|
||||
<?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 \Stemcell\Checkout\Block\Cart\Item\Renderer | \Magento\Bundle\Block\Checkout\Cart\Item\Renderer */
|
||||
|
||||
$_item = $block->getItem();
|
||||
$product = $_item->getProduct();
|
||||
|
||||
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
|
||||
$_product = $objectManager->create('Magento\Catalog\Model\Product')->load($product->getId());
|
||||
|
||||
$isVisibleProduct = $product->isVisibleInSiteVisibility();
|
||||
/** @var \Magento\Msrp\Helper\Data $helper */
|
||||
$helper = $this->helper(Magento\Msrp\Helper\Data::class);
|
||||
$canApplyMsrp = $helper->isShowBeforeOrderConfirm($product) && $helper->isMinimalPriceLessMsrp($product);
|
||||
$labs = $block->getLabs();
|
||||
?>
|
||||
<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; ?>
|
||||
</strong>
|
||||
<dl class="item-options">
|
||||
<dt>产品号</dt>
|
||||
<dd><?= $product->getSku()?></dd>
|
||||
</dl>
|
||||
<?php if ($_options = $block->getOptionList()): ?>
|
||||
<?php if ($product->getTypeId()!='bundle'): ?>
|
||||
<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']) ?>
|
||||
<?php endif; ?>
|
||||
</dd>
|
||||
<?php endforeach; ?>
|
||||
</dl>
|
||||
<?php else: ?>
|
||||
<div class="bundle-options">
|
||||
<div class="bundle-options-label"><b>包含:</b></div>
|
||||
<?php foreach ($_options as $_option): ?>
|
||||
<?php $_formatedOptionValue = $block->getFormatedOptionValue($_option) ?>
|
||||
<?= $_formatedOptionValue['value'] ?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?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(__('经销商价格')) ?>">
|
||||
<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(__('经销商价格')) ?>">
|
||||
<?= $block->getUnitPriceHtml($_item) ?>
|
||||
</td>
|
||||
<?php endif; ?>
|
||||
<td class="col qty" data-th="<?= $block->escapeHtml(__('Qty')) ?>">
|
||||
<div class="field qty">
|
||||
<div class="control qty">
|
||||
<label for="cart-<?= $block->escapeHtmlAttr($_item->getId()) ?>-qty">
|
||||
<span class="label"><?= $block->escapeHtml(__('Qty')) ?></span>
|
||||
<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"/>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
<td class="col subtotal" data-th="<?= $block->escapeHtml(__('总价')) ?>">
|
||||
<?php if ($canApplyMsrp): ?>
|
||||
<span class="cart msrp subtotal">--</span>
|
||||
<?php else: ?>
|
||||
<?= $block->getRowTotalHtml($_item) ?>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="item-details-info">
|
||||
<td colspan="4">
|
||||
<p><b>详细信息</b></p>
|
||||
<div class="title">
|
||||
<div class="details-section item-account">
|
||||
<p>账户*</p>
|
||||
<input class="yi_list in-se-0" readonly value="<?= $block->getLab()->getBookingAccount() ?>" placeholder="请选择订货账户" />
|
||||
<div class="yi-list-select-box" style="display: none;">
|
||||
<input class="yi-list-select-search" value="" placeholder="请输入关键词查找账户" />
|
||||
<ul class="yi-list-select cl-0"></ul>
|
||||
</div>
|
||||
<input type="hidden" class="hidden-lab-id" name="cart[<?= $_item->getId() ?>][extension_attributes][lab_id]" value="<?= $_item->getData('lab_id') ?>" />
|
||||
<input type="hidden" class="hidden-salesperson-id" name="cart[<?= $_item->getId() ?>][extension_attributes][salesperson_id]" value="<?= $_item->getData('salesperson_id') ?>" />
|
||||
<input type="hidden" class="hidden-lab-code" name="cart[<?= $_item->getId() ?>][extension_attributes][lab_code]" value="<?= $_item->getData('lab_code') ?>" />
|
||||
</div>
|
||||
<div class="details-section item-salesperson">
|
||||
<p>销售</p>
|
||||
<p class="salesperson" style="border: 1px solid #d1d1d1; padding: 5px; height: 20px; color: rgb(0, 0, 0)"><?= $block->getLab()->getData('salesperson') ?></p>
|
||||
</div>
|
||||
<div class="details-section item-sap-id">
|
||||
<p>SAP ID</p>
|
||||
<input name="cart[<?= $_item->getId() ?>][extension_attributes][pi_sap_id]" placeholder="SAP ID" class="lab-id input" value="<?= $_item->getData('pi_sap_id') ?>">
|
||||
</div>
|
||||
<div class="details-section">
|
||||
<p>CD码</p>
|
||||
<input name="cart[<?= $_item->getId() ?>][extension_attributes][cd]" placeholder="CD-12345" class="cd-id input" value="<?= $_item->getData('cd') ?>" >
|
||||
</div>
|
||||
<div class="details-section">
|
||||
<p>Quote码</p>
|
||||
<input name="cart[<?= $_item->getId() ?>][extension_attributes][quote]" placeholder="Q-12345" class="q-id input" value="<?= $_item->getData('quote') ?>" >
|
||||
</div>
|
||||
<div class="details-section discount_off">
|
||||
<p>折扣</p>
|
||||
<input pattern="^\d*(\.\d{0,2})?$" inputmode="decimal" name="cart[<?= $_item->getId() ?>][customer_discount_percent]" placeholder="1-100" class="discount" value="<?= number_format($_item->getCustomerDiscountPercent(), 2) ?>" > %
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field-error-tip" style="display:none;">带*为必填字段,请填写完整后下单</div>
|
||||
<div class="titlel">
|
||||
<p class="useType">
|
||||
<span>终端类型: </span>
|
||||
<label><input type="radio" <?php if ($_item->getData('user_type')==0) echo 'checked' ?> name="cart[<?= $_item->getId() ?>][extension_attributes][user_type]" value="0" class="np">终端</label>
|
||||
<label><input type="radio" <?php if ($_item->getData('user_type')==1) echo 'checked' ?> name="cart[<?= $_item->getId() ?>][extension_attributes][user_type]" value="1" class="np">二级经销商</label>
|
||||
</p>
|
||||
</div>
|
||||
<p><b>备注</b></p>
|
||||
<div class="remark">
|
||||
<textarea name="cart[<?= $_item->getId() ?>][extension_attributes][note]" class="beizhu" placeholder="请填写备注信息"><?= $_item->getData('note') ?></textarea>
|
||||
</div>
|
||||
<button type="button" class="details_same_btn">详细信息同上</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="item-actions">
|
||||
<td colspan="4">
|
||||
<div class="actions-toolbar">
|
||||
<?= /* @noEscape */ $block->getActions($_item) ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
// phpcs:disable Magento2.Templates.ThisInTemplate
|
||||
|
||||
/** @var $block \Magento\Checkout\Block\Item\Price\Renderer */
|
||||
?>
|
||||
<?php $_item = $block->getItem() ?>
|
||||
<div class="price-container">
|
||||
<span class="price-label"><?= $block->escapeHtml(__('Price')) ?></span>
|
||||
<span class="price-wrapper">
|
||||
<?= $block->escapeHtml(
|
||||
$this->helper(Magento\Checkout\Helper\Data::class)->formatPrice($_item->getCalculationPrice()),
|
||||
['span']
|
||||
) ?>
|
||||
</span>
|
||||
</div>
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
/** @var $block \Magento\Checkout\Block\Cart\Item\Renderer\Actions\Edit */
|
||||
?>
|
||||
<?php if ($block->isProductVisibleInSiteVisibility()) :?>
|
||||
<a class="action action-edit"
|
||||
href="<?= $block->escapeUrl($block->getConfigureUrl()) ?>"
|
||||
title="<?= $block->escapeHtmlAttr(__('Edit item parameters')) ?>">
|
||||
<span><?= $block->escapeHtml(__('Edit')) ?></span>
|
||||
</a>
|
||||
<?php endif ?>
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
/** @var $block \Magento\Checkout\Block\Cart\Item\Renderer\Actions\Remove */
|
||||
?>
|
||||
<a href="#"
|
||||
title="<?= $block->escapeHtml(__('Remove item')) ?>"
|
||||
class="action action-delete"
|
||||
data-post='<?= /* @noEscape */ $block->getDeletePostJson() ?>'>
|
||||
<span>
|
||||
<?= $block->escapeHtml(__('Remove item')) ?>
|
||||
</span>
|
||||
</a>
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
?>
|
||||
<?php
|
||||
/** @var $block \Magento\Checkout\Block\Cart */
|
||||
?>
|
||||
<?php if (!$block->hasError()) :?>
|
||||
<?php $methods = $block->getMethods('methods') ?: $block->getMethods('top_methods') ?>
|
||||
<ul class="checkout methods items checkout-methods-items">
|
||||
<?php foreach ($methods as $method) :?>
|
||||
<?php $methodHtml = $block->getMethodHtml($method); ?>
|
||||
<?php if (trim($methodHtml) !== '') :?>
|
||||
<li class="item"><?= /* @noEscape */ $methodHtml ?></li>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
@@ -0,0 +1,81 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
/** @var $block \Magento\Checkout\Block\Cart\Sidebar */
|
||||
/** @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */
|
||||
|
||||
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
|
||||
$customerSession = $objectManager->get('Magento\Customer\Model\Session');
|
||||
?>
|
||||
|
||||
<?php if($customerSession->isLoggedIn()):?>
|
||||
<div data-block="minicart" class="minicart-wrapper">
|
||||
<a class="action showcart" href="<?= $block->escapeUrl($block->getShoppingCartUrl()) ?>"
|
||||
data-bind="scope: 'minicart_content'">
|
||||
<span class="text"><?= $block->escapeHtml(__('My Cart')) ?></span>
|
||||
<span class="counter qty empty"
|
||||
data-bind="css: { empty: !!getCartParam('summary_count') == false && !isLoading() },
|
||||
blockLoader: isLoading">
|
||||
<span class="counter-number">
|
||||
<!-- ko if: getCartParam('summary_count') -->
|
||||
<!-- ko text: getCartParam('summary_count').toLocaleString(window.LOCALE) --><!-- /ko -->
|
||||
<!-- /ko -->
|
||||
<!-- ko ifnot: getCartParam('summary_count') -->
|
||||
<!-- ko text: 0 --><!-- /ko -->
|
||||
<!-- /ko -->
|
||||
</span>
|
||||
<span class="counter-label">
|
||||
<!-- ko if: getCartParam('summary_count') -->
|
||||
<!-- ko text: getCartParam('summary_count').toLocaleString(window.LOCALE) --><!-- /ko -->
|
||||
<!-- ko i18n: 'items' --><!-- /ko -->
|
||||
<!-- /ko -->
|
||||
</span>
|
||||
</span>
|
||||
</a>
|
||||
<?php if ($block->getIsNeedToDisplaySideBar()):?>
|
||||
<div class="block block-minicart"
|
||||
data-role="dropdownDialog"
|
||||
data-mage-init='{"dropdownDialog":{
|
||||
"appendTo":"[data-block=minicart]",
|
||||
"triggerTarget":".showcart",
|
||||
"timeout": "2000",
|
||||
"closeOnMouseLeave": false,
|
||||
"closeOnEscape": true,
|
||||
"triggerClass":"active",
|
||||
"parentClass":"active",
|
||||
"buttons":[]}}'>
|
||||
<div id="minicart-content-wrapper" data-bind="scope: 'minicart_content'">
|
||||
<!-- 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() ?>
|
||||
},
|
||||
"*": {
|
||||
"Magento_Ui/js/block-loader": "<?= $block->escapeJs(
|
||||
$block->escapeUrl($block->getViewFileUrl('images/loader-1.gif'))
|
||||
) ?>"
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
/** @var $block \Magento\Checkout\Block\Cart */
|
||||
?>
|
||||
<div class="cart-empty">
|
||||
<?= $block->getChildHtml('checkout_cart_empty_widget') ?>
|
||||
<p><?= $block->escapeHtml(__('You have no items in your shopping cart.')) ?></p>
|
||||
<p><?= $block->escapeHtml(
|
||||
__(
|
||||
'Click <a href="%1">here</a> to continue shopping.',
|
||||
$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,56 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
?>
|
||||
<?php /** @var $block \Magento\Checkout\Block\Cart\Shipping */ ?>
|
||||
<?php /** @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */ ?>
|
||||
<div id="block-shipping"
|
||||
class="block shipping"
|
||||
data-mage-init='{"collapsible":{"openedState": "active", "saveState": true}}'
|
||||
>
|
||||
<div class="title" data-role="title">
|
||||
<strong id="block-shipping-heading" role="heading" aria-level="2">
|
||||
<?= $block->getQuote()->isVirtual()
|
||||
? $block->escapeHtml(__('Estimate Tax'))
|
||||
: $block->escapeHtml(__('Estimate Shipping and Tax'))
|
||||
?>
|
||||
</strong>
|
||||
</div>
|
||||
<div id="block-summary"
|
||||
data-bind="scope:'block-summary'"
|
||||
class="content"
|
||||
data-role="content"
|
||||
aria-labelledby="block-shipping-heading"
|
||||
>
|
||||
<!-- ko template: getTemplate() --><!-- /ko -->
|
||||
<script type="text/x-magento-init">
|
||||
{
|
||||
"#block-summary": {
|
||||
"Magento_Ui/js/core/app": <?= /* @noEscape */ $block->getJsLayout() ?>
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<?php $serializedCheckoutConfig = /* @noEscape */ $block->getSerializedCheckoutConfig();
|
||||
|
||||
$scriptString = <<<script
|
||||
|
||||
window.checkoutConfig = {$serializedCheckoutConfig};
|
||||
window.customerData = window.checkoutConfig.customerData;
|
||||
window.isCustomerLoggedIn = window.checkoutConfig.isCustomerLoggedIn;
|
||||
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>
|
||||
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
?>
|
||||
<?php
|
||||
/**
|
||||
* Shopping cart totals template
|
||||
* @var $block \Magento\Checkout\Block\Cart\Totals
|
||||
*/
|
||||
$quote = $block->getQuote();
|
||||
?>
|
||||
<div id="cart-totals" class="cart-totals" data-bind="scope:'block-totals'">
|
||||
<!-- ko template: getTemplate() --><!-- /ko -->
|
||||
<script type="text/x-magento-init">
|
||||
{
|
||||
"#cart-totals": {
|
||||
"Magento_Ui/js/core/app": <?= /* @noEscape */ $block->getJsLayout() ?>
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<textarea placeholder="订单备注" id="customer_note"><?= $quote->getCustomerNote() ?></textarea>
|
||||
</div>
|
||||
@@ -0,0 +1,47 @@
|
||||
<?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 payment-step-show">
|
||||
<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>
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
/** @var $block \Magento\Checkout\Block\Onepage\Failure */
|
||||
?>
|
||||
<?php if ($block->getRealOrderId()) :?>
|
||||
<p><?= $block->escapeHtml(__('Order #') . $block->getRealOrderId()) ?></p>
|
||||
<?php endif ?>
|
||||
<?php if ($error = $block->getErrorMessage()) :?>
|
||||
<p><?= $block->escapeHtml($error) ?></p>
|
||||
<?php endif ?>
|
||||
<p><?= $block->escapeHtml(
|
||||
__('Click <a href="%1">here</a> to continue shopping.', $block->escapeUrl($block->getContinueShoppingUrl())),
|
||||
['a']
|
||||
) ?>
|
||||
</p>
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
use Magento\Checkout\Block\Onepage\Link;
|
||||
use Magento\Framework\Escaper;
|
||||
|
||||
/**
|
||||
* @var Link $block
|
||||
* @var Escaper $escaper
|
||||
*/
|
||||
?>
|
||||
<?php if ($block->isPossibleOnepageCheckout()): ?>
|
||||
<button type="button"
|
||||
data-role="proceed-to-checkout"
|
||||
title="<?= $escaper->escapeHtmlAttr(__('Proceed to Checkout')) ?>"
|
||||
data-mage-init='{
|
||||
"Magento_Checkout/js/proceed-to-checkout":{
|
||||
"checkoutUrl":"<?= $escaper->escapeJs($block->getCheckoutUrl()) ?>"
|
||||
}
|
||||
}'
|
||||
class="action primary checkout<?= ($block->isDisabled()) ? ' disabled' : '' ?>"
|
||||
<?php if ($block->isDisabled()): ?>
|
||||
disabled="disabled"
|
||||
<?php endif; ?>>
|
||||
<span><?= $escaper->escapeHtml(__('Proceed to Checkout')) ?></span>
|
||||
</button>
|
||||
<?php endif?>
|
||||
+74
@@ -0,0 +1,74 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
// phpcs:disable Magento2.Templates.ThisInTemplate
|
||||
|
||||
/** @var $block Magento\Checkout\Block\Cart\Item\Renderer */
|
||||
|
||||
$_item = $block->getItem();
|
||||
$taxDataHelper = $this->helper(Magento\Tax\Helper\Data::class);
|
||||
?>
|
||||
<tbody class="cart item">
|
||||
<tr>
|
||||
<td class="col item" data-th="<?= $block->escapeHtml(__('Product Name')) ?>">
|
||||
<span class="product-item-photo">
|
||||
<?= $block->getImage($block->getProductForThumbnail(), 'cart_page_product_thumbnail')->toHtml() ?>
|
||||
</span>
|
||||
<div class="product-item-details">
|
||||
<strong class="product name product-item-name">
|
||||
<?= $block->escapeHtml($block->getProductName()) ?>
|
||||
</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'])) :?>
|
||||
<?= /* @noEscape */ $_formatedOptionValue['full_view'] ?>
|
||||
<?php else :?>
|
||||
<?= /* @noEscape */ $_formatedOptionValue['value'] ?>
|
||||
<?php endif; ?>
|
||||
</dd>
|
||||
<?php endforeach; ?>
|
||||
</dl>
|
||||
<?php endif;?>
|
||||
<?php if ($addtInfoBlock = $block->getProductAdditionalInformationBlock()) :?>
|
||||
<?= $addtInfoBlock->setItem($_item)->toHtml() ?>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
</td>
|
||||
<td class="col price" data-th="<?= $block->escapeHtml(__('Price')) ?>">
|
||||
<?php if ($taxDataHelper->displayCartPriceInclTax() || $taxDataHelper->displayCartBothPrices()) :?>
|
||||
<span class="price-including-tax" data-label="<?= $block->escapeHtml(__('Incl. Tax')) ?>">
|
||||
<?= $block->getUnitPriceInclTaxHtml($_item) ?>
|
||||
</span>
|
||||
<?php endif; ?>
|
||||
<?php if ($taxDataHelper->displayCartPriceExclTax() || $taxDataHelper->displayCartBothPrices()) :?>
|
||||
<span class="price-excluding-tax" data-label="<?= $block->escapeHtml(__('Excl. Tax')) ?>">
|
||||
<?= $block->getUnitPriceExclTaxHtml($_item) ?>
|
||||
</span>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td class="col qty"
|
||||
data-th="<?= $block->escapeHtml(__('Qty')) ?>"
|
||||
>
|
||||
<span class="qty"><?= $block->escapeHtml($_item->getQty()) ?></span>
|
||||
</td>
|
||||
<td class="col subtotal" data-th="<?= $block->escapeHtml(__('Subtotal')) ?>">
|
||||
<?php if ($taxDataHelper->displayCartPriceInclTax() || $taxDataHelper->displayCartBothPrices()) :?>
|
||||
<span class="price-including-tax" data-label="<?= $block->escapeHtml(__('Incl. Tax')) ?>">
|
||||
<?= $block->getRowTotalInclTaxHtml($_item) ?>
|
||||
</span>
|
||||
<?php endif; ?>
|
||||
<?php if ($taxDataHelper->displayCartPriceExclTax() || $taxDataHelper->displayCartBothPrices()) :?>
|
||||
<span class="price-excluding-tax" data-label="<?= $block->escapeHtml(__('Excl. Tax')) ?>">
|
||||
<?= $block->getRowTotalExclTaxHtml($_item) ?>
|
||||
</span>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
// phpcs:disable Magento2.Templates.ThisInTemplate
|
||||
|
||||
/** @var $block \Magento\Checkout\Block\Item\Price\Renderer */
|
||||
|
||||
$_item = $block->getItem();
|
||||
?>
|
||||
<span class="cart-price">
|
||||
<?= $block->escapeHtml(
|
||||
$this->helper(Magento\Checkout\Helper\Data::class)->formatPrice($_item->getRowTotal()),
|
||||
['span']
|
||||
) ?>
|
||||
</span>
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
// phpcs:disable Magento2.Templates.ThisInTemplate
|
||||
|
||||
/** @var $block \Magento\Checkout\Block\Item\Price\Renderer */
|
||||
|
||||
$_item = $block->getItem();
|
||||
?>
|
||||
<?php $_incl = $this->helper(Magento\Checkout\Helper\Data::class)->getSubtotalInclTax($_item); ?>
|
||||
<span class="cart-price">
|
||||
<?= $block->escapeHtml(
|
||||
$this->helper(Magento\Checkout\Helper\Data::class)->formatPrice($_incl),
|
||||
['span']
|
||||
) ?>
|
||||
</span>
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
// phpcs:disable Magento2.Templates.ThisInTemplate.FoundThis
|
||||
|
||||
/** @var $block \Magento\Checkout\Block\Item\Price\Renderer */
|
||||
|
||||
$_item = $block->getItem();
|
||||
?>
|
||||
<span class="cart-price">
|
||||
<?= $block->escapeHtml(
|
||||
$this->helper(Magento\Checkout\Helper\Data::class)->formatPrice($_item->getCalculationPrice()),
|
||||
['span']
|
||||
) ?>
|
||||
</span>
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
// phpcs:disable Magento2.Templates.ThisInTemplate
|
||||
|
||||
/** @var $block \Magento\Checkout\Block\Item\Price\Renderer */
|
||||
|
||||
$_item = $block->getItem();
|
||||
?>
|
||||
<?php $_incl = $this->helper(Magento\Checkout\Helper\Data::class)->getPriceInclTax($_item); ?>
|
||||
<span class="cart-price">
|
||||
<?= $block->escapeHtml(
|
||||
$this->helper(Magento\Checkout\Helper\Data::class)->formatPrice($_incl),
|
||||
['span']
|
||||
) ?>
|
||||
</span>
|
||||
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
/** @var $block \Magento\Checkout\Block\Registration */
|
||||
?>
|
||||
<div id="registration" data-bind="scope:'registration'">
|
||||
<br />
|
||||
<!-- ko template: getTemplate() --><!-- /ko -->
|
||||
<script type="text/x-magento-init">
|
||||
{
|
||||
"#registration": {
|
||||
"Magento_Ui/js/core/app": {
|
||||
"components": {
|
||||
"registration": {
|
||||
"component": "Magento_Checkout/js/view/registration",
|
||||
"config": {
|
||||
"registrationUrl":
|
||||
"<?= $block->escapeJs($block->escapeUrl($block->getCreateAccountUrl())) ?>",
|
||||
"email": "<?= $block->escapeJs($block->getEmailAddress()) ?>"
|
||||
},
|
||||
"children": {
|
||||
"errors": {
|
||||
"component": "Magento_Ui/js/view/messages",
|
||||
"sortOrder": 0,
|
||||
"displayArea": "messages",
|
||||
"config": {
|
||||
"autoHideTimeOut": -1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</div>
|
||||
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
?>
|
||||
<?php /** @var $block \Magento\Checkout\Block\Shipping\Price */ ?>
|
||||
|
||||
<?php $shippingPrice = $block->getShippingPrice(); ?>
|
||||
<?= $block->escapeHtml($shippingPrice) ?>
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
?>
|
||||
<?php /** @var $block \Magento\Checkout\Block\Onepage\Success */ ?>
|
||||
<div class="checkout-success">
|
||||
<?php if ($block->getOrderId()) :?>
|
||||
<?php if ($block->getCanViewOrder()) :?>
|
||||
<p><?= $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><?= $block->escapeHtml(__('Your order # is: <span>%1</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>
|
||||
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
/** @var $block \Magento\Checkout\Block\Total\DefaultTotal */
|
||||
/** @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */
|
||||
?>
|
||||
|
||||
<?php
|
||||
/** @var \Magento\Checkout\Helper\Data $checkoutHelper */
|
||||
$checkoutHelper = $block->getData('checkoutHelper');
|
||||
?>
|
||||
<tr class="totals">
|
||||
<th colspan="<?= $block->escapeHtmlAttr($block->getColspan()) ?>"
|
||||
class="mark" scope="row">
|
||||
<?php if ($block->getRenderingArea() == $block->getTotal()->getArea()):?>
|
||||
<strong>
|
||||
<?php endif; ?>
|
||||
<?= $block->escapeHtml($block->getTotal()->getTitle()) ?>
|
||||
<?php if ($block->getRenderingArea() == $block->getTotal()->getArea()):?>
|
||||
</strong>
|
||||
<?php endif; ?>
|
||||
</th>
|
||||
<td class="amount"
|
||||
data-th="<?= $block->escapeHtmlAttr($block->getTotal()->getTitle()) ?>">
|
||||
<?php if ($block->getRenderingArea() == $block->getTotal()->getArea()):?>
|
||||
<strong>
|
||||
<?php endif; ?>
|
||||
<span>
|
||||
<?= $block->escapeHtml(
|
||||
$checkoutHelper->formatPrice($block->getTotal()->getValue()),
|
||||
['span']
|
||||
) ?>
|
||||
</span>
|
||||
<?php if ($block->getRenderingArea() == $block->getTotal()->getArea()):?>
|
||||
</strong>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php if ($block->getTotal()->getStyle()): ?>
|
||||
<?= /* @noEscape */ $secureRenderer->renderStyleAsTag($block->getTotal()->getStyle(), 'tr.totals th.mark') ?>
|
||||
<?= /* @noEscape */ $secureRenderer->renderStyleAsTag($block->getTotal()->getStyle(), 'tr.totals td.amount') ?>
|
||||
<?php endif; ?>
|
||||
Reference in New Issue
Block a user