本文整理匯總了PHP中WishList::addBoughtProduct方法的典型用法代碼示例。如果您正苦於以下問題:PHP WishList::addBoughtProduct方法的具體用法?PHP WishList::addBoughtProduct怎麽用?PHP WishList::addBoughtProduct使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類WishList
的用法示例。
在下文中一共展示了WishList::addBoughtProduct方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: dirname
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2012 PrestaShop SA
* @version Release: $Revision: 6844 $
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
require_once dirname(__FILE__) . '/../../config/config.inc.php';
require_once dirname(__FILE__) . '/../../init.php';
require_once dirname(__FILE__) . '/WishList.php';
$error = '';
// Instance of module class for translations
$module = new BlockWishList();
$token = Tools::getValue('token');
$id_product = (int) Tools::getValue('id_product');
$id_product_attribute = (int) Tools::getValue('id_product_attribute');
if (Configuration::get('PS_TOKEN_ENABLE') == 1 && strcmp(Tools::getToken(false), Tools::getValue('static_token'))) {
$error = $module->l('Invalid token', 'buywishlistproduct');
}
if (!strlen($error) && empty($token) === false && empty($id_product) === false) {
$wishlist = WishList::getByToken($token);
if ($wishlist !== false) {
WishList::addBoughtProduct($wishlist['id_wishlist'], $id_product, $id_product_attribute, $cart->id, 1);
}
} else {
$error = $module->l('You must log in', 'buywishlistproduct');
}
if (empty($error) === false) {
echo $error;
}