本文整理汇总了PHP中Products::RecalcSitePrices方法的典型用法代码示例。如果您正苦于以下问题:PHP Products::RecalcSitePrices方法的具体用法?PHP Products::RecalcSitePrices怎么用?PHP Products::RecalcSitePrices使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Products
的用法示例。
在下文中一共展示了Products::RecalcSitePrices方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: UpdateSinglePrice
public function UpdateSinglePrice($id_user, $single_price, $price = false)
{
$f['single_price'] = $single_price;
$this->db->StartTrans();
if (!$this->db->Update(_DB_PREFIX_ . 'supplier', $f, "id_user = " . $id_user)) {
$this->db->FailTrans();
return false;
}
unset($f);
if ($single_price == 1) {
$Suppliers = new Suppliers();
$Suppliers->SetFieldsById($id_user, 1);
$supplier = $Suppliers->fields;
$f['price_opt_otpusk'] = 'price_mopt_otpusk';
$f['price_opt_otpusk_usd'] = 'price_mopt_otpusk_usd';
$f['price_opt_recommend'] = 'price_mopt_otpusk*' . $supplier['koef_nazen_opt'];
if (!($succesUpdate = $this->db->UpdatePro(_DB_PREFIX_ . 'assortiment', $f, "id_supplier = " . $id_user))) {
$this->db->FailTrans();
return false;
}
}
$this->db->CompleteTrans();
if (isset($succesUpdate)) {
$res = $this->GetAssortimentProductIds($id_user);
$arr = array();
foreach ($res as $v) {
$arr[] = $v['id_product'];
}
$Products = new Products();
if (!$Products->RecalcSitePrices($arr)) {
return false;
}
}
return true;
}
示例2: Products
<?if(isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest'){
// header('Content-Type: text/javascript; charset=utf-8');
$Products = new Products();
if(isset($_POST['action'])){
switch($_POST['action']){
case "decline":
$Products->SetModerationStatus($_POST['id'], $_POST['status'], nl2br($_POST['comment']));
break;
case "accept":
$_POST['art'] = $Products->CheckArticle($Products->GetLastArticle());
$id = $Products->AcceptProductModeration($_POST);
$Products->UpdateProductCategories($id, $_POST['category'], 1);
$Products->RecalcSitePrices(array($id));
$Products->SetModerationStatus($_POST['id'], $_POST['status']);
break;
default:
break;
}
}
exit();
}?>