Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Deletion of old quotes cronjob
 
HelgeB
Jr. Member
 
Total Posts:  14
Joined:  2012-01-14
 

Hi community,

in Magento there is a cronjob for deleting old quotes after a configurable period of time (cleanExpiredQuotes in Sales/Model/Observer.php). Without doubt a helpful feature.
Anyway, the implementation isn’t quite correct in my opinion, because it deletes all inactive quotes from the corresponding database tables and most of inactive quotes are linked to orders (saving an order inactivates the quote).

Well most of the information from the quote is copied to the order tables, but there is one table sales_flat_quote_item_option containing beside others the location of files uploaded by the customer for example for a simple product with custom options. This information is only available accessing the order’s quote.

When the quote is deleted, there is no link from the ordered item to it’s file uploaded by the customer anymore, and the URLs for downloading the files (/index.php/sales/download/downloadCustomOption/id/XXXX/key/YYYYYYYY/) are showing the 404 page, because the downloadCustomOptionAction tries to access a non-existing quote.

On the other hand any cart abandoned by customers (this are active quotes) is kept in the database forever.
Therefore my question: Shouldn’t this cronjob delete active quotes after a given period of time?

Any thoughts are appreciated.

Thanks & regards,
H.

 
Magento Community Magento Community
Magento Community
Magento Community
 
HelgeB
Jr. Member
 
Total Posts:  14
Joined:  2012-01-14
 

really, no thoughts on this topic?  surprised

 
Magento Community Magento Community
Magento Community
Magento Community
 
Munich
Jr. Member
 
Total Posts:  9
Joined:  2010-10-27
 

You are right there is a bug. (Tested on 1.5.1 - and on 1.7. it still loads from sales/quote_item_option model)

Current situation:

1.) sales/download/downloadCustomOption loads sales/quote_item_option with it’s option_id and retrieves media file from sales_flat_quote_item_options table
2.) Since the quote is converted to an order it is set to is_active=0
3.) Inactive quotes get deleted after “Shopping Cart"->"Quote Lifetime”

And there is the mess: You can’t download the custom options mediafile anymore.

Actually the media path is also saved in sales_flat_order_item->product_options. This should be the source for the download URL.

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