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;








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":



enter image description here



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?










share|improve this question






























    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":



    enter image description here



    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?










    share|improve this question


























      0












      0








      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":



      enter image description here



      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?










      share|improve this question














      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":



      enter image description here



      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






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 29 at 9:44









      chdzmachdzma

      4652 silver badges14 bronze badges




      4652 silver badges14 bronze badges























          1 Answer
          1






          active

          oldest

          votes


















          0














          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.






          share|improve this answer



























            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
            );



            );













            draft saved

            draft discarded


















            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









            0














            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.






            share|improve this answer





























              0














              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.






              share|improve this answer



























                0












                0








                0







                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.






                share|improve this answer













                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.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Aug 5 at 12:10









                MagarusuMagarusu

                2781 gold badge3 silver badges10 bronze badges




                2781 gold badge3 silver badges10 bronze badges






























                    draft saved

                    draft discarded
















































                    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.




                    draft saved


                    draft discarded














                    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





















































                    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







                    Popular posts from this blog

                    Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

                    Circuit construction for execution of conditional statements using least significant bitHow are two different registers being used as “control”?How exactly is the stated composite state of the two registers being produced using the $R_zz$ controlled rotations?Efficiently performing controlled rotations in HHLWould this quantum algorithm implementation work?How to prepare a superposed states of odd integers from $1$ to $sqrtN$?Why is this implementation of the order finding algorithm not working?Circuit construction for Hamiltonian simulationHow can I invert the least significant bit of a certain term of a superposed state?Implementing an oracleImplementing a controlled sum operation

                    Magento 2 “No Payment Methods” in Admin New OrderHow to integrate Paypal Express Checkout with the Magento APIMagento 1.5 - Sales > Order > edit order and shipping methods disappearAuto Invoice Check/Money Order Payment methodAdd more simple payment methods?Shipping methods not showingWhat should I do to change payment methods if changing the configuration has no effects?1.9 - No Payment Methods showing upMy Payment Methods not Showing for downloadable/virtual product when checkout?Magento2 API to access internal payment methodHow to call an existing payment methods in the registration form?