本文整理汇总了PHP中CompareProduct::removeCustomerCompareProduct方法的典型用法代码示例。如果您正苦于以下问题:PHP CompareProduct::removeCustomerCompareProduct方法的具体用法?PHP CompareProduct::removeCustomerCompareProduct怎么用?PHP CompareProduct::removeCustomerCompareProduct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CompareProduct
的用法示例。
在下文中一共展示了CompareProduct::removeCustomerCompareProduct方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: preProcess
public function preProcess()
{
parent::preProcess();
//Add or remove product with Ajax
if (Tools::getValue('ajax') and Tools::getValue('id_product') and Tools::getValue('action')) {
if (Tools::getValue('action') == 'add') {
if (isset(self::$cookie->id_customer)) {
if (CompareProduct::getCustomerNumberProducts(self::$cookie->id_customer) < Configuration::get('PS_COMPARATOR_MAX_ITEM')) {
CompareProduct::addCustomerCompareProduct((int) self::$cookie->id_customer, (int) Tools::getValue('id_product'));
} else {
die('0');
}
} else {
if (isset(self::$cookie->id_guest) and CompareProduct::getGuestNumberProducts(self::$cookie->id_guest) < Configuration::get('PS_COMPARATOR_MAX_ITEM')) {
CompareProduct::addGuestCompareProduct((int) self::$cookie->id_guest, (int) Tools::getValue('id_product'));
} else {
die('0');
}
}
} elseif (Tools::getValue('action') == 'remove') {
if (isset(self::$cookie->id_customer)) {
CompareProduct::removeCustomerCompareProduct((int) self::$cookie->id_customer, (int) Tools::getValue('id_product'));
} elseif (isset(self::$cookie->id_guest)) {
CompareProduct::removeGuestCompareProduct((int) self::$cookie->id_guest, (int) Tools::getValue('id_product'));
} else {
die('0');
}
} else {
die('0');
}
die('1');
}
}