Skip to content

Commit

Permalink
Changed get product way in blocks with related products
Browse files Browse the repository at this point in the history
  • Loading branch information
Henryk Tews authored and gelanivishal committed Nov 23, 2018
1 parent 0f57a30 commit d332f71
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class Crosssell extends \Magento\Catalog\Block\Product\AbstractProduct
*/
protected function _prepareData()
{
$product = $this->_coreRegistry->registry('product');
$product = $this->getProduct();
/* @var $product \Magento\Catalog\Model\Product */

$this->_itemCollection = $product->getCrossSellProductCollection()->addAttributeToSelect(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public function __construct(
*/
protected function _prepareData()
{
$product = $this->_coreRegistry->registry('product');
$product = $this->getProduct();
/* @var $product \Magento\Catalog\Model\Product */

$this->_itemCollection = $product->getRelatedProductCollection()->addAttributeToSelect(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public function __construct(
*/
protected function _prepareData()
{
$product = $this->_coreRegistry->registry('product');
$product = $this->getProduct();
/* @var $product \Magento\Catalog\Model\Product */
$this->_itemCollection = $product->getUpSellProductCollection()->setPositionOrder()->addStoreFilter();
if ($this->moduleManager->isEnabled('Magento_Checkout')) {
Expand Down

0 comments on commit d332f71

Please sign in to comment.