Magento Forum

   
Saved Shopping Carts
 
nicolas46
Sr. Member
 
Total Posts:  210
Joined:  2008-04-09
Toulouse
 

I see in the “checkout” part of the feature list : “Saved Shopping Carts with configurable expiration time”

Does it mean that I can allow my customer to save his current shopping cart in his account ? if yes where can i enable this feature ?

 
Magento Community Magento Community
Magento Community
Magento Community
 
adimagento
Administrator
 
Avatar
Total Posts:  626
Joined:  2007-08-29
Los Angeles, CA
 

This feature is built in. The administrator of the site can set how long they would like to keep items in the users shopping carts before they expire.

 
Magento Community Magento Community
Magento Community
Magento Community
 
bmartus
Sr. Member
 
Total Posts:  128
Joined:  2008-05-22
Greenville, TX
 

I believe in the admin area its System -> Configuration.  And then under Sales on the left, click ‘Checkout’.  In there, you have ‘Quote Lifetime (days)’ option.

 
Magento Community Magento Community
Magento Community
Magento Community
 
nicolas46
Sr. Member
 
Total Posts:  210
Joined:  2008-04-09
Toulouse
 

Thanks for the anwser adimagento and bmartus

 
Magento Community Magento Community
Magento Community
Magento Community
 
eiocreative
Jr. Member
 
Total Posts:  21
Joined:  2009-01-24
 

This doesn’t work, regardless what is entered the carts are always kept! It’s very annoying!!

 
Magento Community Magento Community
Magento Community
Magento Community
 
chiefair
Mentor
 
Avatar
Total Posts:  1839
Joined:  2009-06-04
 

Only inactive (completed) quotes are deleted by Quote Lifetime cron job. Active quotes preserved as abandoned carts.

/app/code/core/Mage/Sales/Model/Observer.php

public function cleanExpiredQuotes($schedule)
    
{
        $lifetimes 
Mage::getConfig()->getStoresConfigByPath('checkout/cart/delete_quote_after');
        foreach (
$lifetimes as $storeId=>$lifetime{
            $lifetime 
*= 86400;

            
$quotes Mage::getModel('sales/quote')->getCollection();
            
/* @var $quotes Mage_Sales_Model_Mysql4_Quote_Collection */

            
$quotes->addFieldToFilter('store_id'$storeId);
            
$quotes->addFieldToFilter('updated_at', array('to'=>date("Y-m-d"time()-$lifetime)));
            
$quotes->addFieldToFilter('is_active'0); //Leave Active Quotes alone
            
$quotes->walk('delete');
        
}
        
return $this;
    
}

In one of those perverse Magento definitions, Quote Lifetime is only used for housekeeping in removal of inactive quotes (why you even keep inactive quotes after they’ve been sales ordered is something a Magento Programmer will have to answer to) and not to filter through the active quotes (saved shopping carts) over the desired period and declaring them defunct.

Active quotes remain forever as zombie saved carts. Who cares about a saved cart after a month or so? NBL that the customer is coming back after six months and so you’re left with an ever expanding bloat of tables in your sales_flat_quote table cluster.

The adventurous could convert this observer to cleaning out all quotes over Quote Lifetime by commenting the following line out of the filter:

// $quotes->addFieldToFilter('is_active', 0); //Leave Active Quotes alone

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top