Commit d38a4f22 by dhn

购物车拼接属性修改

parent 7eb2ab56
...@@ -90,21 +90,21 @@ class DefaultItem extends AbstractItem ...@@ -90,21 +90,21 @@ class DefaultItem extends AbstractItem
$resource = $objectManager->get('Magento\Framework\App\ResourceConnection'); $resource = $objectManager->get('Magento\Framework\App\ResourceConnection');
$connection = $resource->getConnection(); $connection = $resource->getConnection();
if (!empty($options)) { // if (!empty($options)) {
foreach ($options as $key => $option) { // foreach ($options as $key => $option) {
if ($option['label'] != 'Size') { // if ($option['label'] != 'Size') {
$tableName = $resource->getTableName('eav_attribute_option_value'); // $tableName = $resource->getTableName('eav_attribute_option_value');
$sql = "Select * FROM " . $tableName ." where store_id=0 AND option_id=".$option['option_value']; // $sql = "Select * FROM " . $tableName ." where store_id=0 AND option_id=".$option['option_value'];
$result = $connection->fetchRow($sql); // $result = $connection->fetchRow($sql);
$options[$key]['value'] = $result['value']; // $options[$key]['value'] = $result['value'];
} else { // } else {
$tableName = $resource->getTableName('eav_attribute_option_swatch'); // $tableName = $resource->getTableName('eav_attribute_option_swatch');
$sql = "Select * FROM " . $tableName ." where store_id=0 AND option_id=".$option['option_value']; // $sql = "Select * FROM " . $tableName ." where store_id=0 AND option_id=".$option['option_value'];
$result = $connection->fetchRow($sql); // $result = $connection->fetchRow($sql);
$options[$key]['value'] = $result['value']; // $options[$key]['value'] = $result['value'];
} // }
} // }
} // }
return [ return [
'options' => $options, 'options' => $options,
'qty' => $this->item->getQty() * 1, 'qty' => $this->item->getQty() * 1,
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
</h2> </h2>
<div data-label="or" class="paypal checkout after paypal-logo"> <div data-label="or" class="paypal checkout after paypal-logo">
<div class="checkout-logo-medium" data-bind="click: paypalCheckout"> <div class="checkout-logo-medium" data-bind="click: paypalCheckout">
<input type="image" data-action="checkout-form-submit" data-checkout-url="/paypal/express/start/button/1/" src="http://local.joshine.com/static/frontend/Joshine/breeze/en_US/Magento_Paypal/images/paypal.png" alt="Checkout with PayPal" title="Checkout with PayPal"> <input type="image" data-action="checkout-form-submit" data-checkout-url="/paypal/express/start/button/1/" src="/static/frontend/Joshine/breeze/en_US/Magento_Paypal/images/paypal.png" alt="Checkout with PayPal" title="Checkout with PayPal">
<div class="checkout-txt" style="display:contents;"></div> <div class="checkout-txt" style="display:contents;"></div>
</div> </div>
</div> </div>
......
...@@ -18,40 +18,25 @@ $canApplyMsrp = $helper->isShowBeforeOrderConfirm($product) && $helper->isMinima ...@@ -18,40 +18,25 @@ $canApplyMsrp = $helper->isShowBeforeOrderConfirm($product) && $helper->isMinima
$objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$mobileDetect = $objectManager->get(\Joshine\Common\Lib\MobileDetect\MobileDetect::class); $mobileDetect = $objectManager->get(\Joshine\Common\Lib\MobileDetect\MobileDetect::class);
$priceBlock = $objectManager->get(\Magento\Catalog\Block\Product\AbstractProduct::class); $priceBlock = $objectManager->get(\Magento\Catalog\Block\Product\AbstractProduct::class);
$_options = $block->getOptionList();
$resource = $objectManager->get('Magento\Framework\App\ResourceConnection');
$connection = $resource->getConnection();
foreach ($_options as $key=>$_option) {
if ($_option['label'] != 'Size') {
$tableName = $resource->getTableName('eav_attribute_option_value');
$sql = "Select value FROM " . $tableName ." where store_id=0 AND option_id=".$_option['option_value'];
} else {
$tableName = $resource->getTableName('eav_attribute_option_swatch');
$sql = "Select value FROM " . $tableName ." where store_id=0 AND option_id=".$_option['option_value'];
}
$result = $connection->fetchRow($sql);
$_options[$key]['value'] = $result['value'];
}
?> ?>
<div class="cart item is_mobile"> <div class="cart item is_mobile">
<div class="item-info"> <div class="item-info">
<div class="item-info-left item-image"> <div class="item-info-left item-image">
<?php if ($block->hasProductUrl()) :?> <?php if ($block->hasProductUrl()) :?>
<a href="<?= $block->escapeUrl($block->getProductUrl()) ?>" <a href="<?= $block->escapeUrl($block->getProductUrl()) ?>"
title="<?= $block->escapeHtml($block->getProductName()) ?>" title="<?= $block->escapeHtml($block->getProductName()) ?>"
tabindex="-1" tabindex="-1"
class="product-item-photo"> class="product-item-photo">
<?php else :?> <?php else :?>
<span class="product-item-photo"> <span class="product-item-photo">
<?php endif;?> <?php endif;?>
<?= $block->getImage($block->getProductForThumbnail(), 'cart_page_product_thumbnail')->toHtml() ?> <?= $block->getImage($block->getProductForThumbnail(), 'cart_page_product_thumbnail')->toHtml() ?>
<?php if ($block->hasProductUrl()) :?> <?php if ($block->hasProductUrl()) :?>
</a> </a>
<?php else :?> <?php else :?>
</span> </span>
<?php endif; ?> <?php endif; ?>
</div> </div>
<div class="item-info-right item-info-detail"> <div class="item-info-right item-info-detail">
<!----------------------------item name start-----------------------------------> <!----------------------------item name start----------------------------------->
...@@ -66,18 +51,25 @@ foreach ($_options as $key=>$_option) { ...@@ -66,18 +51,25 @@ foreach ($_options as $key=>$_option) {
</p> </p>
<!----------------------------item name end-------------------------------------> <!----------------------------item name end------------------------------------->
<!----------------------------item option start---------------------------------> <!----------------------------item option start--------------------------------->
<?php if ($_options) :?> <?php if ($_options = $block->getOptionList()) :?>
<div class="item-options-meta"> <div class="item-options-meta">
<?php foreach ($_options as $key=>$_option) :?> <?php foreach ($_options as $_option) :?>
<strong style="font-weight: 600;margin-right: 10px;"><?= $block->escapeHtml($_option['label']) ?> :</strong>
<span class="item-options-line"> <span class="item-options-line">
<?= $block->escapeHtml($_option['value']) ?> <?php $_formatedOptionValue = $block->getFormatedOptionValue($_option) ?>
</span><br /> <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; ?> <?php endforeach; ?>
</div> </div>
<?php endif;?> <?php endif;?>
<div style="max-width: 100%;width: 100%;height: 40px;"> <div style="max-width: 100%;width: 100%;height: 40px;">
<!----------------------------item handle start---------------------------------> <!----------------------------item handle start--------------------------------->
<div class="item-handle" style="width: 16%;float:left;position: inherit;font-size: 16px;"> <div class="item-handle" style="width: 16%;float:left;position: inherit;font-size: 16px;">
<div class="item-quantity"> <div class="item-quantity">
...@@ -114,14 +106,14 @@ foreach ($_options as $key=>$_option) { ...@@ -114,14 +106,14 @@ foreach ($_options as $key=>$_option) {
<!----------------------------item handle end-----------------------------------> <!----------------------------item handle end----------------------------------->
<!----------------------------item option end-----------------------------------> <!----------------------------item option end----------------------------------->
<div style="float: right;padding-right: 15%;width: 40%;font-size: 18px;"> <div style="float: right;padding-right: 15%;width: 40%;font-size: 18px;">
<?php if ($canApplyMsrp) :?> <?php if ($canApplyMsrp) :?>
<span class="cart msrp subtotal">--</span> <span class="cart msrp subtotal">--</span>
<?php else :?> <?php else :?>
<?= $block->getRowTotalHtml($_item) ?> <?= $block->getRowTotalHtml($_item) ?>
<?php endif; ?> <?php endif; ?>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
......
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