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

目次

  • ソース
  • 関数

フック

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

ファンクション

    クラス

    ItemSelection

    APIs for selecting a combo-set from the item page

    ソース #ソース

    ファイル: src/API/ItemSelection.php

    class ItemSelection
    {
        /**
         * Returns data of a combo-set selection (stock, price, etc.)
         *
         * @author Evan D Shaw <evandanielshaw@gmail.com>
         * @param int   $skuMetaId
         * @param array $groupIds
         * @return GenericError|array
         */
        public static function getSelection($skuMetaId, array $groupIds) {
            $comboset = API\ComboSet::getComboSetBySkuMetaId($skuMetaId);
            if ($comboset instanceof GenericError) {
                return $comboset;
            }
    
            $response = [];
            $response['instock'] = true;
    
            $groupmap = [];
            foreach ($groupIds as $groupId => $itemIds) {
                $combogroup = API\ComboGroup::getComboGroupById($groupId);
                $groupmap[$groupId]['group'] = $combogroup;
                if (empty($combogroup)) {
                    $response['instock'] = false;
                } else {
                    foreach ($itemIds as $itemId) {
                        $groupitem = API\GroupItem::getGroupItemById($itemId);
                        $groupmap[$groupId]['items'][$itemId] = $groupitem;
                        if (empty($groupitem)) {
                            $response['instock'] = false;
                        }
                    }
                }
            }
    
            $response['groupmap'] = $groupmap;
    
            return $response;
        }
    }
    

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


    関数 #関数

    Top ↑

    • getSelection — Returns data of a combo-set selection (stock, price, etc.)

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

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

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

    © 2025 Aivec llc All Rights Reserved.