When entering the cart and updating the amount of in cart products, so that current stock is exceeded, the cart displays weird prices. The stock warning appears correctly, but still the prices are wrong. This applies to simple and configurable products. This happens after upgrading to 1.9.3.1. It did not happen with 1.9.2.4. No extensions were installed in the meantime.
Thanks for reading this.
Solved! Go to Solution.
This "bug" was introduced in Magento CE 1.9.3.0 by the following modification in app/code/core/Mage/Sales/Model/Quote/Address/Total/Subtotal.php:
$item->setPrice($finalPrice) ->setBaseOriginalPrice($finalPrice); $item->calcRowTotal(); - } else if (!$quoteItem->getParentItem()) { + } else if (!$quoteItem->getParentItem() && !$item->getHasError()) { $finalPrice = $product->getFinalPrice($quoteItem->getQty()); $item->setPrice($finalPrice) ->setBaseOriginalPrice($finalPrice);
Because of this the quote calculation isn't done correctly anymore. I don't find a reasonable notification for this in the CE 1.9.3.0 release notes.
I fixed this problem by rewriting this modification back to the CE 1.9.2.x behaviour.
<models> ... <sales> <rewrite> <quote_address_total_subtotal>Mypackage_Mymodule_Model_Sales_Quote_Address_Total_Subtotal</quote_address_total_subtotal> </rewrite> </sales> </models>
and Mypackage_Mymodule_Model_Sales_Quote_Address_Total_Subtotal
<?php class Mypackage_Mymodule_Model_Sales_Quote_Address_Total_Subtotal extends Mage_Sales_Model_Quote_Address_Total_Subtotal { /** * Address item initialization * * @param $item * @return bool */ protected function _initItem($address, $item) { ... } else if (!$quoteItem->getParentItem()) { $finalPrice = $product->getFinalPrice($quoteItem->getQty()); ... }
Confirmed on 1.9.3.0 as well
Hi @Alex M and @stellar_job,
I haven't seen this issue before when upgrading. Did you both upgrade from the same version, 1.9.2.4? Could you also give a little more info about it? Like a screenshot, or what you expected to see and what you're actually seeing, etc.
That might help us helping you.
Thanks!
Hello.
I'm not sure about the upgrade, I'll have to get back to you on that.
Here's a video of the issue taking place: https://drive.google.com/file/d/0B2il0vHgXKayWVk0T1hvQ01NTjg/view?usp=sharing
Update procedure from 1.9.2.4 :
to 1.9.3.0 by magentoconnect. Logs indicated successful procedure.
Because 1.9.3.0 was buggy, I changed back to 1.9.2.4 by complete replacement of the root folder and database. So everything was set back, to the state like before the upgrade.
to 1.9.3.1 by manually inserting all new files, deleting old files, updating changed files.
I can confirm the video of naaraxi. Using Onestepcheckout the mistake also appears there, when you use the " + " increase button to exceed the stock value.
This "bug" was introduced in Magento CE 1.9.3.0 by the following modification in app/code/core/Mage/Sales/Model/Quote/Address/Total/Subtotal.php:
$item->setPrice($finalPrice) ->setBaseOriginalPrice($finalPrice); $item->calcRowTotal(); - } else if (!$quoteItem->getParentItem()) { + } else if (!$quoteItem->getParentItem() && !$item->getHasError()) { $finalPrice = $product->getFinalPrice($quoteItem->getQty()); $item->setPrice($finalPrice) ->setBaseOriginalPrice($finalPrice);
Because of this the quote calculation isn't done correctly anymore. I don't find a reasonable notification for this in the CE 1.9.3.0 release notes.
I fixed this problem by rewriting this modification back to the CE 1.9.2.x behaviour.
<models> ... <sales> <rewrite> <quote_address_total_subtotal>Mypackage_Mymodule_Model_Sales_Quote_Address_Total_Subtotal</quote_address_total_subtotal> </rewrite> </sales> </models>
and Mypackage_Mymodule_Model_Sales_Quote_Address_Total_Subtotal
<?php class Mypackage_Mymodule_Model_Sales_Quote_Address_Total_Subtotal extends Mage_Sales_Model_Quote_Address_Total_Subtotal { /** * Address item initialization * * @param $item * @return bool */ protected function _initItem($address, $item) { ... } else if (!$quoteItem->getParentItem()) { $finalPrice = $product->getFinalPrice($quoteItem->getQty()); ... }
Yes, you are right. Finally someone found it. I am not sure why they have made this change in first place.
Thank you so much!!
Hi,
Many thanks for taking time to share a fix.
I am having same problem with Magento ver. 1.9.3.4, but the Subtotal.php looks a little different and I can not see where to put your Mypackage_Mymodule_Model_Sales_Quote_Address_Total_Subtotal edit.
I am more a user than a coder and so would appreciate very simple - copy and paste instructions for me to try this fix / or better still a full edit of each file to change?
Any help very much appreciated. Many thanks Psychosonicsid.