• プラグイン一覧
    - 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-item-combo-set > クラス > Master
レファレンス
バージョン
1.0.6
絞り込み:

目次

  • ソース
  • 関数

フック

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

ファンクション

    クラス

    Master

    Top-level entry class

    ソース #ソース

    ファイル: src/Master.php

    class Master
    {
        const PLUGIN_NAMESPACE = 'wcexics';
        const REACT_DOM_NODE = self::PLUGIN_NAMESPACE . '_react_app';
        const SNACKBAR_DOM_NODE = self::PLUGIN_NAMESPACE . '_react_snackbar';
    
        /**
         * REST routes object
         *
         * @var Routes
         */
        public $routes;
    
        /**
         * Initializes plugin
         *
         * @author Evan D Shaw <evandanielshaw@gmail.com>
         * @return void
         */
        public function init() {
            Components\Snackbar\Snackbar::init();
            Pages\ItemPage\ItemPage::init();
            Pages\CartPages::init();
            Pages\MemberPage\MemberPage::init();
            API\PurchaseSanityChecks::init();
            (new API\Cart())->init();
            API\Checkout::init();
            API\FileDownloads::init();
            Wishlist::init();
            Routes::declareWelcartRoutes();
            if (is_admin()) {
                (new Admin\ItemListCSV())->init();
                Admin\OrderListCSV::init();
                Admin\OrderEdit::init();
                Admin\ItemEdit::init();
                Admin\Pages\SettingsPage::init();
                Admin\Pages\OrderEditPage::init();
            }
            add_action('init', function () {
                $this->routes = new Routes();
                $this->routes->dispatcher->listen();
    
                if (!is_admin()) {
                    return;
                }
    
                (new Admin\Pages\Item\Item($this))->init();
            }, 11);
    
            $id = 'AICS001';
            $cptmc = new CptmClient(
                $id,
                WCEXICS_VERSION,
                WCEXICS_PLUGIN_FILE,
                "https://api.aivec.co.jp/cptmp/v1/getProvidersList/{$id}"
            );
            $cptmc->init();
        }
    
        /**
         * Returns the error store
         *
         * @author Evan D Shaw <evandanielshaw@gmail.com>
         * @return ErrorStore
         */
        public static function getErrorStore() {
            $estore = new ErrorStore();
            $estore->populate();
            return $estore;
        }
    
        /**
         * Runs on plugin activation hook
         *
         * @author Evan D Shaw <evandanielshaw@gmail.com>
         * @return void
         */
        public function activate() {
            Schema::addTables();
            // migrations
            Schema::v101();
            Schema::v110();
        }
    
        /**
         * Returns variables to be injected into JS scripts
         *
         * @author Evan D Shaw <evandanielshaw@gmail.com>
         * @return array
         */
        public function getScriptInjectionVariables() {
            return array_merge(
                $this->routes->getScriptInjectionVariables(),
                self::getErrorStore()->getScriptInjectionVariables(),
                [
                    'pluginNamespace' => self::PLUGIN_NAMESPACE,
                    'snackbarDomNode' => self::SNACKBAR_DOM_NODE,
                    'reactDomNode' => self::REACT_DOM_NODE,
                ]
            );
        }
    }
    

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


    関数 #関数

    Top ↑

    • activate — Runs on plugin activation hook
    • getErrorStore — Returns the error store
    • getScriptInjectionVariables — Returns variables to be injected into JS scripts
    • init — Initializes plugin

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

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

    ※Amazon、Amazon.co.jp、Amazon Payおよびそれらのロゴは、Amazon.com,inc.またはその関連会社の商標です。

    © 2025 Aivec llc All Rights Reserved.