Skip to content

Commit cfeb36f

Browse files
authored
ENGCOM-6630: magento/magento2#: Unit test for \Magento\Bundle\Observer\AppendUpsellProductsObserver #26429
2 parents 1048d1f + 5fbe319 commit cfeb36f

File tree

2 files changed

+421
-2
lines changed

2 files changed

+421
-2
lines changed

app/code/Magento/Bundle/Observer/AppendUpsellProductsObserver.php

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77

88
use Magento\Framework\Event\ObserverInterface;
99

10+
/**
11+
* Class adds bundle products into up-sell products collection
12+
*/
1013
class AppendUpsellProductsObserver implements ObserverInterface
1114
{
1215
/**
@@ -98,9 +101,15 @@ public function execute(\Magento\Framework\Event\Observer $observer)
98101
}
99102

100103
/* @var $bundleCollection \Magento\Catalog\Model\ResourceModel\Product\Collection */
101-
$bundleCollection = $product->getCollection()->addAttributeToSelect(
104+
$bundleCollection = $product->getCollection();
105+
$bundleCollection->addAttributeToSelect(
102106
$this->config->getProductAttributes()
103-
)->addStoreFilter()->addMinimalPrice()->addFinalPrice()->addTaxPercents()->setVisibility(
107+
);
108+
$bundleCollection->addStoreFilter();
109+
$bundleCollection->addMinimalPrice();
110+
$bundleCollection->addFinalPrice();
111+
$bundleCollection->addTaxPercents();
112+
$bundleCollection->setVisibility(
104113
$this->productVisibility->getVisibleInCatalogIds()
105114
);
106115

0 commit comments

Comments
 (0)