Magento 2 - Cancel order incrementing 2 quantity of productStock quantity not increasing after cancellationMagento 2.1 - Cancel an order [ configurable product ] issueMagento 2 Restore Quote/Cart after order is cancelled/FailedHow to show the total quantity number(Like 10) instead of In Stock Status in Magento 2.x?how to cancel certain order item rather than cancel whole order?Product doesn't change stock status until after the page reloadMagento 2: Product stock status is not automatically updated from Out of Stock to In StockHow to update the stock status after the quantity changed in magento 2.2.4Product stock not returning to available stock in canceled orderMagento 2 - Card decline status not reverting quantity

How to securely dispose of a smartphone?

Why did the Apple //e make a hideous noise if you inserted the disk upside down?

A* pathfinding algorithm too slow

Bin Packing with Relational Penalization

Do home values typically rise and fall consistently across different price ranges?

Does a return economy-class seat between London and San Francisco release 5.28 tonnes of CO2 equivalents?

Is it okay to submit a paper from a master's thesis without informing the advisor?

Why doesn't SpaceX land boosters in Africa?

How to stop the sales department from selling functionalities that don't exist

How do I ensure my employees don't abuse my flexible work hours policy?

Explain usage of "kaved" re Moshe's raising his hands w/ war of Amaleq

Why wasn't ASCII designed with a contiguous alphanumeric character order?

Early 2000s movie about time travel, protagonist travels back to save girlfriend, then into multiple points in future

How can I deal with extreme temperatures in a hotel room?

Have any large aeroplanes been landed — safely and without damage — in locations that they could not be flown away from?

Calculus, Water Poured into a Cone: Why is Derivative Non-linear?

Why was Pan Am Flight 103 flying over Lockerbie?

Why was p[:] designed to work differently in these two situations?

Why would anyone even use a Portkey?

Robots in a spaceship

Word ending in "-ine" for rat-like

Are Valenar elves and Aereni elves different races of elves?

Journal standards vs. personal standards

List manipulation: conditional result based on variable-length sublists



Magento 2 - Cancel order incrementing 2 quantity of product


Stock quantity not increasing after cancellationMagento 2.1 - Cancel an order [ configurable product ] issueMagento 2 Restore Quote/Cart after order is cancelled/FailedHow to show the total quantity number(Like 10) instead of In Stock Status in Magento 2.x?how to cancel certain order item rather than cancel whole order?Product doesn't change stock status until after the page reloadMagento 2: Product stock status is not automatically updated from Out of Stock to In StockHow to update the stock status after the quantity changed in magento 2.2.4Product stock not returning to available stock in canceled orderMagento 2 - Card decline status not reverting quantity






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1















In Magento 2.2.5 EE



Before placing order:

Product quantity = 1

stock status = 1



After placing order:

product quantity = 0

stock status = 0



After cancel order:

product quantity = 2

stock status = 1



I have check in my code, there is no order_cancel_after or sales_order_save_after or sales_order_state_change_before observer in any custom module.



Any idea what would be the issue?










share|improve this question
























  • You checked here in this table?: cataloginventory_stock_status

    – Ravi Soni
    Jun 21 at 6:13












  • Yes, it has same result which I have added in question.

    – Shoaib Munir
    Jun 21 at 6:17











  • Please check once in Fresh Setup, Cause I have already checked in fresh setup, but yeah I have Added one more step after Cancel order RUN command indexer:reindex. I didn't get mentioned issue.

    – Ravi Soni
    Jun 21 at 6:18












  • Yes, most probably it will work fine on fresh setup. I just want to know from where this is happening? I have canceled order programmatically and also from admin, both are incrementing 2 quantities. I have check some observers, I want to know what else should I check to debug the issue

    – Shoaib Munir
    Jun 21 at 6:22











  • Might somewhere it happens due to after save order.

    – Ravi Soni
    Jun 21 at 9:06


















1















In Magento 2.2.5 EE



Before placing order:

Product quantity = 1

stock status = 1



After placing order:

product quantity = 0

stock status = 0



After cancel order:

product quantity = 2

