php - How to delete all shopping cart items of all customers in Magento? -


I want to remove all shopping cart items (added products in the cart) from all Magento customers.

How can I do this?

In detail : -

Suppose, I have 10 registered customers in my shop. The item (product) may be added to the car. I want to clear all items added to the cart for all 10 registered customers.

My first guess would be something like this,

  $ items = mage :: getResourceModel ('Sales / Quote_tam_collections'); Forex Currency ($ item $ item) {$ item- & gt; Remove (); }   

The cart item is stored as part of the 'quote'. The look may slow down among all these, doing so is fast in SQL, but not secure.

  TRUNCATE `sales_flat_quote_item`;    

Comments

Popular posts from this blog

qt - switch/case statement in C++ with a QString type -

python - sqlite3.OperationalError: near "REFERENCES": syntax error - foreign key creating -

Python's equivalent for Ruby's define_method? -