[未解決] 送料個別課金の計算不具合

フォーラム バグ報告 [未解決] 送料個別課金の計算不具合

  • このトピックには1件の返信、2人の参加者があり、最後にnanbuにより13年、 7ヶ月前に更新されました。
2件の投稿を表示中 - 1 - 2件目 (全2件中)
  • 投稿者
    投稿
  • #49928
    hazeleye
    参加者

    いつもお世話になっております。

    以下の現象が出ております。

    Aという商品があります。こちらは送料0円です。

    Bという商品があります。こちらは送料800円です。

    さらにBには「送料個別課金」を設定しています。

    その上で、ユーザーがAとBの商品を同時にカートに入れると

    本来は800円だと思うのですが、1600円と表示され、。

    Bの「送料個別課金」を外すと通常通りの800円になります。

    ちなみにAを3つ、Bを2つにすると合計金額が2400円になっています。

    取り急ぎ、ご報告まで。

    #60214
    nanbu
    キーマスター

    ご報告ありがとうございます。

    症状を確認しました。

    配送設定で送料固定を設定していた場合におきる不具合でした。

    v0.7 で修正を反映させたいと思います。

    お急ぎでしたら、usc-e-shop/classesusceshop.class.php の関数 function getShippingCharge( $pref, $cart = array(), $entry = array() ) { 内の下記のコメントアウトしてある部分を削除してみてください。

    function getShippingCharge( $pref, $cart = array(), $entry = array() ) {
    if( empty($cart) )
    $cart = $this->cart->get_cart();
    if( empty($entry) )
    $entry = $this->cart->get_entry();

    $d_method_id = $entry['order']['delivery_method'];
    $d_method_index = $this->get_delivery_method_index($d_method_id);

    $fixed_charge_id = $this->options['delivery_method'][$d_method_index]['charge'];

    $individual_quant = 0;
    $total_quant = 0;
    $charges = array();

    foreach ( $cart as $rows ) {
    $s_charge_id = $this->getItemShippingCharge($rows['post_id']);
    $s_charge_index = $this->get_shipping_charge_index($s_charge_id);
    $charge = $this->options['shipping_charge'][$s_charge_index]['value'][$pref];
    if($this->getItemIndividualSCharge($rows['post_id'])){
    $individual_quant += $rows['quantity'];
    $individual_charge += $rows['quantity'] * $charge;
    }else{
    $charges[] = $charge;
    }
    $total_quant += $rows['quantity'];
    }

    // if( $fixed_charge_id >= 0 ){
    // $fix_charge_index = $this->get_shipping_charge_index($fixed_charge_id);
    // $fix_charge = $this->options['shipping_charge'][$fix_charge_index]['value'][$pref];
    // if( $total_quant > $individual_quant ){
    // $charge = $fix_charge + $fix_charge * $individual_quant;
    // }else{
    // $charge = $fix_charge * $individual_quant;
    // }
    //
    // }else{
    if( count($charges) > 0 ){
    rsort($charges);
    $max_charge = $charges[0];
    $charge = $max_charge + $individual_charge;
    }else{
    $charge = $individual_charge;
    }

    // }

    return $charge;

    }

2件の投稿を表示中 - 1 - 2件目 (全2件中)
  • このトピックに返信するにはログインが必要です。