Commit 5caabf02 by liumengfei

优化购物车列表页面

parent f77863d7
......@@ -53,45 +53,25 @@ $priceBlock = $objectManager->get(\Magento\Catalog\Block\Product\AbstractProduct
<!----------------------------item option start--------------------------------->
<?php if ($_options = $block->getOptionList()) :?>
<div class="item-options-meta">
<?php
$countOpt = count($_options);
?>
<?php foreach ($_options as $key=>$_option) :?>
<?php foreach ($_options as $_option) :?>
<span class="item-options-line">
<?php
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$resource = $objectManager->get('Magento\Framework\App\ResourceConnection');
$connection = $resource->getConnection();
?>
<?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 $_formatedOptionValue = $block->getFormatedOptionValue($_option) ?>
<strong style="font-weight: 600;margin-right: 10px;"><?= $block->escapeHtml($_option['label']) ?>:</strong>
<?php if (isset($_formatedOptionValue['full_view'])) :?>
<?= $block->escapeHtml($_formatedOptionValue['full_view']) ?>
<?php else :?>
<?= $block->escapeHtml($_formatedOptionValue['value'], ['span', 'a']) ?>
<?php endif; ?>
</span><br />
<?php endforeach; ?>
</div>
<?php endif;?>
<!----------------------------item option end----------------------------------->
<!----------------------------item price start---------------------------------->
<div class="item-price">
<?= $priceBlock->getProductPrice($product);?>
</div>
<!----------------------------item price end------------------------------------>
<div style="max-width: 100%;width: 100%;height: 40px;">
<!----------------------------item handle start--------------------------------->
<div class="item-handle">
<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>
......@@ -112,19 +92,29 @@ $priceBlock = $objectManager->get(\Magento\Catalog\Block\Product\AbstractProduct
class="input-text qty"
data-validate="{required:true,'validate-greater-than-zero':true}"
data-role="cart-item-qty" readonly="readonly"/>
</label>
</div>
</div>
<strong class="add-qty qty-change">+</strong>
</div>
</div><br />
<div class="item-actions">
<div class="actions-toolbar">
<div class="actions-toolbar" style="text-decoration: underline;">
<?= /* @noEscape */ $block->getActions($_item) ?>
</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>
</div>
......
......@@ -32,15 +32,15 @@
</strong>
<div class="product-item-pricing">
<div class="product-item-pricing" style="font-size: 20px;">
<div class="details-qty qty">
<span class="qty-wrapper" data-bind="html: qty"></span> *
<!-- ko if: canApplyMsrp -->
<div class="details-map">
<span class="label" data-bind="i18n: 'Price'"></span>
<span class="value" data-bind="i18n: 'See price before order confirmation.'"></span>
</div>
<!-- /ko -->
x <span class="qty-wrapper" data-bind="html: qty"></span>
</div>
<!-- ko ifnot: canApplyMsrp -->
......
......@@ -5,10 +5,13 @@
*/
-->
<div class="subtotal">
<span class="label">
<span class="label" style="
font-size: 18px;
color: gray;
">
<!-- ko i18n: 'Cart subtotal' --><!-- /ko -->
</span>
:
<!-- ko foreach: elems -->
<!-- ko template: getTemplate() --><!-- /ko -->
<!-- /ko -->
......
......@@ -61,19 +61,3 @@ $quickSearchUrl = $allowedSuggestion ? $escaper->escapeUrl($helper->getSuggestUr
</form>
</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 {
justify-content: space-between;
width: 100%;
padding: 2px 0px;
font-size: 20px;
margin-bottom: 20px;
}
.discount-area{
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