File tree Expand file tree Collapse file tree 5 files changed +18
-28
lines changed
dev/tests/integration/testsuite/Magento/Catalog/Controller/Product Expand file tree Collapse file tree 5 files changed +18
-28
lines changed Original file line number Diff line number Diff line change @@ -149,7 +149,7 @@ public function getItems()
149
149
$ this ->_compareProduct ->setAllowUsedFlat (false );
150
150
151
151
$ this ->_items = $ this ->_itemCollectionFactory ->create ();
152
- $ this ->_items ->useProductItem (true )->setStoreId ($ this ->_storeManager ->getStore ()->getId ());
152
+ $ this ->_items ->useProductItem ()->setStoreId ($ this ->_storeManager ->getStore ()->getId ());
153
153
154
154
if ($ this ->httpContext ->getValue (Context::CONTEXT_AUTH )) {
155
155
$ this ->_items ->setCustomerId ($ this ->currentCustomer ->getCustomerId ());
Original file line number Diff line number Diff line change @@ -279,7 +279,7 @@ public function getItemCollection()
279
279
// cannot be placed in constructor because of the cyclic dependency which cannot be fixed with proxy class
280
280
// collection uses this helper in constructor when calling isEnabledFlat() method
281
281
$ this ->_itemCollection = $ this ->_itemCollectionFactory ->create ();
282
- $ this ->_itemCollection ->useProductItem (true )->setStoreId ($ this ->_storeManager ->getStore ()->getId ());
282
+ $ this ->_itemCollection ->useProductItem ()->setStoreId ($ this ->_storeManager ->getStore ()->getId ());
283
283
284
284
if ($ this ->_customerSession ->isLoggedIn ()) {
285
285
$ this ->_itemCollection ->setCustomerId ($ this ->_customerSession ->getCustomerId ());
@@ -313,7 +313,7 @@ public function calculate($logout = false)
313
313
{
314
314
/** @var $collection Collection */
315
315
$ collection = $ this ->_itemCollectionFactory ->create ()
316
- ->useProductItem (true );
316
+ ->useProductItem ();
317
317
if (!$ logout && $ this ->_customerSession ->isLoggedIn ()) {
318
318
$ collection ->setCustomerId ($ this ->_customerSession ->getCustomerId ());
319
319
} elseif ($ this ->_customerId ) {
Original file line number Diff line number Diff line change @@ -46,23 +46,15 @@ public function getItemCollection()
46
46
$ collection = $ this ->getData ('item_collection ' );
47
47
if ($ collection === null ) {
48
48
if ($ collection = $ this ->getCreateOrderModel ()->getCustomerCompareList ()) {
49
- $ collection = $ collection ->getItemCollection ()->useProductItem (
50
- true
51
- )->setStoreId (
52
- $ this ->getQuote ()->getStoreId ()
53
- )->addStoreFilter (
54
- $ this ->getQuote ()->getStoreId ()
55
- )->setCustomerId (
56
- $ this ->getCustomerId ()
57
- )->addAttributeToSelect (
58
- 'name '
59
- )->addAttributeToSelect (
60
- 'price '
61
- )->addAttributeToSelect (
62
- 'image '
63
- )->addAttributeToSelect (
64
- 'status '
65
- )->load ();
49
+ $ collection = $ collection ->getItemCollection ()
50
+ ->useProductItem ()
51
+ ->setStoreId ($ this ->getQuote ()->getStoreId ())
52
+ ->addStoreFilter ($ this ->getQuote ()->getStoreId ())
53
+ ->setCustomerId ($ this ->getCustomerId ())
54
+ ->addAttributeToSelect ('name ' )
55
+ ->addAttributeToSelect ('price ' )->addAttributeToSelect ('image ' )
56
+ ->addAttributeToSelect ('status ' )
57
+ ->load ();
66
58
}
67
59
$ this ->setData ('item_collection ' , $ collection );
68
60
}
Original file line number Diff line number Diff line change @@ -89,13 +89,11 @@ public function getItemCollection()
89
89
// get products to skip
90
90
$ skipProducts = [];
91
91
if ($ collection = $ this ->getCreateOrderModel ()->getCustomerCompareList ()) {
92
- $ collection = $ collection ->getItemCollection ()->useProductItem (
93
- true
94
- )->setStoreId (
95
- $ this ->getStoreId ()
96
- )->setCustomerId (
97
- $ this ->getCustomerId ()
98
- )->load ();
92
+ $ collection = $ collection ->getItemCollection ()
93
+ ->useProductItem ()
94
+ ->setStoreId ($ this ->getStoreId ())
95
+ ->setCustomerId ($ this ->getCustomerId ())
96
+ ->load ();
99
97
foreach ($ collection as $ _item ) {
100
98
$ skipProducts [] = $ _item ->getProductId ();
101
99
}
Original file line number Diff line number Diff line change @@ -412,7 +412,7 @@ protected function _assertCompareListEquals(array $expectedProductIds)
412
412
$ compareItems = \Magento \TestFramework \Helper \Bootstrap::getObjectManager ()->create (
413
413
\Magento \Catalog \Model \ResourceModel \Product \Compare \Item \Collection::class
414
414
);
415
- $ compareItems ->useProductItem (true );
415
+ $ compareItems ->useProductItem ();
416
416
// important
417
417
$ compareItems ->setVisitorId (
418
418
\Magento \TestFramework \Helper \Bootstrap::getObjectManager ()->get (
You can’t perform that action at this time.
0 commit comments