Commit 2d3946f7 by lmf

调整购物车界面

parent 2d6aedf2
<?xml version="1.0"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<update handle="checkout_cart_item_renderers"/>
<body>
<referenceContainer name="header.container" remove="true"/>
<referenceBlock name="global_notices" remove="true" />
<referenceContainer name="page.bottom.container" remove="true"/>
<referenceContainer name="footer-container" remove="true"/>
<referenceContainer name="content">
<block class="Magento\Theme\Block\Html\Header\Logo" name="logo" before="checkout.cart">
<arguments>
<argument name="logoPathResolver" xsi:type="object">Magento\Theme\ViewModel\Block\Html\Header\LogoPathResolver</argument>
<argument name="logo_size_resolver" xsi:type="object">Magento\Theme\ViewModel\Block\Html\Header\LogoSizeResolver</argument>
</arguments>
</block>
<block class="Magento\Framework\View\Element\Template" name="checkout.cart.footer" template="Magento_Checkout::footer.phtml" />
</referenceContainer>
</body>
</page>
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
?>
<style>
.logo {
margin-left: 40%;
margin-top: 10%;
}
a.logo>img{
margin-top: 5%;
width: 155px;
height: auto;
}
.cart-class{
margin-top: 3%;
margin-left: 9%;
margin-bottom: 2%;
}
.activation{
font-size: 20px;
font-width: 600;
margin-right: 20px;
margin-left: 20px;
}
.activation-no{
font-size: 14px;
margin-right: 20px;
margin-left: 20px;
color: #1b1b1b;
}
</style>
<div class="cart-class">
<span class="activation">Shopping Cart</span> >
<span class="activation-no">Information </span> >
<span class="activation-no">Shipping </span> >
<span class="activation-no">Payment </span>
</div>
<?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');
}
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
/**
* @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 = (bool) strlen($block->getCouponCode());
?>
<div class="block discount"
id="block-discount"
data-mage-init='{"collapsible":{"active": <?= $hasCouponCode ? 'true' : 'false' ?>, "openedState": "active", "saveState": false}}'
>
<div class="content" data-role="content" aria-labelledby="block-discount-heading" style="display: block;">
<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" style="width: 65%;">
<label for="coupon_code" class="label"><span><?= $block->escapeHtml(__('Enter discount code')) ?></span></label>
<div class="control" style="float: left;margin-top: 0px;margin-right: 2px;">
<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" style="clear: none;">
<?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>
<script>
require([
'jquery'
], function ($) {
setTimeout(function(){
$(".page.messages").hide();
},5000);
});
</script>
<style>
.cat-footer{
border-top: 1px solid #1b1b1b;
width: 100%;
margin-top: 5px;
}
.cat-footer-tk{
margin-top: 10px;
margin-left: 9%;
margin-bottom: 2%;
}
.cat-footer-tk > span {
margin-right: 10px;
margin-left: 10px;
font-size: 14px;
}
</style>
<div class="cat-footer">
<div class="cat-footer-tk">
<span>Refund Policy</span>
<span>Shipping policy</span>
<span>Privacy Policy</span>
<span>Terms of service</span>
</div>
</div>
\ No newline at end of file
...@@ -920,7 +920,7 @@ footer{ ...@@ -920,7 +920,7 @@ footer{
@media(min-width: 640px){ @media(min-width: 640px){
.switcher.currency{ .switcher.currency{
position: absolute; position: absolute;
top: 30px; top: 20px;
right: 145px; right: 145px;
z-index: 1; z-index: 1;
font-size: 13px; font-size: 13px;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment