• プラグイン一覧
    - 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 Wishlist お気に入りリスト > 関数 > Rest::declareRoutes
レファレンス
バージョン
3.1.6
絞り込み:
目的から探す
お気に入りデータを取得 お気に入りページのHTMLを取得 スナックバーアラート

目次

  • パラメータ
  • 戻り値
  • ソース
  • 関連アイテム
    • 使用するアイテム

フック

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

ファンクション

  • データ取得
  • ユーティリティー
  • 条件判断
  • 表示系

関数

Rest::declareRoutes( WCEXWL\Aivec\WordPress\Routing\WordPressRouteCollector $r )

Declares routes

パラメータ #パラメータ

$r

(WCEXWL\Aivec\WordPress\Routing\WordPressRouteCollector) (必須)


戻り値 #戻り値

Top ↑

(void)

ソース #ソース

Top ↑

ファイル: src/Routes/Rest.php

    public function declareRoutes(WordPressRouteCollector $r) {
        $r->addGroup('/v3', function (WordPressRouteCollector $r) {
            // REST handlers
            $item = new API\Item($this->master);
            $cart = new API\Cart($this->master);
            $wishlist = new API\Wishlist($this->master);
            $validation = new API\Validation($this->master);

            // route guards and middleware
            $isLoggedIn = [$validation, 'isLoggedIn'];
            $maybeClearCart = [$wishlist, 'maybeClearCart'];
            $beforeRouteEnter = [$this, 'beforeRouteEnter'];

            // REST routes
            $r->post('/item/addToWishlist', [$item, 'postToWishlist'], [$beforeRouteEnter]);
            $r->post('/cart/addToWishlist', [$cart, 'postToWishlistBySerial'], [$beforeRouteEnter]);
            $r->post('/cart/batchDelete', [$cart, 'batchDelete'], [$beforeRouteEnter]);
            $r->post('/wishlist/delete/{itemId}', [$wishlist, 'delete'], [$beforeRouteEnter, $isLoggedIn]);
            $r->post('/wishlist/batchDelete', [$wishlist, 'batchDelete'], [$beforeRouteEnter, $isLoggedIn]);
            $r->post('/wishlist/addToCart/{itemId}', [$wishlist, 'addToCart'], [$beforeRouteEnter, $isLoggedIn, $maybeClearCart]);
            $r->post('/wishlist/batchAddToCart', [$wishlist, 'batchAddToCart'], [$beforeRouteEnter, $isLoggedIn, $maybeClearCart]);
        });
    }

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


関連アイテム #関連アイテム

Top ↑

使用するアイテム #使用するアイテム

使用するアイテム
説明
src/API/Item.php: Item::__construct() Sets up Item
src/API/Cart.php: Cart::__construct() Sets up Cart
src/API/Wishlist.php: Wishlist::__construct() Sets up Wishlist
src/API/Validation.php: Validation::__construct() Sets up Validation

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

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

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

© 2025 Aivec llc All Rights Reserved.