本文整理匯總了PHP中ShoppingCart::eraseExpired方法的典型用法代碼示例。如果您正苦於以下問題:PHP ShoppingCart::eraseExpired方法的具體用法?PHP ShoppingCart::eraseExpired怎麽用?PHP ShoppingCart::eraseExpired使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ShoppingCart
的用法示例。
在下文中一共展示了ShoppingCart::eraseExpired方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: garbageCollect
/**
* 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();
}
示例2: actionErasecarts
/**
* 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");
}