本文整理汇总了PHP中SpecificPrice::deleteByIdCart方法的典型用法代码示例。如果您正苦于以下问题:PHP SpecificPrice::deleteByIdCart方法的具体用法?PHP SpecificPrice::deleteByIdCart怎么用?PHP SpecificPrice::deleteByIdCart使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SpecificPrice
的用法示例。
在下文中一共展示了SpecificPrice::deleteByIdCart方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ajaxProcessUpdateProductPrice
public function ajaxProcessUpdateProductPrice()
{
if ($this->tabAccess['edit'] === '1') {
SpecificPrice::deleteByIdCart((int) $this->context->cart->id, (int) Tools::getValue('id_product'), (int) Tools::getValue('id_product_attribute'));
$specific_price = new SpecificPrice();
$specific_price->id_cart = (int) $this->context->cart->id;
$specific_price->id_shop = 0;
$specific_price->id_shop_group = 0;
$specific_price->id_currency = 0;
$specific_price->id_country = 0;
$specific_price->id_group = 0;
$specific_price->id_customer = (int) $this->context->customer->id;
$specific_price->id_product = (int) Tools::getValue('id_product');
$specific_price->id_product_attribute = (int) Tools::getValue('id_product_attribute');
$specific_price->price = (double) Tools::getValue('price');
$specific_price->from_quantity = 1;
$specific_price->reduction = 0;
$specific_price->reduction_type = 'amount';
$specific_price->from = '0000-00-00 00:00:00';
$specific_price->to = '0000-00-00 00:00:00';
$specific_price->add();
echo Tools::jsonEncode($this->ajaxReturnVars());
}
}
示例2: add
public function add($autodate = true, $null_values = true)
{
if (parent::add($autodate, $null_values)) {
return SpecificPrice::deleteByIdCart($this->id_cart);
}
return false;
}