• プラグイン一覧
    - WCEX Item Combo Set
    - WCEX Amazon Pay
    - WCEX Wishlist お気に入りリスト
  • リリース情報
  • お役立ちコラム
  • お問い合わせ
  • サポート
    • よくある質問
      • WCEX Amazon Pay
      • WCEX Wishlist お気に入りリスト
      • wcex-item-combo-set
    • リファレンス
      • WCEX Amazon Pay
      • WCEX Wishlist お気に入りリスト
      • wcex-item-combo-set
新規会員登録
ログイン
新規会員登録
ログイン
カート
  • プラグイン一覧
    • - WCEX Item Combo Set
    • - WCEX Amazon Pay
    • - WCEX Wishlist お気に入りリスト
  • リリース情報
  • お役立ちコラム
  • サポート
    • - よくある質問
      • - WCEX Amazon Pay
      • - WCEX Wishlist お気に入りリスト
      • - wcex-item-combo-set
    • - リファレンス
      • - WCEX Amazon Pay
      • - WCEX Wishlist お気に入りリスト
      • - wcex-item-combo-set
  • お問い合わせ
Aivec APPs > WCEX Amazon Pay > クラス > Middleware
レファレンス
バージョン
2.6.4
絞り込み:

目次

  • ソース
  • 関数

フック

  • アクション
  • フィルター

ファンクション

    クラス

    Middleware

    Middleware functions for Welcart routes

    ソース #ソース

    ファイル: src/Routing/Middleware.php

    class Middleware
    {
        /**
         * Saves order acting data with `amazonCheckoutSessionId`
         *
         * @author Evan D Shaw <evandanielshaw@gmail.com>
         * @return Closure&#Function#5abe872d
         */
        public function saveOrderActingData() {
            return function ($res, $args) {
                if ($res instanceof GenericError) {
                    return $res;
                }
                // save order data preprocessing
                usces_save_order_acting_data($args['id']);
                return $res;
            };
        }
    
        /**
         * Updates `$_SESSION['usces_entry']`
         *
         * @author Evan D Shaw <evandanielshaw@gmail.com>
         * @return Closure&#Function#bea97561
         */
        public function updateWelcartEntries() {
            return function () {
                (new API\WelcartEntries())->setEntry();
            };
        }
    
        /**
         * Updates price data
         *
         * @author Evan D Shaw <evandanielshaw@gmail.com>
         * @return Closure&#Function#66087043
         */
        public function updateFees() {
            return function () {
                (new API\Fees())->setFees();
            };
        }
    
        /**
         * Sets order condition if not yet set. Also sets reserve pre-order ID.
         *
         * @author Evan D Shaw <evandanielshaw@gmail.com>
         * @return Closure&#Function#90bb46d6
         */
        public function setOrderConditions() {
            return function () {
                global $usces;
    
                if (!$usces->cart->is_order_condition()) {
                    $order_conditions = $usces->get_condition();
                    $usces->cart->set_order_condition($order_conditions);
                }
                $usces->set_reserve_pre_order_id();
            };
        }
    
        /**
         * Sets `$_SESSION['usces_member']['point']` with member points if member is logged in
         * and Welcart point system is turned on
         *
         * @author Evan D Shaw <evandanielshaw@gmail.com>
         * @return Closure&#Function#54f1ed46
         */
        public function setMemberPoints() {
            return function () {
                global $usces, $wpdb;
    
                if (usces_is_member_system() && usces_is_member_system_point() && $usces->is_member_logged_in()) {
                    $member_table = $wpdb->prefix . 'usces_member';
                    $query = $wpdb->prepare(
                        "SELECT mem_point
                        FROM $member_table
                        WHERE ID = %d",
                        $_SESSION['usces_member']['ID']
                    );
                    $mem_point = $wpdb->get_var($query);
                    $_SESSION['usces_member']['point'] = $mem_point;
                }
            };
        }
    }
    

    ソースを伸ばす ソースを縮める


    関数 #関数

    Top ↑

    • saveOrderActingData — Saves order acting data with `amazonCheckoutSessionId`
    • setMemberPoints — Sets `$_SESSION['usces_member']['point']` with member points if member is logged in and Welcart point system is turned on
    • setOrderConditions — Sets order condition if not yet set. Also sets reserve pre-order ID.
    • updateFees — Updates price data
    • updateWelcartEntries — Updates `$_SESSION['usces_entry']`

    • 新規会員登録
    • ログイン
      • プラグイン一覧
      • 会社概要
      • リリース情報
      • よくある質問
      • お役立ちコラム
      • お問い合わせ
      • 個人情報保護方針
      • 特定商取引法に基づく表記
      • 情報セキュリティ基本方針
      • 利用規約

    アイベック合同会社は「Welcart」「Amazon Pay」の公式パートナーです。

    ※Amazon、Amazon.co.jp、Amazon Payおよびそれらのロゴは、Amazon.com,inc.またはその関連会社の商標です。
    ※LINE Pay、およびLINE Pay 提携サービスのロゴは、法律上保護を受ける商標です。

    © 2025 Aivec llc All Rights Reserved.