Commit bc92aceb by 王东红

fix

parent e1cf35ff
...@@ -23,7 +23,14 @@ class Toolbar ...@@ -23,7 +23,14 @@ class Toolbar
{ {
$this->_collection->getSelect()->order('e.created_at DESC'); $this->_collection->getSelect()->order('e.created_at DESC');
} }
elseif ($currentOrder == 'best_seller')
{
$subject->getCollection()->getSelect()->joinLeft(
'sales_order_item',
'e.entity_id = sales_order_item.product_id',
array('qty_ordered'=>'(select sum(soi.qty_ordered) from sales_order_item soi where soi.product_id = e.entity_id)'))->distinct(true)
->order('qty_ordered desc');
}
} }
return $result; return $result;
} }
......
...@@ -6,6 +6,7 @@ class Config ...@@ -6,6 +6,7 @@ class Config
{ {
public function afterGetAttributeUsedForSortByArray(\Magento\Catalog\Model\Config $catalogConfig, $options) public function afterGetAttributeUsedForSortByArray(\Magento\Catalog\Model\Config $catalogConfig, $options)
{ {
$options['best_seller'] = __('Best Seller');
$options['new_arrivals'] = __('New Arrivals'); $options['new_arrivals'] = __('New Arrivals');
$options['low_to_high'] = __('Price Low To High'); $options['low_to_high'] = __('Price Low To High');
$options['high_to_low'] = __('Price High To Low'); $options['high_to_low'] = __('Price High To Low');
......
...@@ -66,6 +66,7 @@ $_helper = $block->getData('outputHelper'); ...@@ -66,6 +66,7 @@ $_helper = $block->getData('outputHelper');
<?= $productImage->toHtml() ?> <?= $productImage->toHtml() ?>
</a> </a>
<div class="product details product-item-details"> <div class="product details product-item-details">
<?= $block->getProductDetailsHtml($_product) ?>
<?php $_productNameStripped = $block->stripTags($_product->getName(), null, true); ?> <?php $_productNameStripped = $block->stripTags($_product->getName(), null, true); ?>
<strong class="product name product-item-name"> <strong class="product name product-item-name">
<a class="product-item-link" <a class="product-item-link"
...@@ -76,7 +77,7 @@ $_helper = $block->getData('outputHelper'); ...@@ -76,7 +77,7 @@ $_helper = $block->getData('outputHelper');
<?= $block->getReviewsSummaryHtml($_product, $templateType) ?> <?= $block->getReviewsSummaryHtml($_product, $templateType) ?>
<?= /* @noEscape */ $block->getProductPrice($_product) ?> <?= /* @noEscape */ $block->getProductPrice($_product) ?>
<?= $block->getProductDetailsHtml($_product) ?>
<div class="product-item-inner"> <div class="product-item-inner">
<div class="product actions product-item-actions"> <div class="product actions product-item-actions">
...@@ -102,12 +103,12 @@ $_helper = $block->getData('outputHelper'); ...@@ -102,12 +103,12 @@ $_helper = $block->getData('outputHelper');
/* @noEscape */ $postParams['data'][Action::PARAM_NAME_URL_ENCODED] /* @noEscape */ $postParams['data'][Action::PARAM_NAME_URL_ENCODED]
?>"> ?>">
<?= $block->getBlockHtml('formkey') ?> <?= $block->getBlockHtml('formkey') ?>
<button type="submit" <!-- <button type="submit"-->
title="<?= $escaper->escapeHtmlAttr(__('Add to Cart')) ?>" <!-- title="--><?//= $escaper->escapeHtmlAttr(__('Add to Cart')) ?><!--"-->
class="action tocart primary" <!-- class="action tocart primary"-->
disabled> <!-- disabled>-->
<span><?= $escaper->escapeHtml(__('Add to Cart')) ?></span> <!-- <span>--><?//= $escaper->escapeHtml(__('Add to Cart')) ?><!--</span>-->
</button> <!-- </button>-->
</form> </form>
<?php else:?> <?php else:?>
<?php if ($_product->isAvailable()):?> <?php if ($_product->isAvailable()):?>
...@@ -124,11 +125,11 @@ $_helper = $block->getData('outputHelper'); ...@@ -124,11 +125,11 @@ $_helper = $block->getData('outputHelper');
$position, $position,
'product-item-info_' . $_product->getId() . ' div.actions-primary' 'product-item-info_' . $_product->getId() . ' div.actions-primary'
) : '' ?> ) : '' ?>
<div data-role="add-to-links" class="actions-secondary"> <!-- <div data-role="add-to-links" class="actions-secondary">-->
<?php if ($addToBlock = $block->getChildBlock('addto')): ?> <!-- --><?php //if ($addToBlock = $block->getChildBlock('addto')): ?>
<?= $addToBlock->setProduct($_product)->getChildHtml() ?> <!-- --><?//= $addToBlock->setProduct($_product)->getChildHtml() ?>
<?php endif; ?> <!-- --><?php //endif; ?>
</div> <!-- </div>-->
<?= strpos($pos, $viewMode . '-secondary') ? <?= strpos($pos, $viewMode . '-secondary') ?
/* @noEscape */ $secureRenderer->renderStyleAsTag( /* @noEscape */ $secureRenderer->renderStyleAsTag(
$position, $position,
......
...@@ -20,3 +20,14 @@ ...@@ -20,3 +20,14 @@
.products .product-item-photo img,#product-options-wrapper .swatch-option.image{ .products .product-item-photo img,#product-options-wrapper .swatch-option.image{
margin: 0; margin: 0;
} }
.products-grid .product-item .product.name a{
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
cursor: pointer;
width: 100%;
display: inline-block;
color: #222222;
margin-top: 5px;
}
\ No newline at end of file
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