Commit 5caabf02 by liumengfei

优化购物车列表页面

parent f77863d7
...@@ -53,78 +53,68 @@ $priceBlock = $objectManager->get(\Magento\Catalog\Block\Product\AbstractProduct ...@@ -53,78 +53,68 @@ $priceBlock = $objectManager->get(\Magento\Catalog\Block\Product\AbstractProduct
<!----------------------------item option start---------------------------------> <!----------------------------item option start--------------------------------->
<?php if ($_options = $block->getOptionList()) :?> <?php if ($_options = $block->getOptionList()) :?>
<div class="item-options-meta"> <div class="item-options-meta">
<?php <?php foreach ($_options as $_option) :?>
$countOpt = count($_options); <span class="item-options-line">
?> <?php $_formatedOptionValue = $block->getFormatedOptionValue($_option) ?>
<?php foreach ($_options as $key=>$_option) :?> <strong style="font-weight: 600;margin-right: 10px;"><?= $block->escapeHtml($_option['label']) ?>:</strong>
<span class="item-options-line"> <?php if (isset($_formatedOptionValue['full_view'])) :?>
<?php <?= $block->escapeHtml($_formatedOptionValue['full_view']) ?>
$objectManager = \Magento\Framework\App\ObjectManager::getInstance(); <?php else :?>
$resource = $objectManager->get('Magento\Framework\App\ResourceConnection'); <?= $block->escapeHtml($_formatedOptionValue['value'], ['span', 'a']) ?>
$connection = $resource->getConnection(); <?php endif; ?>
?> </span><br />
<?php if ($_option['label'] != 'Size'){ ?>
<?php
$tableName = $resource->getTableName('eav_attribute_option_value');
$sql = "Select * FROM " . $tableName ." where store_id=0 AND option_id=".$_option['option_value'];
$result = $connection->fetchRow($sql);
?>
<?= $block->escapeHtml($result['value']) ?>
<?php }else{
$tableName = $resource->getTableName('eav_attribute_option_swatch');
$sql = "Select * FROM " . $tableName ." where store_id=0 AND option_id=".$_option['option_value'];
$result = $connection->fetchRow($sql);
echo $result['value'];
} ?>
</span>
<span><?php if ($countOpt - 1 != $key) :?>/<?php endif; ?></span>
<?php endforeach; ?> <?php endforeach; ?>
</div> </div>
<?php endif;?> <?php endif;?>
<!----------------------------item option end----------------------------------->
<!----------------------------item price start---------------------------------->
<div class="item-price">
<?= $priceBlock->getProductPrice($product);?>
</div>
<!----------------------------item price end------------------------------------>
<!----------------------------item handle start--------------------------------->
<div class="item-handle">
<div class="item-quantity">
<?php if ($block->escapeHtmlAttr($block->getQty()) > 1) :?>
<strong class="lower-qty qty-change">-</strong>
<?php else :?>
<strong class="lower-qty qty-change no-enabled">-</strong>
<?php endif; ?>
<div class="field qty new-qty">
<div class="control qty">
<label for="cart-<?= $block->escapeHtmlAttr($_item->getId()) ?>-qty">
<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"
size="4"
step="any"
title="<?= $block->escapeHtmlAttr(__('Qty')) ?>"
class="input-text qty"
data-validate="{required:true,'validate-greater-than-zero':true}"
data-role="cart-item-qty" readonly="readonly"/>
</label> <div style="max-width: 100%;width: 100%;height: 40px;">
<!----------------------------item handle start--------------------------------->
<div class="item-handle" style="width: 16%;float:left;position: inherit;font-size: 16px;">
<div class="item-quantity">
<?php if ($block->escapeHtmlAttr($block->getQty()) > 1) :?>
<strong class="lower-qty qty-change">-</strong>
<?php else :?>
<strong class="lower-qty qty-change no-enabled">-</strong>
<?php endif; ?>
<div class="field qty new-qty">
<div class="control qty">
<label for="cart-<?= $block->escapeHtmlAttr($_item->getId()) ?>-qty">
<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"
size="4"
step="any"
title="<?= $block->escapeHtmlAttr(__('Qty')) ?>"
class="input-text qty"
data-validate="{required:true,'validate-greater-than-zero':true}"
data-role="cart-item-qty" readonly="readonly"/>
</label>
</div>
</div> </div>
</div> <strong class="add-qty qty-change">+</strong>
<strong class="add-qty qty-change">+</strong> </div><br />
</div> <div class="item-actions">
<div class="item-actions"> <div class="actions-toolbar" style="text-decoration: underline;">
<div class="actions-toolbar">
<?= /* @noEscape */ $block->getActions($_item) ?> <?= /* @noEscape */ $block->getActions($_item) ?>
</div> </div>
</div>
</div> </div>
<!----------------------------item handle end----------------------------------->
<!----------------------------item option end----------------------------------->
<div style="float: right;padding-right: 15%;width: 40%;font-size: 20px;">
<?php if ($canApplyMsrp) :?>
<span class="cart msrp subtotal">--</span>
<?php else :?>
<?= $block->getRowTotalHtml($_item) ?>
<?php endif; ?>
</div>
</div> </div>
<!----------------------------item handle end----------------------------------->
</div> </div>
</div> </div>
......
...@@ -32,15 +32,15 @@ ...@@ -32,15 +32,15 @@
</strong> </strong>
<div class="product-item-pricing"> <div class="product-item-pricing" style="font-size: 20px;">
<div class="details-qty qty"> <div class="details-qty qty">
<span class="qty-wrapper" data-bind="html: qty"></span> *
<!-- ko if: canApplyMsrp --> <!-- ko if: canApplyMsrp -->
<div class="details-map"> <div class="details-map">
<span class="label" data-bind="i18n: 'Price'"></span> <span class="label" data-bind="i18n: 'Price'"></span>
<span class="value" data-bind="i18n: 'See price before order confirmation.'"></span> <span class="value" data-bind="i18n: 'See price before order confirmation.'"></span>
</div> </div>
<!-- /ko --> <!-- /ko -->
x <span class="qty-wrapper" data-bind="html: qty"></span>
</div> </div>
<!-- ko ifnot: canApplyMsrp --> <!-- ko ifnot: canApplyMsrp -->
......
...@@ -5,10 +5,13 @@ ...@@ -5,10 +5,13 @@
*/ */
--> -->
<div class="subtotal"> <div class="subtotal">
<span class="label"> <span class="label" style="
font-size: 18px;
color: gray;
">
<!-- ko i18n: 'Cart subtotal' --><!-- /ko --> <!-- ko i18n: 'Cart subtotal' --><!-- /ko -->
</span> </span>
:
<!-- ko foreach: elems --> <!-- ko foreach: elems -->
<!-- ko template: getTemplate() --><!-- /ko --> <!-- ko template: getTemplate() --><!-- /ko -->
<!-- /ko --> <!-- /ko -->
......
...@@ -61,19 +61,3 @@ $quickSearchUrl = $allowedSuggestion ? $escaper->escapeUrl($helper->getSuggestUr ...@@ -61,19 +61,3 @@ $quickSearchUrl = $allowedSuggestion ? $escaper->escapeUrl($helper->getSuggestUr
</form> </form>
</div> </div>
</div> </div>
<script>
require([
'jquery'
], function ($) {
$("#search").on("focus",function () {
$(this).css("width","500px").css("font-size","20px");
});
$('#search').on('blur',function (){
if (!$(this).val()){
$(this).attr("style","");
}
});
});
</script>
...@@ -903,6 +903,8 @@ p.shopbycate-title { ...@@ -903,6 +903,8 @@ p.shopbycate-title {
justify-content: space-between; justify-content: space-between;
width: 100%; width: 100%;
padding: 2px 0px; padding: 2px 0px;
font-size: 20px;
margin-bottom: 20px;
} }
.discount-area{ .discount-area{
color:#fa320f; color:#fa320f;
......
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