stock status = 1



I have check in my code, there is no order_cancel_after or sales_order_save_after or sales_order_state_change_before observer in any custom module.



Any idea what would be the issue?










share|improve this question
























  • You checked here in this table?: cataloginventory_stock_status

    – Ravi Soni
    Jun 21 at 6:13












  • Yes, it has same result which I have added in question.

    – Shoaib Munir
    Jun 21 at 6:17











  • Please check once in Fresh Setup, Cause I have already checked in fresh setup, but yeah I have Added one more step after Cancel order RUN command indexer:reindex. I didn't get mentioned issue.

    – Ravi Soni
    Jun 21 at 6:18












  • Yes, most probably it will work fine on fresh setup. I just want to know from where this is happening? I have canceled order programmatically and also from admin, both are incrementing 2 quantities. I have check some observers, I want to know what else should I check to debug the issue

    – Shoaib Munir
    Jun 21 at 6:22











  • Might somewhere it happens due to after save order.

    – Ravi Soni
    Jun 21 at 9:06














1












1








1








In Magento 2.2.5 EE



Before placing order:

Product quantity = 1

stock status = 1



After placing order:

product quantity = 0

stock status = 0



After cancel order:

product quantity = 2

stock status = 1



I have check in my code, there is no order_cancel_after or sales_order_save_after or sales_order_state_change_before observer in any custom module.



Any idea what would be the issue?










share|improve this question
















In Magento 2.2.5 EE



Before placing order:

Product quantity = 1

stock status = 1



After placing order:

product quantity = 0

stock status = 0



After cancel order:

product quantity = 2

stock status = 1



I have check in my code, there is no order_cancel_after or sales_order_save_after or sales_order_state_change_before observer in any custom module.



Any idea what would be the issue?







magento2 orders sales-order magento-2.2.5 stock-status






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jun 21 at 6:36







Shoaib Munir

















asked Jun 21 at 5:49









Shoaib MunirShoaib Munir

4,6446 gold badges22 silver badges67 bronze badges




4,6446 gold badges22 silver badges67 bronze badges












  • You checked here in this table?: cataloginventory_stock_status

    – Ravi Soni
    Jun 21 at 6:13












  • Yes, it has same result which I have added in question.

    – Shoaib Munir
    Jun 21 at 6:17











  • Please check once in Fresh Setup, Cause I have already checked in fresh setup, but yeah I have Added one more step after Cancel order RUN command indexer:reindex. I didn't get mentioned issue.

    – Ravi Soni
    Jun 21 at 6:18












  • Yes, most probably it will work fine on fresh setup. I just want to know from where this is happening? I have canceled order programmatically and also from admin, both are incrementing 2 quantities. I have check some observers, I want to know what else should I check to debug the issue

    – Shoaib Munir
    Jun 21 at 6:22











  • Might somewhere it happens due to after save order.

    – Ravi Soni
    Jun 21 at 9:06


















  • You checked here in this table?: cataloginventory_stock_status

    – Ravi Soni
    Jun 21 at 6:13












  • Yes, it has same result which I have added in question.

    – Shoaib Munir
    Jun 21 at 6:17











  • Please check once in Fresh Setup, Cause I have already checked in fresh setup, but yeah I have Added one more step after Cancel order RUN command indexer:reindex. I didn't get mentioned issue.

    – Ravi Soni
    Jun 21 at 6:18












  • Yes, most probably it will work fine on fresh setup. I just want to know from where this is happening? I have canceled order programmatically and also from admin, both are incrementing 2 quantities. I have check some observers, I want to know what else should I check to debug the issue

    – Shoaib Munir
    Jun 21 at 6:22











  • Might somewhere it happens due to after save order.

    – Ravi Soni
    Jun 21 at 9:06

















You checked here in this table?: cataloginventory_stock_status

– Ravi Soni
Jun 21 at 6:13






You checked here in this table?: cataloginventory_stock_status

– Ravi Soni
Jun 21 at 6:13














Yes, it has same result which I have added in question.

– Shoaib Munir
Jun 21 at 6:17





Yes, it has same result which I have added in question.

