合計金額に基本料金を追加する。
/data/class_extends/SC_CartSession_Ex.php
[PHP]
function calculate($productTypeId, &$objCustomer, $use_point = 0,
$deliv_pref = “”, $charge = 0, $discount = 0, $deliv_id = 0) {
$results = parent::calculate($productTypeId, $objCustomer, $use_point, $deliv_pref, $charge, $discount, $deliv_id);
$objDb = new SC_Helper_DB_Ex();
$col = SC_Utils_Ex::sfGetCommaList(array(“basic_fee”));
$arrRet = $objDb->sfGetBasisData(true, $col);
$results[‘basic_fee’] = $arrRet[“basic_fee”];
$results[‘payment_total’] += $results[‘basic_fee’];
return $results;
}
[/PHP]
追記(2011/11/17)
culculateではなくて、getAllProductsTotalメソッド内で行ったほうがよさそうということで、変更しました。
[PHP]
function calculate($productTypeId, &$objCustomer, $use_point = 0,
$deliv_pref = “”, $charge = 0, $discount = 0, $deliv_id = 0) {
$results = parent::calculate($productTypeId, $objCustomer, $use_point, $deliv_pref, $charge, $discount, $deliv_id);
$objDb = new SC_Helper_DB_Ex();
$col = SC_Utils_Ex::sfGetCommaList(array(“basic_fee”));
$arrRet = $objDb->sfGetBasisData(true, $col);
$results[‘basic_fee’] = $arrRet[“basic_fee”];
//$results[‘payment_total’] += $results[‘basic_fee’];
return $results;
}
function getAllProductsTotal($productTypeId) {
//省略
//基本料金を追加
$objDb = new SC_Helper_DB_Ex();
$col = SC_Utils_Ex::sfGetCommaList(array(“basic_fee”));
$arrRet = $objDb->sfGetBasisData(true, $col);
$total += $arrRet[“basic_fee”];
return $total;
}
[/PHP]