Skip to content

Commit 00ed276

Browse files
committed
ACP2E-2062: Product Compare not honoring scope in Browser
1 parent ccb3383 commit 00ed276

File tree

1 file changed

+20
-4
lines changed
  • app/code/Magento/Catalog/Model/ResourceModel/Product/Compare

1 file changed

+20
-4
lines changed

app/code/Magento/Catalog/Model/ResourceModel/Product/Compare/Item.php

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use Magento\Customer\Model\Config\Share;
99
use Magento\Store\Model\StoreManagerInterface;
1010
use Magento\Framework\App\ObjectManager;
11+
use Magento\Framework\Model\ResourceModel\Db\Context;
1112

1213
/**
1314
* Catalog compare item resource model
@@ -27,16 +28,31 @@ class Item extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb
2728
private $storeManager;
2829

2930
/**
30-
* Initialize connection
31+
* Class constructor
3132
*
33+
* @param Context $context
34+
* @param string $connectionName
3235
* @param Share|null $share
3336
* @param StoreManagerInterface|null $storeManager
34-
* @return void
3537
*/
36-
protected function _construct(?Share $share = null, ?StoreManagerInterface $storeManager = null)
37-
{
38+
public function __construct(
39+
Context $context,
40+
$connectionName = null,
41+
?Share $share = null,
42+
?StoreManagerInterface $storeManager = null
43+
) {
3844
$this->share = $share ?? ObjectManager::getInstance()->get(Share::class);
3945
$this->storeManager = $storeManager ?? ObjectManager::getInstance()->get(StoreManagerInterface::class);
46+
parent::__construct($context, $connectionName);
47+
}
48+
49+
/**
50+
* Initialize connection
51+
*
52+
* @return void
53+
*/
54+
protected function _construct()
55+
{
4056
$this->_init('catalog_compare_item', 'catalog_compare_item_id');
4157
}
4258

0 commit comments

Comments
 (0)