1

I have upgraded Magento with Latest version 2.2.4 and trying to place order.It produce below exception error

[2018-06-26 12:40:50] main.CRITICAL: Notice: Undefined index: product_id in /var/www/html/magento2/vendor/magento/module-catalog-inventory/Model/StockManagement.php on line 103 {"exception":"[object] (Exception(code: 0): Notice: Undefined index: product_id in /var/www/html/magento2/vendor/magento/module-catalog-inventory/Model/StockManagement.php on line 103 at /var/www/html/magento2/vendor/magento/framework/App/ErrorHandler.php:61)"} []

I have checked in file and found that array variable is producing error

$productId = $lockedItemRecord['product_id'];

I have tried and changed this with Hard coded then it is working fine.I am not getting what is the issue in this code.

$productId = "395";

I have already compiled all code and tested in both mode developer and production.

Please support me to resolve this issue.

2 Answers 2

1

I had the same problem.

After searching the source of Magento 2.2.4 I found the function in file (vendor\magento\module-catalog-inventory\Model\Configuration.php):

public function getDefaultScopeId()
{
    // TODO: should be fixed in MAGETWO-46043
    // "0" is id of admin website, which is used in backed during save entity
    return 0;
}

In my case I modify Store parameters at "Stores > All Stores" and my actual store_id/scope_id was 1 and not 0. After changing "return 0" to "return 1", my problem was solved.

As this is anyhow TODO for Magento I expect, that in next upgrade this will be solved and all my modification will be overwritten and everything should work at that time...

0

I had same problem, so now fixed..i have updated the solution in community.magento.com/t5/Magento-2-x-Technical-Issues/Magento-2-2-show-the-error-in-place-order. Pls check the link. Also thumps up.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.