Commit b5afac36 by halweg

Merge branch 'developer' of http://47.99.244.21:9999/root/joshine into developer

parents 56e66989 a9ad3898
...@@ -133,7 +133,7 @@ class Upsell extends AbstractProduct implements IdentityInterface ...@@ -133,7 +133,7 @@ class Upsell extends AbstractProduct implements IdentityInterface
$collection->addAttributeToSelect('*'); $collection->addAttributeToSelect('*');
$collection->setVisibility($this->_catalogProductVisibility->getVisibleInCatalogIds()); $collection->setVisibility($this->_catalogProductVisibility->getVisibleInCatalogIds());
$collection->getSelect()->order('rand()'); $collection->getSelect()->order('rand()');
$collection->setPageSize(10); $collection->setPageSize(6);
$collection->addStoreFilter($product->getStoreId()); $collection->addStoreFilter($product->getStoreId());
$this->_itemCollection = $collection; $this->_itemCollection = $collection;
......
...@@ -34,7 +34,7 @@ class Recently extends \Magento\Framework\App\Action\Action ...@@ -34,7 +34,7 @@ class Recently extends \Magento\Framework\App\Action\Action
$productCollection->addAttributeToSelect('*') $productCollection->addAttributeToSelect('*')
->addFieldToFilter('status', 1) ->addFieldToFilter('status', 1)
->addAttributeToFilter('entity_id', array( 'in' => $in)); ->addAttributeToFilter('entity_id', array( 'in' => $in));
$productCollection->getSelect()->order(sprintf("field(e.entity_id,%s)", $productIds)); $productCollection->getSelect()->order(sprintf("field(e.entity_id,%s)", $productIds))->limit(6);
/** @var \Magento\CatalogInventory\Helper\Stock $stockHelper */ /** @var \Magento\CatalogInventory\Helper\Stock $stockHelper */
$stockHelper = $this->_objectManager->get('Magento\CatalogInventory\Helper\Stock'); $stockHelper = $this->_objectManager->get('Magento\CatalogInventory\Helper\Stock');
$stockHelper->addInStockFilterToCollection($productCollection); $stockHelper->addInStockFilterToCollection($productCollection);
......
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