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

目次

  • ソース
  • 関数

フック

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

ファンクション

    クラス

    GroupItem

    Represents a combo-set group item

    ソース #ソース

    ファイル: src/Types/GroupItem.php

    class GroupItem extends SkuItem implements JsonSerializable
    {
        /**
         * Group item ID
         *
         * @var int
         */
        private $id;
    
        /**
         * Group ID
         *
         * @var int
         */
        private $groupId;
    
        /**
         * Group item label
         *
         * @var string
         */
        private $itemLabel;
    
        /**
         * Quantity of the group item
         *
         * @var int
         */
        private $itemQuantity;
    
        /**
         * The amount added (or subtracted if the value is negative) to the combo item's
         * base SKU price
         *
         * Used to adjust the total price appropriately
         *
         * @var int
         */
        private $priceModifier = 0;
    
        /**
         * Position in the item group
         *
         * Lower means higher priority
         *
         * @var int
         */
        private $position;
    
        /**
         * Created at UTC `DATETIME` string
         *
         * @var string
         */
        private $createdAt;
    
        /**
         * Updated at UTC `DATETIME` string
         *
         * @var string
         */
        private $updatedAt;
    
        /**
         * Constructs a group item
         *
         * @author Evan D Shaw <evandanielshaw@gmail.com>
         * @param int       $id
         * @param int       $groupId
         * @param int       $welitemSkuMetaId
         * @param string    $itemLabel
         * @param int       $itemQuantity
         * @param int|float $priceModifier
         * @param int       $position
         * @param string    $createdAt
         * @param string    $updatedAt
         * @return void
         */
        public function __construct(
            $id,
            $groupId,
            $welitemSkuMetaId,
            $itemLabel,
            $itemQuantity,
            $priceModifier,
            $position,
            $createdAt,
            $updatedAt
        ) {
            parent::__construct($welitemSkuMetaId);
            $this->id = (int)$id;
            $this->groupId = (int)$groupId;
            $this->itemLabel = $itemLabel;
            $this->itemQuantity = (int)$itemQuantity;
            $this->priceModifier = (float)$priceModifier;
            $this->position = (int)$position;
            $this->createdAt = $createdAt;
            $this->updatedAt = $updatedAt;
        }
    
        /**
         * Returns key-value representation of the object
         *
         * @author Evan D Shaw <evandanielshaw@gmail.com>
         * @return array
         */
        public function jsonSerialize() {
            return array_merge(
                parent::jsonSerialize(),
                $this->getJson()
            );
        }
    
        /**
         * Returns key-value array for the group item, excluding item and SKU data
         *
         * @author Evan D Shaw <evandanielshaw@gmail.com>
         * @return (int|string)[]
         */
        public function getJson() {
            return [
                'id' => $this->id,
                'groupId' => $this->groupId,
                'itemLabel' => $this->itemLabel,
                'itemQuantity' => $this->itemQuantity,
                'priceModifier' => $this->priceModifier,
                'position' => $this->position,
                'createdAt' => $this->createdAt,
                'updatedAt' => $this->updatedAt,
            ];
        }
    
        /**
         * Getter for `$this->id`
         *
         * @author Evan D Shaw <evandanielshaw@gmail.com>
         * @return int
         */
        public function getId() {
            return $this->id;
        }
    
        /**
         * Getter for `$this->id`
         *
         * @author Evan D Shaw <evandanielshaw@gmail.com>
         * @return int
         */
        public function getGroupId() {
            return $this->groupId;
        }
    
        /**
         * Getter for `$this->itemLabel`
         *
         * @author Evan D Shaw <evandanielshaw@gmail.com>
         * @return string
         */
        public function getItemLabel() {
            return $this->itemLabel;
        }
    
        /**
         * Getter for `$this->itemQuantity`
         *
         * @author Evan D Shaw <evandanielshaw@gmail.com>
         * @return int
         */
        public function getItemQuantity() {
            return $this->itemQuantity;
        }
    
        /**
         * Getter for `$this->priceModifier`
         *
         * @author Evan D Shaw <evandanielshaw@gmail.com>
         * @return float
         */
        public function getPriceModifier() {
            return $this->priceModifier;
        }
    
        /**
         * Getter for `$this->position`
         *
         * @author Evan D Shaw <evandanielshaw@gmail.com>
         * @return int
         */
        public function getPosition() {
            return $this->position;
        }
    
        /**
         * Getter for `$this->createdAt`
         *
         * @author Evan D Shaw <evandanielshaw@gmail.com>
         * @return string
         */
        public function getCreatedAt() {
            return $this->createdAt;
        }
    
        /**
         * Getter for `$this->updatedAt`
         *
         * @author Evan D Shaw <evandanielshaw@gmail.com>
         * @return string
         */
        public function getUpdatedAt() {
            return $this->updatedAt;
        }
    }
    

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


    関数 #関数

    Top ↑

    • __construct — Constructs a group item
    • getCreatedAt — Getter for `$this->createdAt`
    • getGroupId — Getter for `$this->id`
    • getId — Getter for `$this->id`
    • getItemLabel — Getter for `$this->itemLabel`
    • getItemQuantity — Getter for `$this->itemQuantity`
    • getJson — Returns key-value array for the group item, excluding item and SKU data
    • getPosition — Getter for `$this->position`
    • getPriceModifier — Getter for `$this->priceModifier`
    • getUpdatedAt — Getter for `$this->updatedAt`
    • jsonSerialize — Returns key-value representation of the object

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

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

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

    © 2025 Aivec llc All Rights Reserved.