本文整理匯總了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;
}