Commit 0302eb96 by dhn

购物车属性展示修改

parent 4cb5a579
...@@ -53,16 +53,34 @@ $priceBlock = $objectManager->get(\Magento\Catalog\Block\Product\AbstractProduct ...@@ -53,16 +53,34 @@ $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 foreach ($_options as $_option) :?> <?php
<span class="item-options-line"> $countOpt = count($_options);
<?php $_formatedOptionValue = $block->getFormatedOptionValue($_option) ?> ?>
<strong style="font-weight: 600;margin-right: 10px;"><?= $block->escapeHtml($_option['label']) ?>:</strong> <?php foreach ($_options as $key=>$_option) :?>
<?php if (isset($_formatedOptionValue['full_view'])) :?> <strong style="font-weight: 600;margin-right: 10px;"><?= $block->escapeHtml($_option['label']) ?> :</strong>
<?= $block->escapeHtml($_formatedOptionValue['full_view']) ?> <span class="item-options-line">
<?php else :?> <?php
<?= $block->escapeHtml($_formatedOptionValue['value'], ['span', 'a']) ?> $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
<?php endif; ?> $resource = $objectManager->get('Magento\Framework\App\ResourceConnection');
</span><br /> $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><br />
<?php endforeach; ?> <?php endforeach; ?>
</div> </div>
<?php endif;?> <?php endif;?>
......
...@@ -827,7 +827,9 @@ p.shopbycate-title { ...@@ -827,7 +827,9 @@ p.shopbycate-title {
.checkout-index-index .method-content{ .checkout-index-index .method-content{
text-align: left; text-align: left;
} }
.checkout-cart-index span.item-options-line {
color: #555;
}
.no-enabled{ .no-enabled{
color:#cacaca!important; color:#cacaca!important;
} }
......
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