本文整理汇总了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");
}