Magento swatch is not disabled when configurable product is not on stock












1















I have a little problem at my Magento 2.2.5 store. When a combination of a configurable product is not on stock, the swatch should be disabled with a red strike. But at my store no swatch is disabled, as you can see at the following screenshot:



No disabled Swatch



Actually, the Large size and green color isn't on stock. So it should be:



What is should be



Is somebody know what to do? If i want to select this combination and put it in my cart, i get the error "not on stock"










share|improve this question

























  • hi @Kees, This is not the default behavior of magento 2, Need to customize to achieve that functionality

    – jafar pinjar
    Dec 23 '18 at 8:07
















1















I have a little problem at my Magento 2.2.5 store. When a combination of a configurable product is not on stock, the swatch should be disabled with a red strike. But at my store no swatch is disabled, as you can see at the following screenshot:



No disabled Swatch



Actually, the Large size and green color isn't on stock. So it should be:



What is should be



Is somebody know what to do? If i want to select this combination and put it in my cart, i get the error "not on stock"










share|improve this question

























  • hi @Kees, This is not the default behavior of magento 2, Need to customize to achieve that functionality

    – jafar pinjar
    Dec 23 '18 at 8:07














1












1








1


1






I have a little problem at my Magento 2.2.5 store. When a combination of a configurable product is not on stock, the swatch should be disabled with a red strike. But at my store no swatch is disabled, as you can see at the following screenshot:



No disabled Swatch



Actually, the Large size and green color isn't on stock. So it should be:



What is should be



Is somebody know what to do? If i want to select this combination and put it in my cart, i get the error "not on stock"










share|improve this question
















I have a little problem at my Magento 2.2.5 store. When a combination of a configurable product is not on stock, the swatch should be disabled with a red strike. But at my store no swatch is disabled, as you can see at the following screenshot:



No disabled Swatch



Actually, the Large size and green color isn't on stock. So it should be:



What is should be



Is somebody know what to do? If i want to select this combination and put it in my cart, i get the error "not on stock"







magento2 magento-2.2.5 swatches out-of-stock configurable-swatches






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Dec 22 '18 at 21:47







Kees Janssen

















asked Dec 22 '18 at 20:32









Kees JanssenKees Janssen

4519




4519













  • hi @Kees, This is not the default behavior of magento 2, Need to customize to achieve that functionality

    – jafar pinjar
    Dec 23 '18 at 8:07



















  • hi @Kees, This is not the default behavior of magento 2, Need to customize to achieve that functionality

    – jafar pinjar
    Dec 23 '18 at 8:07

















hi @Kees, This is not the default behavior of magento 2, Need to customize to achieve that functionality

– jafar pinjar
Dec 23 '18 at 8:07





hi @Kees, This is not the default behavior of magento 2, Need to customize to achieve that functionality

– jafar pinjar
Dec 23 '18 at 8:07










2 Answers
2






active

oldest

votes


















1














Try indexing :




  • php bin/magento indexer:reindex

  • php bin/magento cache:flush






share|improve this answer


























  • Yes, i get an error: Catalog rule indexing failed. See details in exception log. Catalog rule indexing failed. See details in exception log.

    – Kees Janssen
    Dec 22 '18 at 22:14













  • Can you share the error? Also, you can try php bin/magento setup:di:compile to get the exact error.

    – Imran Ali
    Dec 22 '18 at 22:16











  • Error is too long, i made a screenshot: ibb.co/L6c5YVW

    – Kees Janssen
    Dec 22 '18 at 22:17











  • Compilation result: Compilation was started. Interception cache generation... 7/7 [============================] 100% 21 secs 260.0 MiB Generated code and dependency injection configuration successfully.

    – Kees Janssen
    Dec 22 '18 at 22:19











  • Check if Admin>Store>Catalog>Catalog>Use Flat Catalog Category & make it NO

    – Imran Ali
    Dec 22 '18 at 22:20



















0