– Shoaib Munir
Jun 21 at 6:17













Please check once in Fresh Setup, Cause I have already checked in fresh setup, but yeah I have Added one more step after Cancel order RUN command indexer:reindex. I didn't get mentioned issue.

– Ravi Soni
Jun 21 at 6:18






Please check once in Fresh Setup, Cause I have already checked in fresh setup, but yeah I have Added one more step after Cancel order RUN command indexer:reindex. I didn't get mentioned issue.

– Ravi Soni
Jun 21 at 6:18














Yes, most probably it will work fine on fresh setup. I just want to know from where this is happening? I have canceled order programmatically and also from admin, both are incrementing 2 quantities. I have check some observers, I want to know what else should I check to debug the issue

– Shoaib Munir
Jun 21 at 6:22





Yes, most probably it will work fine on fresh setup. I just want to know from where this is happening? I have canceled order programmatically and also from admin, both are incrementing 2 quantities. I have check some observers, I want to know what else should I check to debug the issue

– Shoaib Munir
Jun 21 at 6:22













Might somewhere it happens due to after save order.

– Ravi Soni
Jun 21 at 9:06






Might somewhere it happens due to after save order.

– Ravi Soni
Jun 21 at 9:06











1 Answer
1






active

oldest

votes


















0














I had checked these observers in my codebase:



  • order_cancel_after

  • sales_order_save_after

  • sales_order_state_change_before

I haven't found above observers in any of my custom/installed module.



But now I found the issue, there was an observer sales_order_save_before in a custom payment method, it was increasing quantity on order cancel. So, when I was canceling the order Magento increasing order quantity (Which is a default functionality) and also this observer (sales_order_save_before) was also increasing quantity.



That's way quantity was increasing twice.






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%2f279104%2fmagento-2-cancel-order-incrementing-2-quantity-of-product%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














    I had checked these observers in my codebase:



    • order_cancel_after

    • sales_order_save_after

    • sales_order_state_change_before

    I haven't found above observers in any of my custom/installed module.



    But now I found the issue, there was an observer sales_order_save_before in a custom payment method, it was increasing quantity on order cancel. So, when I was canceling the order Magento increasing order quantity (Which is a default functionality) and also this observer (sales_order_save_before) was also increasing quantity.



    That's way quantity was increasing twice.






    share|improve this answer



























      0














      I had checked these observers in my codebase:



      • order_cancel_after

      • sales_order_save_after

      • sales_order_state_change_before

      I haven't found above observers in any of my custom/installed module.



      But now I found the issue, there was an observer sales_order_save_before in a custom payment method, it was increasing quantity on order cancel. So, when I was canceling the order Magento increasing order quantity (Which is a default functionality) and also this observer (sales_order_save_before) was also increasing quantity.



      That's way quantity was increasing twice.






      share|improve this answer

























        0












        0








        0







        I had checked these observers in my codebase:



        • order_cancel_after

        • sales_order_save_after

        • sales_order_state_change_before

        I haven't found above observers in any of my custom/installed module.



        But now I found the issue, there was an observer sales_order_save_before in a custom payment method, it was increasing quantity on order cancel. So, when I was canceling the order Magento increasing order quantity (Which is a default functionality) and also this observer (sales_order_save_before) was also increasing quantity.



        That's way quantity was increasing twice.






        share|improve this answer













        I had checked these observers in my codebase:



        • order_cancel_after

        • sales_order_save_after

        • sales_order_state_change_before

        I haven't found above observers in any of my custom/installed module.



        But now I found the issue, there was an observer sales_order_save_before in a custom payment method, it was increasing quantity on order cancel. So, when I was canceling the order Magento increasing order quantity (Which is a default functionality) and also this observer (sales_order_save_before) was also increasing quantity.



        That's way quantity was increasing twice.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Jun 24 at 7:04









        Shoaib MunirShoaib Munir

        4,6446 gold badges22 silver badges67 bronze badges




        4,6446 gold badges22 silver badges67 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%2f279104%2fmagento-2-cancel-order-incrementing-2-quantity-of-product%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?