Commit 0302eb96 by dhn

购物车属性展示修改

parent 4cb5a579
......@@ -53,15 +53,33 @@ $priceBlock = $objectManager->get(\Magento\Catalog\Block\Product\AbstractProduct
<!----------------------------item option start--------------------------------->
<?php if ($_options = $block->getOptionList()) :?>
<div class="item-options-meta">
<?php foreach ($_options as $_option) :?>
<?php
$countOpt = count($_options);
?>
<?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 $_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; ?>
<?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><br />
<?php endforeach; ?>
</div>
......
......@@ -827,7 +827,9 @@ p.shopbycate-title {
.checkout-index-index .method-content{
text-align: left;
}
.checkout-cart-index span.item-options-line {
color: #555;
}
.no-enabled{
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