Skip to content

Product list does not contain extension_attributes stock_item #36615

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
b25636d
Product list does not contain extension_attributes stock_item
Kannakiraj123 Dec 15, 2022
3875f71
Merge branch '2.4-develop' into 2.4.develop_bugfix_product_list_add_s…
Kannakiraj123 Dec 15, 2022
67692f8
Product list search contain extension_attributes stock_item plugin
Kannakiraj123 Dec 16, 2022
ba9a693
Merge remote-tracking branch 'origin/2.4.develop_bugfix_product_list_…
Kannakiraj123 Dec 16, 2022
1ca3ca2
Merge branch '2.4-develop' into 2.4.develop_bugfix_product_list_add_s…
Kannakiraj123 Dec 19, 2022
320c08d
Merge branch '2.4-develop' into 2.4.develop_bugfix_product_list_add_s…
Kannakiraj123 Dec 21, 2022
d7990db
Merge branch '2.4-develop' into 2.4.develop_bugfix_product_list_add_s…
Kannakiraj123 Jan 2, 2023
ffff75e
Add deprecated comment
Kannakiraj123 Jan 2, 2023
b74626b
Product list does not contain extension_attributes stock_item with ob…
Kannakiraj123 Jan 4, 2023
783c349
Merge branch '2.4-develop' into 2.4.develop_bugfix_product_list_add_s…
Kannakiraj123 Jan 17, 2023
ee0ec98
Add type for the property
Kannakiraj123 Jan 17, 2023
e64669c
Fix copy paste static test error.
Kannakiraj123 Jan 17, 2023
abd0907
Fix rector coding standard
Kannakiraj123 Jan 17, 2023
c247725
Merge branch '2.4-develop' into 2.4.develop_bugfix_product_list_add_s…
Kannakiraj123 Jun 22, 2023
1a53734
Merge branch '2.4-develop' into 2.4.develop_bugfix_product_list_add_s…
Kannakiraj123 Jul 4, 2023
69c3dee
Merge branch '2.4-develop' into 2.4.develop_bugfix_product_list_add_s…
Kannakiraj123 Aug 21, 2023
2a0a866
Merge branch '2.4-develop' into 2.4.develop_bugfix_product_list_add_s…
swnsma Aug 29, 2023
ccc44ed
Merge branch '2.4-develop' into 2.4.develop_bugfix_product_list_add_s…
engcom-Hotel Oct 16, 2024
c6864e9
Merge branch '2.4-develop' into 2.4.develop_bugfix_product_list_add_s…
engcom-Bravo Oct 17, 2024
29b3424
Merge branch '2.4-develop' into 2.4.develop_bugfix_product_list_add_s…
engcom-Dash Oct 21, 2024
8f56a39
Merge branch '2.4-develop' into 2.4.develop_bugfix_product_list_add_s…
engcom-Dash Oct 22, 2024
2c4a16f
36615: Fix static failure related to copyright
engcom-Dash Oct 23, 2024
67d6e9d
Merge branch '2.4-develop' into 2.4.develop_bugfix_product_list_add_s…
engcom-Dash Nov 13, 2024
4886249
36615: Revert changes to investigate DB compare failure
engcom-Dash Nov 13, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
* Copyright 2018 Adobe
* All Rights Reserved.
*/

namespace Magento\CatalogInventory\Observer;
Expand All @@ -15,22 +15,23 @@
use Magento\Framework\Event\ObserverInterface;

/**
* Add Stock items to product collection.
* @deprecated 100.2.0 Stock Item as a part of ExtensionAttributes is deprecated
* @see StockItemInterface when you want to change the stock data
* @see StockStatusInterface when you want to read the stock data for representation layer (storefront)
* @see StockItemRepositoryInterface::save as extension point for customization of saving process
*/
class AddStockItemsObserver implements ObserverInterface
{
/**
* @var StockConfigurationInterface
*/
private $stockConfiguration;
private StockConfigurationInterface $stockConfiguration;
/**
* @var StockRegistryPreloader
*/
private $stockRegistryPreloader;
private StockRegistryPreloader $stockRegistryPreloader;

/**
* AddStockItemsObserver constructor.
*
* @param StockConfigurationInterface $stockConfiguration
* @param StockRegistryPreloader $stockRegistryPreloader
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
* Copyright 2018 Adobe
* All Rights Reserved.
*/
declare(strict_types=1);

Expand Down Expand Up @@ -29,16 +29,16 @@ class AddStockItemsObserverTest extends TestCase
*
* @var AddStockItemsObserver
*/
private $subject;
private AddStockItemsObserver $subject;

/**
* @var StockConfigurationInterface|MockObject
*/
private $stockConfigurationMock;
private StockConfigurationInterface $stockConfigurationMock;
/**
* @var StockRegistryPreloader|MockObject
*/
private $stockRegistryPreloader;
private StockRegistryPreloader $stockRegistryPreloader;

/**
* @inheritdoc
Expand Down
7 changes: 5 additions & 2 deletions app/code/Magento/CatalogInventory/etc/events.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
* Copyright 2013 Adobe
* All Rights Reserved.
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
Expand Down Expand Up @@ -43,4 +43,7 @@
<event name="sales_quote_item_collection_products_after_load">
<observer name="add_stock_items" instance="Magento\CatalogInventory\Observer\AddStockItemsObserver"/>
</event>
<event name="catalog_product_collection_load_after">
<observer name="add_stock_items_products" instance="Magento\CatalogInventory\Observer\AddStockItemsObserver"/>
</event>
</config>