本文整理汇总了PHP中WishList::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP WishList::delete方法的具体用法?PHP WishList::delete怎么用?PHP WishList::delete使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WishList
的用法示例。
在下文中一共展示了WishList::delete方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: delete_list
/**
* @param SS_HTTPRequest $req
* @return bool|SS_HTTPResponse
*/
public function delete_list(SS_HTTPRequest $req)
{
if (!SecurityToken::inst()->checkRequest($req)) {
$this->httpError(403);
}
$this->wishList->removeAllBuyables();
$this->wishList->delete();
WishList::set_current(null);
$this->wishList = WishList::current();
$this->extend('updateDeleteListResponse', $req, $response);
return $response ? $response : $this->redirectBack();
}
示例2: dirname
$errors[] = Tools::displayError('invalid token');
}
if (!sizeof($errors)) {
$name = Tools::getValue('name');
$wishlist = new WishList();
$wishlist->name = $name;
$wishlist->id_customer = $cookie->id_customer;
list($us, $s) = explode(' ', microtime());
srand($s * $us);
$wishlist->token = strtoupper(substr(sha1(uniqid(rand(), true) . _COOKIE_KEY_ . $cookie->id_customer), 0, 16));
$wishlist->add();
}
} else {
if ($add) {
WishList::addCardToWishlist(intval($cookie->id_customer), intval(Tools::getValue('id_wishlist')), intval($cookie->id_lang));
} else {
if ($delete and empty($id_wishlist) === false) {
$wishlist = new WishList(intval($id_wishlist));
$wishlist->delete();
}
}
}
$smarty->assign('wishlists', WishList::getByIdCustomer(intval($cookie->id_customer)));
$smarty->assign('nbProducts', WishList::getInfosByIdCustomer(intval($cookie->id_customer)));
} else {
$errors[] = Tools::displayError('You need to be logged to manage your wishlist');
}
$smarty->assign('id_customer', intval($cookie->id_customer));
$smarty->assign('errors', $errors);
$smarty->display(dirname(__FILE__) . '/mywishlist.tpl');
include dirname(__FILE__) . '/../../footer.php';