inf61 様
少し長いですが、以下のようにやってみましょう。
僕のほうで動作確認できています。
※また、念のため、改造前にバックアップか、改造する部分をコメントアウトしてコピーをとってください。※すでに改造してある部分は、必要ありません。
LC_Page_Shopping_Confirm.php
引用:
// 合計金額
//$this->tpl_total_inctax[$this->cartKey] = $objCartSess->getAllProductsTotal($this->cartKey);
// 合計金額
$CartProductsTotalPrice = $objCartSess->getAllProductsTotal($this->cartKey);
// 一時受注テーブルの読込
$arrOrderTemp = $objPurchase->getOrderTemp($this->tpl_uniqid); //111行目から移動
//配送先送料判定
switch ($arrOrderTemp['order_pref']) {
case 1: // 北海道
if ($CartProductsTotalPrice <= 4999) {
$hoge = 1470;
break;
} else if ($CartProductsTotalPrice <= 9999) {
$hoge = 630;
break;
} else {
$hoge = 420;
break;
}
case 2: // 青森県
case 3: // 岩手県
case 4: // 宮城県
case 5: // 秋田県
case 6: // 山形県
case 7: // 福島県
if ($CartProductsTotalPrice <= 4999) {
$hoge = 1100;
break;
} else if ($CartProductsTotalPrice <= 9999) {
$hoge = 420;
break;
} else {
$hoge = 210;
break;
}
case 8: // 茨城県
case 9: // 栃木県
case 10: // 群馬県
case 11: // 埼玉県
case 12: // 千葉県
case 13: // 東京都
case 14: // 神奈川県
case 15; // 新潟県
case 19; // 山梨県
case 20: // 長野県
if ($CartProductsTotalPrice <= 4999) {
$hoge = 840;
break;
} else if ($CartProductsTotalPrice <= 9999) {
$hoge = 420;
break;
} else {
$hoge = 210;
break;
}
/**
一時的に削除します。
**/
default: // 沖縄県
if ($CartProductsTotalPrice <= 4999){
$hoge = 1050;
break;
} else if ($CartProductsTotalPrice <= 9999){
$hoge = 630;
break;
} else {
$hoge = 420;
break;
}
}
$this->tpl_total_inctax[$this->cartKey] = $CartProductsTotalPrice;
// 税額
$this->tpl_total_tax[$this->cartKey] = $objCartSess->getAllProductsTax($this->cartKey);
// ポイント合計
$this->tpl_total_point[$this->cartKey] = $objCartSess->getAllProductsPoint($this->cartKey);
// カート集計を元に最終計算
$arrCalcResults = $objCartSess->calculate($this->cartKey, $objCustomer,
$arrOrderTemp['use_point'],
$objPurchase->getShippingPref($this->is_multiple),
$arrOrderTemp['charge'],
$arrOrderTemp['discount'],$hoge);
// カート集計を元に最終計算
/*$arrCalcResults = $objCartSess->calculate($this->cartKey, $objCustomer,
$arrOrderTemp['use_point'],
$objPurchase->getShippingPref($this->is_multiple),
$arrOrderTemp['charge'],
$arrOrderTemp['discount'],
$arrOrderTemp['deliv_id']);*/
SC_CartSession.php
引用:
/*function calculate($productTypeId, &$objCustomer, $use_point = 0,
$deliv_pref = "", $charge = 0, $discount = 0, $deliv_id = 0) {*/
function calculate($productTypeId, &$objCustomer, $use_point = 0,
$deliv_pref = "", $charge = 0, $discount = 0, $hoge) {
$objDb = new SC_Helper_DB_Ex();
$total_point = $this->getAllProductsPoint($productTypeId);
$results['tax'] = $this->getAllProductsTax($productTypeId);
$results['subtotal'] = $this->getAllProductsTotal($productTypeId);
$results['deliv_fee'] = 0;
var_dump($hoge);
// 商品ごとの送料を加算
if (OPTION_PRODUCT_DELIV_FEE == 1) {
$cartItems = $this->getCartList($productTypeId);
foreach ($cartItems as $item) {
$results['deliv_fee'] += $item['productsClass']['deliv_fee'] * $item['quantity'];
}
}
// 配送業者の送料を加算
/*if (OPTION_DELIV_FEE == 1
&& !SC_Utils_Ex::isBlank($deliv_pref)
&& !SC_Utils_Ex::isBlank($deliv_id)) {
$results['deliv_fee'] += $objDb->sfGetDelivFee($deliv_pref, $deliv_id);
}*/
$results['deliv_fee'] = $hoge;
$hoge は任意の変数に変更してください。
// 配送業者の送料を加算 〜〜 はコメントアウトして取ります。これがあると、管理画面で登録してある送料が反映されてしまうので。
たぶん、仰っていったのはこれであっていると思うのですが、ささっと読んでしまったので、違ったら言ってください。
--------------------------------
追記:解説が必要であれば、言ってください。
時間が空いた時に書き込んでおきます。
----------------
何分知識が浅いですが・・・
出来得る限り協力したいと思っています