All the problems in the comments on Imran Ali are solved, but the main question is not. Does somebody knows the answer?






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%2f255589%2fmagento-swatch-is-not-disabled-when-configurable-product-is-not-on-stock%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    Try indexing :




    • php bin/magento indexer:reindex

    • php bin/magento cache:flush






    share|improve this answer


























    • Yes, i get an error: Catalog rule indexing failed. See details in exception log. Catalog rule indexing failed. See details in exception log.

      – Kees Janssen
      Dec 22 '18 at 22:14













    • Can you share the error? Also, you can try php bin/magento setup:di:compile to get the exact error.

      – Imran Ali
      Dec 22 '18 at 22:16











    • Error is too long, i made a screenshot: ibb.co/L6c5YVW

      – Kees Janssen
      Dec 22 '18 at 22:17











    • Compilation result: Compilation was started. Interception cache generation... 7/7 [============================] 100% 21 secs 260.0 MiB Generated code and dependency injection configuration successfully.

      – Kees Janssen
      Dec 22 '18 at 22:19











    • Check if Admin>Store>Catalog>Catalog>Use Flat Catalog Category & make it NO

      – Imran Ali
      Dec 22 '18 at 22:20
















    1














    Try indexing :




    • php bin/magento indexer:reindex

    • php bin/magento cache:flush






    share|improve this answer


























    • Yes, i get an error: Catalog rule indexing failed. See details in exception log. Catalog rule indexing failed. See details in exception log.

      – Kees Janssen
      Dec 22 '18 at 22:14













    • Can you share the error? Also, you can try php bin/magento setup:di:compile to get the exact error.

      – Imran Ali
      Dec 22 '18 at 22:16











    • Error is too long, i made a screenshot: ibb.co/L6c5YVW

      – Kees Janssen
      Dec 22 '18 at 22:17











    • Compilation result: Compilation was started. Interception cache generation... 7/7 [============================] 100% 21 secs 260.0 MiB Generated code and dependency injection configuration successfully.

      – Kees Janssen
      Dec 22 '18 at 22:19











    • Check if Admin>Store>Catalog>Catalog>Use Flat Catalog Category & make it NO

      – Imran Ali
      Dec 22 '18 at 22:20














    1












    1








    1







    Try indexing :




    • php bin/magento indexer:reindex

    • php bin/magento cache:flush






    share|improve this answer















    Try indexing :




    • php bin/magento indexer:reindex

    • php bin/magento cache:flush







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Dec 23 '18 at 10:22









    Teja Bhagavan Kollepara

    2,94841847




    2,94841847










    answered Dec 22 '18 at 22:07









    Imran AliImran Ali

    111




    111













    • Yes, i get an error: Catalog rule indexing failed. See details in exception log. Catalog rule indexing failed. See details in exception log.

      – Kees Janssen
      Dec 22 '18 at 22:14













    • Can you share the error? Also, you can try php bin/magento setup:di:compile to get the exact error.

      – Imran Ali
      Dec 22 '18 at 22:16











    • Error is too long, i made a screenshot: ibb.co/L6c5YVW

      – Kees Janssen
      Dec 22 '18 at 22:17











    • Compilation result: Compilation was started. Interception cache generation... 7/7 [============================] 100% 21 secs 260.0 MiB Generated code and dependency injection configuration successfully.

      – Kees Janssen
      Dec 22 '18 at 22:19











    • Check if Admin>Store>Catalog>Catalog>Use Flat Catalog Category & make it NO

      – Imran Ali
      Dec 22 '18 at 22:20



















    • Yes, i get an error: Catalog rule indexing failed. See details in exception log. Catalog rule indexing failed. See details in exception log.

      – Kees Janssen
      Dec 22 '18 at 22:14













    • Can you share the error? Also, you can try php bin/magento setup:di:compile to get the exact error.

      – Imran Ali
      Dec 22 '18 at 22:16











    • Error is too long, i made a screenshot: ibb.co/L6c5YVW

      – Kees Janssen
      Dec 22 '18 at 22:17











    • Compilation result: Compilation was started. Interception cache generation... 7/7 [============================] 100% 21 secs 260.0 MiB Generated code and dependency injection configuration successfully.

      – Kees Janssen
      Dec 22 '18 at 22:19











    • Check if Admin>Store>Catalog>Catalog>Use Flat Catalog Category & make it NO

      – Imran Ali
      Dec 22 '18 at 22:20

















    Yes, i get an error: Catalog rule indexing failed. See details in exception log. Catalog rule indexing failed. See details in exception log.

    – Kees Janssen
    Dec 22 '18 at 22:14







    Yes, i get an error: Catalog rule indexing failed. See details in exception log. Catalog rule indexing failed. See details in exception log.

    – Kees Janssen
    Dec 22 '18 at 22:14















    Can you share the error? Also, you can try php bin/magento setup:di:compile to get the exact error.

    – Imran Ali
    Dec 22 '18 at 22:16





    Can you share the error? Also, you can try php bin/magento setup:di:compile to get the exact error.

    – Imran Ali
    Dec 22 '18 at 22:16













    Error is too long, i made a screenshot: ibb.co/L6c5YVW

    – Kees Janssen
    Dec 22 '18 at 22:17





    Error is too long, i made a screenshot: ibb.co/L6c5YVW

    – Kees Janssen
    Dec 22 '18 at 22:17













    Compilation result: Compilation was started. Interception cache generation... 7/7 [============================] 100% 21 secs 260.0 MiB Generated code and dependency injection configuration successfully.

    – Kees Janssen
    Dec 22 '18 at 22:19





    Compilation result: Compilation was started. Interception cache generation... 7/7 [============================] 100% 21 secs 260.0 MiB Generated code and dependency injection configuration successfully.

    – Kees Janssen
    Dec 22 '18 at 22:19













    Check if Admin>Store>Catalog>Catalog>Use Flat Catalog Category & make it NO

    – Imran Ali
    Dec 22 '18 at 22:20





    Check if Admin>Store>Catalog>Catalog>Use Flat Catalog Category & make it NO

    – Imran Ali
    Dec 22 '18 at 22:20













    0














    All the problems in the comments on Imran Ali are solved, but the main question is not. Does somebody knows the answer?






    share|improve this answer




























      0














      All the problems in the comments on Imran Ali are solved, but the main question is not. Does somebody knows the answer?






      share|improve this answer


























        0












        0








        0







        All the problems in the comments on Imran Ali are solved, but the main question is not. Does somebody knows the answer?






        share|improve this answer













        All the problems in the comments on Imran Ali are solved, but the main question is not. Does somebody knows the answer?







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered 4 hours ago









        Kees JanssenKees Janssen

        4519




        4519






























            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%2f255589%2fmagento-swatch-is-not-disabled-when-configurable-product-is-not-on-stock%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

            What other Star Trek series did the main TNG cast show up in?

            Berlina muro

            Berlina aerponto