PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Thursday, November 10, 2022

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

 November 10, 2022     magento, magento-1.7, shopping-cart     No comments   

Issue

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?

I know that this is probably set somewhere in the quote, but I can't find it for the life of me.

I've done some Googling, but like so many Magento questions I'm left empty handed. Thanks!


Solution

As you probably know the setting is located here:

Admin => system => Configuration => Sales => Checkout => Quote Lifetime (days)

This will add the setting to the database (core_config_data table) with path:

checkout/cart/delete_quote_after

This path is used in the code on:

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

So when someone is adding something to a cart it will be updated. When a customer logs in and his cart is there it will be updated. When a cart is not updated for the last 30 days. It will be removed.

Extra information:

In case you wonder when this code is used, It is used by the cronjob of magento.

check: App/code/core/Mage/Sales/etc/config.xml line 1732

<crontab>
    <jobs>
        <sales_clean_quotes>
            <schedule>
                <cron_expr>0 0 * * *</cron_expr>
            </schedule>
            <run>
                <model>sales/observer::cleanExpiredQuotes</model>
            </run>
        </sales_clean_quotes>

Hope this helps.



Answered By - khoekman
Answer Checked By - Robin (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

1,206,491

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © 2025 PHPFixing