Stock and Out Of Stock filter in Layered NavigationFilter out Configurable Products in layered navigation who have out of stock filtered optionHide Out of Stock Products in Layered Navigation, but Not CategoryFilter Products with layered navigation using AND conditionMagento layered navigation filter out configurable product out of stockHide out of stock products in Layered NavigationHow to add layered Navigation filter as stock availability?Customize Layered Navigation and Catalog List BehaviourMagento 2 Layered Navigation on Advanced Search Result PageStock availability filter not workinghide out of stock products from layered navigation in magento2
Why is su world executable?
Adding things to bunches of things vs multiplication
Unsolved Problems due to Lack of Computational Power
What should I do with the stock I own if I anticipate there will be a recession?
Good way to stop electrolyte tabs from turning into powder?
Why do aircraft leave cruising altitude long before landing just to circle?
Why won't the Republicans use a superdelegate system like the DNC in their nomination process?
Do I need to start off my book by describing the character's "normal world"?
Why do we use low resistance cables to minimize power losses?
Is there a word for returning to unpreparedness?
Why do so many people play out of turn on the last lead?
What would cause a nuclear power plant to break down after 2000 years, but not sooner?
How can I enter recovery mode (for Mac OS, on an iMac) remotely?
How to mock ApexTestQueueItem, AsyncApexJob, and ApexTestResult for test coverage?
Why don't modern jet engines use forced exhaust mixing?
What should we do with manuals from the 80s?
Does Medium Armor's Max dex also put a cap on the negative side?
Attacking the Hydra
Meaning of だけはわからない
String routines
How do I ask for 2-3 days per week remote work in a job interview?
Typesetting "hollow slash"
Eric Andre had a dream
What was the intention with the Commodore 128?
Stock and Out Of Stock filter in Layered Navigation
Filter out Configurable Products in layered navigation who have out of stock filtered optionHide Out of Stock Products in Layered Navigation, but Not CategoryFilter Products with layered navigation using AND conditionMagento layered navigation filter out configurable product out of stockHide out of stock products in Layered NavigationHow to add layered Navigation filter as stock availability?Customize Layered Navigation and Catalog List BehaviourMagento 2 Layered Navigation on Advanced Search Result PageStock availability filter not workinghide out of stock products from layered navigation in magento2
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I try to add Stock and Out Of Stock filter in the Layered Navigation.
I set the configuration of the attribute "quantity_and_stock_status":
In the storefront I look the filter, but if the configuration -> Display Product out of Stock is enabled it counts all items without stock status condition.
I have seen the following in the code. Magento does not filter if the option Display Product out of Stock is enabled.
if (!$this->inventoryConfig->isShowOutOfStock($currentScopeId))
$select->where('stock_index.stock_status = ?', Stock::STOCK_IN_STOCK);
I have tried to replace this class but the methods are private and it gives error.
Is there any alternative?
magento2 magento2.2 layered-navigation
add a comment |
I try to add Stock and Out Of Stock filter in the Layered Navigation.
I set the configuration of the attribute "quantity_and_stock_status":
In the storefront I look the filter, but if the configuration -> Display Product out of Stock is enabled it counts all items without stock status condition.
I have seen the following in the code. Magento does not filter if the option Display Product out of Stock is enabled.
if (!$this->inventoryConfig->isShowOutOfStock($currentScopeId))
$select->where('stock_index.stock_status = ?', Stock::STOCK_IN_STOCK);
I have tried to replace this class but the methods are private and it gives error.
Is there any alternative?
magento2 magento2.2 layered-navigation
add a comment |
I try to add Stock and Out Of Stock filter in the Layered Navigation.
I set the configuration of the attribute "quantity_and_stock_status":
In the storefront I look the filter, but if the configuration -> Display Product out of Stock is enabled it counts all items without stock status condition.
I have seen the following in the code. Magento does not filter if the option Display Product out of Stock is enabled.
if (!$this->inventoryConfig->isShowOutOfStock($currentScopeId))
$select->where('stock_index.stock_status = ?', Stock::STOCK_IN_STOCK);
I have tried to replace this class but the methods are private and it gives error.
Is there any alternative?
magento2 magento2.2 layered-navigation
I try to add Stock and Out Of Stock filter in the Layered Navigation.
I set the configuration of the attribute "quantity_and_stock_status":
In the storefront I look the filter, but if the configuration -> Display Product out of Stock is enabled it counts all items without stock status condition.
I have seen the following in the code. Magento does not filter if the option Display Product out of Stock is enabled.
if (!$this->inventoryConfig->isShowOutOfStock($currentScopeId))
$select->where('stock_index.stock_status = ?', Stock::STOCK_IN_STOCK);
I have tried to replace this class but the methods are private and it gives error.
Is there any alternative?
magento2 magento2.2 layered-navigation
magento2 magento2.2 layered-navigation
asked Mar 29 at 9:44
chdzmachdzma
4652 silver badges14 bronze badges
4652 silver badges14 bronze badges
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
It's not enough to change that single line of code$this->scopeConfig->isSetFlag('cataloginventory/options/show_out_of_stock');
is called throughout the code in different ways and manners.
The best approach would be to find every single call for this config and change it with plugins or preference if the methods are private, which they mostly are as it seems.
Or you could do the worst hack in magento history and take the laziest approach, where you create a plugin for MagentoFrameworkAppConfig
and check if the path is 'cataloginventory/options/show_out_of_stock' && your_custom_case
and return true of false based on your needs.
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "479"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f267935%2fstock-and-out-of-stock-filter-in-layered-navigation%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
It's not enough to change that single line of code$this->scopeConfig->isSetFlag('cataloginventory/options/show_out_of_stock');
is called throughout the code in different ways and manners.
The best approach would be to find every single call for this config and change it with plugins or preference if the methods are private, which they mostly are as it seems.
Or you could do the worst hack in magento history and take the laziest approach, where you create a plugin for MagentoFrameworkAppConfig
and check if the path is 'cataloginventory/options/show_out_of_stock' && your_custom_case
and return true of false based on your needs.
add a comment |
It's not enough to change that single line of code$this->scopeConfig->isSetFlag('cataloginventory/options/show_out_of_stock');
is called throughout the code in different ways and manners.
The best approach would be to find every single call for this config and change it with plugins or preference if the methods are private, which they mostly are as it seems.
Or you could do the worst hack in magento history and take the laziest approach, where you create a plugin for MagentoFrameworkAppConfig
and check if the path is 'cataloginventory/options/show_out_of_stock' && your_custom_case
and return true of false based on your needs.
add a comment |
It's not enough to change that single line of code$this->scopeConfig->isSetFlag('cataloginventory/options/show_out_of_stock');
is called throughout the code in different ways and manners.
The best approach would be to find every single call for this config and change it with plugins or preference if the methods are private, which they mostly are as it seems.
Or you could do the worst hack in magento history and take the laziest approach, where you create a plugin for MagentoFrameworkAppConfig
and check if the path is 'cataloginventory/options/show_out_of_stock' && your_custom_case
and return true of false based on your needs.
It's not enough to change that single line of code$this->scopeConfig->isSetFlag('cataloginventory/options/show_out_of_stock');
is called throughout the code in different ways and manners.
The best approach would be to find every single call for this config and change it with plugins or preference if the methods are private, which they mostly are as it seems.
Or you could do the worst hack in magento history and take the laziest approach, where you create a plugin for MagentoFrameworkAppConfig
and check if the path is 'cataloginventory/options/show_out_of_stock' && your_custom_case
and return true of false based on your needs.
answered Aug 5 at 12:10
MagarusuMagarusu
2781 gold badge3 silver badges10 bronze badges
2781 gold badge3 silver badges10 bronze badges
add a comment |
add a comment |
Thanks for contributing an answer to Magento Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f267935%2fstock-and-out-of-stock-filter-in-layered-navigation%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown