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