-
-
Notifications
You must be signed in to change notification settings - Fork 436
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Old inactive quotes are now actually purged from the database #1489
Conversation
I was thinking about this issue last week. Our I believe that this was the cause for the dreaded I'm still in the process of investigating this issue and mitigation and reducing the table would have a very positive effect. |
Yikes. If I just checked the value I have. It's 0. That would be very, very bad if that ever ran on production for me. |
what are we doing on this @FredericMartinez? |
@fballiano I removed the filter, old active non-active quotes are now purged. |
A check is needed no? For example, if empty, keep is_active filter? |
We cannot merge this until this is addressed: all active quotes will be deleted if A suggestion: public function cleanExpiredQuotes($schedule)
{
Mage::dispatchEvent('clear_expired_quotes_before', array('sales_observer' => $this));
$lifetimes = Mage::getConfig()->getStoresConfigByPath('checkout/cart/delete_quote_after');
foreach ($lifetimes as $storeId => $day) {
$day = (int) $day;
$lifetime = 86400 * $day;
/** @var Mage_Sales_Model_Mysql4_Quote_Collection $quotes */
$quotes = Mage::getModel('sales/quote')->getCollection();
$quotes->addFieldToFilter('store_id', $storeId);
$quotes->addFieldToFilter('updated_at', array('to'=>date("Y-m-d", time()-$lifetime)));
if ($day === 0) {
$quotes->addFieldToFilter('is_active', 0);
}
// ... Also add a note in the backend, something like: Please suggest better English. |
With the comment, I also suggest to add in system.xml: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we've to take a look at what @kiatng is saying
I updated and merged with Github web editor. |
I've rebased it and I think it's ready to be merged |
Ping @kiatng and @FredericMartinez for latest PR update 😸. |
Description (*)
Since the beggining of Magento, only quotes converted to orders can be deleted by
sales_clean_quotes
cron because quote collection filter onis_active=0
Show quotes group by year
Contribution checklist (*)