yuh様
お世話になります。
お教えいただきありがとうございます。
今、コードを入れ直してみたのですが、送料が反映されないようです。
SC_Helper_Delivery_Ex.phpにお教えいただいたコードを入れたところ、
追加した最初の行
public static function getDelivFee($pref_id, $deliv_id = 0,$total = 0)
で[シンタックスエラー]が発生したと表示されました。
これが何か影響があるのでしょうか?
重ね重ねで本当に申し訳ありません。
どうかお教えいただけますと助かります。
◆SC_Helper_Delivery_Ex.php
<?php
/*
* This file is part of EC-CUBE
*
* Copyright(c) 2000-2014 LOCKON CO.,LTD. All Rights Reserved.
*
* http://www.lockon.co.jp/
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
require_once CLASS_REALDIR . 'helper/SC_Helper_Delivery.php';
/**
* 配送方法を管理するヘルパークラス(拡張).
*
* LC_Helper_Delivery をカスタマイズする場合はこのクラスを編集する.
*
* @package Helper
* @author pineray
* @version $Id:$
*/ class SC_Helper_Delivery_Ex extends SC_Helper_Delivery
{
//put your code here
}
public static function getDelivFee($pref_id, $deliv_id = 0,$total = 0)
{
$objQuery =& SC_Query_Ex::getSingletonInstance();
if (!is_array($pref_id))
{ $pref_id = array($pref_id);
}
$sql = <<< __EOS__
SELECT T1.fee AS fee FROM dtb_delivfee T1
JOIN dtb_deliv T2
ON T1.deliv_id = T2.deliv_id
WHERE T1.pref = ?
AND T1.deliv_id = ?
AND T2.del_flg = 0
__EOS__;
$result = 0;
//------------------------------------------------------------------------
foreach ($pref_id as $pref) {
if(in_array($pref,array(1,47)) AND $total >= 5400 ){
$flag = false;
}elseif(!in_array($pref,array(1,47)) AND $total >= 4320 ){
$flag = false;
}else{
$flag = true; }
if($flag === true){
$result += $objQuery->getOne($sql, array($pref, $deliv_id));
}
}
//------------------------------------------------------------------------
return $result;
}