サポート » プラグイン » welcartにおいて、送料無料の条件が複数ある場合の処理

  • 下記サイトのwelcartにおいて、送料無料の条件が地域別に複数あります。
    http://xn--gckwa7lxc270ys3wd.com/%E3%81%8A%E8%B2%B7%E3%81%84%E7%89%A9%E3%82%AC%E3%82%A4%E3%83%89/
    下記コードをfunction.phpに加え、基本設定にて送料無料条件を6000円に設定しましたが、うまく動作しません。

    /*送料無料設定*/
    //北海道からの注文で6,000円以上購入の場合のみ送料を1080円にする
    add_filter(‘usces_filter_set_cart_fees_shipping_charge’, ‘my1_filter_set_cart_fees_shipping_charge’, 10, 3);
    function my1_filter_set_cart_fees_shipping_charge($shipping_charge, $cart, $entry){
    $myprefs = array(‘北海島’); //都道府県を指定
    if(in_array($entry[‘delivery’][‘pref’], $myprefs) and ($entry[‘order’][‘total_items_price’] >= 6000) ){ //購入金額を指定
    $shipping_charge = 1080; //金額を指定
    }
    return $shipping_charge;
    }

    //北海道からの注文で10,000円以上購入の場合のみ送料を432円にする
    add_filter(‘usces_filter_set_cart_fees_shipping_charge’, ‘my1_filter_set_cart_fees_shipping_charge’, 10, 3);
    function my1_filter_set_cart_fees_shipping_charge($shipping_charge, $cart, $entry){
    $myprefs = array(‘北海島’); //都道府県を指定
    if(in_array($entry[‘delivery’][‘pref’], $myprefs) and ($entry[‘order’][‘total_items_price’] >= 10000) ){ //購入金額を指定
    $shipping_charge = 432; //金額を指定
    }
    return $shipping_charge;
    }

    //北海道からの注文で15,000円以上購入の場合のみ送料を0円にする
    add_filter(‘usces_filter_set_cart_fees_shipping_charge’, ‘my1_filter_set_cart_fees_shipping_charge’, 10, 3);
    function my1_filter_set_cart_fees_shipping_charge($shipping_charge, $cart, $entry){
    $myprefs = array(‘北海島’); //都道府県を指定
    if(in_array($entry[‘delivery’][‘pref’], $myprefs) and ($entry[‘order’][‘total_items_price’] >= 15000) ){ //購入金額を指定
    $shipping_charge = 0; //金額を指定
    }
    return $shipping_charge;
    }

    //沖縄からの注文で6,000円以上購入の場合のみ送料を1080円にする
    add_filter(‘usces_filter_set_cart_fees_shipping_charge’, ‘my1_filter_set_cart_fees_shipping_charge’, 10, 3);
    function my1_filter_set_cart_fees_shipping_charge($shipping_charge, $cart, $entry){
    $myprefs = array(‘沖縄’); //都道府県を指定
    if(in_array($entry[‘delivery’][‘pref’], $myprefs) and ($entry[‘order’][‘total_items_price’] >= 6000) ){ //購入金額を指定
    $shipping_charge = 1080; //金額を指定
    }
    return $shipping_charge;
    }

    //沖縄からの注文で10,000円以上購入の場合のみ送料を432円にする
    add_filter(‘usces_filter_set_cart_fees_shipping_charge’, ‘my1_filter_set_cart_fees_shipping_charge’, 10, 3);
    function my1_filter_set_cart_fees_shipping_charge($shipping_charge, $cart, $entry){
    $myprefs = array(‘沖縄’); //都道府県を指定
    if(in_array($entry[‘delivery’][‘pref’], $myprefs) and ($entry[‘order’][‘total_items_price’] >= 10000) ){ //購入金額を指定
    $shipping_charge = 432; //金額を指定
    }
    return $shipping_charge;
    }

    //沖縄からの注文で15,000円以上購入の場合のみ送料を0円にする
    add_filter(‘usces_filter_set_cart_fees_shipping_charge’, ‘my1_filter_set_cart_fees_shipping_charge’, 10, 3);
    function my1_filter_set_cart_fees_shipping_charge($shipping_charge, $cart, $entry){
    $myprefs = array(‘沖縄’); //都道府県を指定
    if(in_array($entry[‘delivery’][‘pref’], $myprefs) and ($entry[‘order’][‘total_items_price’] >= 15000) ){ //購入金額を指定
    $shipping_charge = 0; //金額を指定
    }
    return $shipping_charge;
    }

    テーマは、welcartの」デフォルトテーマとwelcart basic、子テーマ(welcart basic child)、lecternを使用しており、デフォルトテーマのfunction.phpに上記コードを入れております。

    原因は、何でしょうか?

1件の返信を表示中 - 1 - 1件目 (全1件中)
  • function名が全部my1_filter_set_cart_fees_shipping_chargeなので、それぞれ名前を変えるか、あるいは全部を一つにまとめたらどうでしょう。

1件の返信を表示中 - 1 - 1件目 (全1件中)
  • トピック「welcartにおいて、送料無料の条件が複数ある場合の処理」には新たに返信することはできません。