/** * Erases all carts and cart items that are older than CART_LIFE days and * have no customer_id assocaited with them. * * Called by legacySoapController when doing a document_flush(), * document_flush() is called by onsite when the user initiates a * "Reset Carts and Documents" from the Tools->eCommerce->Documents tab * * @return int The number of carts + items deleted by the * query */ public static function garbageCollect() { return ShoppingCart::eraseExpired(); }
/** * Erase carts that are over 30 days old, and don't have a customer_id * associated with them, then optimize the tables related to the shopping * cart experience. */ public function actionErasecarts() { $numErased = ShoppingCart::eraseExpired(); ShoppingCart::optimizeTables(); Yii::app()->user->setFlash('success', Yii::t('admin', '{qty} old carts and cart items removed. {time}', array('{qty}' => $numErased, '{time}' => date("d F, Y h:i:sa")))); $this->render("erasecarts"); }