Magento Asked by Fra on January 22, 2021
I’m facing this strange issue on add to cart action:
sometime after I checkout (with a registered customer) correctly my order, if I try to purchase another item I got the following error:
Call to a member function setFinalPrice() on a non-object in app/code/core/Mage/Sales/Model/Quote/Item/Abstract.php on line 73
I have debugged the code and found out that the issue is created by some old quotes associated to my user that are still active and have not items associated with it.
If I check the problematic quote in the Db it has items_count = 0
any way Mage_Sales_Model_Resource_Quote_Item_Collection::_assignProducts()
method try to load an item using null as Id :
$product = $productCollection->getItemById($item->getProductId());
This trigger the above error.
Now the fast fix it to set to is_active = 0
in all these quote, something like:
UPDATE `sales_flat_quote` SET `is_active` = 0 WHERE `is_active` = 1 AND `items_count`= 0 and customer_id is not null and customer_id <> 0
Question
Anyway I would like to understand the following points:
is_active = 1
?Any suggestion is welcome
If it is throwing for all the customers then you can delete sales_flat_quote_item table. If this happens only for particular customer then do the following thing. In this case, all the quotes wont be deleted.
Example: SELECT quote_id FROM sales_flat_quote_address where customer_id=23423
Example: DELETE FROM sales_flat_quote_item WHERE quote_id=43535
Answered by TS Guhan on January 22, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP