ConohaVpsを使ってみる【初めてのVPS】

Conohaにて、初めてのVPSに挑戦。メモ的な備考録です。

【ECCUBE2.13】送料無料の商品を設定する

送料無料商品を設定。
カート内の商品が全て送料無料対象であれば、送料無料。
送料無料対象外の商品を含む場合、通常の送料計算。

■変更
define(‘OPTION_PRODUCT_DELIV_FEE’, 1);
※送料無料の商品は、商品送料に0を指定。

■修正
data/class/SC_CartSession.php

        // 商品ごとの送料を加算
        $isPriceOverride = true;
        if (OPTION_PRODUCT_DELIV_FEE == 1) {
            $cartItems = $this->getCartList($productTypeId);
            foreach ($cartItems as $arrItem) {
                if ($arrItem['productsClass']['deliv_fee'] != '0') {
                    $isPriceOverride = false;
                }
                //echo $arrItem['productsClass']['deliv_fee'];
                $results['deliv_fee'] += $arrItem['productsClass']['deliv_fee'] * $arrItem['quantity'];
            }
        }
        // 配送業者の送料を加算
        if (!$isPriceOverride){
            if (OPTION_DELIV_FEE == 1
                && !SC_Utils_Ex::isBlank($deliv_pref)
                && !SC_Utils_Ex::isBlank($deliv_id)) {
                $results['deliv_fee'] += SC_Helper_Delivery_Ex::getDelivFee($deliv_pref, $deliv_id);
            }
        } else {
            $results['deliv_fee'] = 0;
        }