2

Wired issue [Magento 2.3.2-p2] While placing a final payment I'm getting "server 500 error The requested qty is not available" While product qty is available. If qty is not available then it should give error while adding to the cart not on the checkout page.

1 exception(s):
Exception #0 (Magento\Framework\Exception\LocalizedException): The requested qty is not available

Exception #0 (Magento\Framework\Exception\LocalizedException): The requested qty is not available
<pre>#1 Magento\Quote\Model\Quote->updateItem(1049, &Magento\Framework\DataObject#00000000438f730900000000335e9cbe#) called at [vendor/magento/module-quote/Model/Quote/Item/CartItemPersister.php:73]
#2 Magento\Quote\Model\Quote\Item\CartItemPersister->save(&Magento\Quote\Model\Quote\Interceptor#00000000438f685400000000335e9cbe#, &Magento\Quote\Model\Quote\Item\Interceptor#00000000438f686800000000335e9cbe#) called at [vendor/magento/module-quote/Model/QuoteRepository/SaveHandler.php:82]
1
  • Have you fixed this issue? Jun 11, 2021 at 7:04

1 Answer 1

2

i faced similar issue for configurable product, you can check this file in vendor:

vendor/magento/module-configurable-product/Model/Quote/Item/CartItemProcessor.php:70

update this code: $requestData = ['id' => $cartItem->getItemId()]; enter image description here

if this code can fix your issue, you can create plugin to set cart item id to $requestData

seem this is bug from magento, they not set cart item id to buyRequest, but they checked it when init cart item by buyRequest:

vendor/magento/module-quote/Model/Quote/Item/Processor.php:94

this issue happen when try save quote with configurable product.

2
  • 1
    I did the same which you suggested but not working . Jun 11, 2021 at 7:05
  • For me too: Nothing has changed.. BUT: RUN php bin/magento cache:clean php bin/magento cache:flush php bin/magento indexer:reindex php bin/magento setup:upgrade May 19, 2022 at 0:41

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.