Reputation: 340
I am observing the strange situation of orders with subtotal and grand total of 0, but with products in it. The products row have prices and no promo rules or discounts are being used. This happens sporadically and not only with one site. The version of Magento is 1.7.0.2. There are also no additional extensions installed. system.log and exception.log do not contain traces of errors that may have something to do with this problem.
At first i thought it may be because of server overload. I think this may have something to do with it but the last "0"-subtotal order happened when the server was not loaded at all.
Any ideas? Thanks!
Upvotes: 4
Views: 6363
Reputation: 31
I 've had the same problem with you guys and it was really annoying because I could not reproduce it and could not find a proper solution. I started to believe that it was just another Magento bug caused by some bad timing in database operations.
Anthony's post really helped me and guide me to find a practical fix.
So here it is. Indeed the error is caused by the trigger recollect flag that is set in markQuotesRecollect (for instance when a product is saved) and causes all active quotes to recollect their totals.
I had to spent a lot of hours in debugging IWD OnepageCheckout code to understand that in Geo.php saveBilling function creates a new shipping address by cloning the billing address (in case shipping is same as billing) and passes (almost) all data from billing address to the shipping address which later on is saved (through the parent quote save). This way cached_items_* data are set and when Geo.php saves payment even if you intentionally set quote to recollect totals (i.e by setting collected flag to false) shipping totals are not calculated correctly.
Eventually I had to add this lines of code in saveBilling method after line that writes:
$ship->addData($bill->getData());)
$ship->setSameAsBilling(1)->setShippingMethod($ship_method)->setCollectShippingRates(true);
$ship->unsetData('cached_items_nominal');
$ship->unsetData('cached_items_nonnominal');
$ship->unsetData('cached_items_all');
So far (after 10 days and around 1000 orders) had no random zero total orders.
Hope this helps you all
Kind Regards
Lefteris
Upvotes: 3
Reputation: 3218
I have had the same problem. And I have done some researches here. I used IWD onepagecheckout module. And the issue was inside this module.
Lets consider situation. You are doing smth in adminpanel or cron is doing some tasks this products or you could apply some catalog rules. In any kind of these actions will be called event catalog_product_status_update or catalog_product_save_after.
So every time you're changing smth in products all current quotes will be updates by events.
ok, here you'll ask me - what does it mean?
It means that each quote changes the field trigger_recollect in sales_flat_quote table. You can find it here app/code/core/Mage/Sales/Model/Resource/Quote.php::[markQuotesRecollectOnCatalogRules and markQuotesRecollect methods] to get more in details.
The trigger_recollect field is a trigger/signal to recollect whole quote total sums. You can find this step here app/code/Mage/Sales/Model/Quote.php::_afterLoad.
protected function _afterLoad()
{
// collect totals and save me, if required
if (1 == $this->getData('trigger_recollect')) {
$this->collectTotals()->save();
}
return parent::_afterLoad();
}
And accurate at this moment all current quote total sums became 0. The follow step is to get address collection and for some reason we have not product items it the address object now. Magento cannot recollect correct here. But it occur only when you or system are doing smth with a products and at the same time customer is pressing the button "send order". Why - I do not know yet. By the issue was occurred and catched.
Upvotes: 1
Reputation: 5211
Zero Subtotal Checkout
Using this
System > Configuration > Payment Methods > Zero Subtotal Checkout
Upvotes: -2
Reputation: 162
Just check in the Configuration->Advanced->advanced->Disabled Module Outputs Mage_Tax option is enabled or not.
Upvotes: -2