When does Magento consider a cart to be abandoned? Where's that time limit set?

后端 未结 3 2223
孤街浪徒
孤街浪徒 2020-12-14 09:48

If left to default settings, what circumstances would have to occur for Magento 1.7 to consider a cart abandoned? Where is the code that makes this determination located?

3条回答
  •  太阳男子
    2020-12-14 10:14

    In our e-commerce we've overridden the method cleanExpiredQuotes inside app/code/core/Mage/Sales/Model/Observer.php

    Our business rule looks like this:

    $quotes = Mage::getModel('sales/quote')->getCollection();     
    $quotes->addFieldToFilter('created_at', array('to'=>date("Y-m-d", time()-$lifetime)));
    
    $quotes->addFieldToFilter('is_active', 1);
    foreach ($this->getExpireQuotesAdditionalFilterFields() as $field => $condition) {
        $quotes->addFieldToFilter($field, $condition);
    }
    $quotes->walk('delete');
    

提交回复
热议问题