Skip to content
On this page

stage.ref.product.cart.ref

物販カートへの参照です。

プロパティ

items

type
Array<CartItem>

カートに入っている物販のリストです。

WARNING

ここで取得されるリストは取得時点でのオリジナルのクローンであるため、取得したリストへの変更は本データには反映されません。

totalCount

type
number

カートに入っている物販の総数です。

uuid

type
string

物販カートの UUID です。

メソッド

clear()

カート内の物販を全て削除します。

使用方法

ts
await Hedgehog.stage
  .ref("ステージのUUID")
  .product.cart.ref("物販カートのUUID")
  ?.clear();

makeLiquidationData()

type
ProductDataType

credit-dialog に渡すためのデータを作成します。

INFO

在庫が足りない物販は無視されます。

使用方法

ts
const data = await Hedgehog.stage
  .ref("ステージのUUID")
  .product.cart.ref("物販カートのUUID")
  ?.makeLiquidationData();

remove()

引数必須内容
productUuidProduct物販の UUID

カート内の物販を削除します。

使用方法

ts
await Hedgehog.stage
  .ref("ステージのUUID")
  .product.cart.ref("物販カートのUUID")
  ?.remove("物販カートのUUID");

updateCount()

引数必須内容
productUuidProduct物販の UUID
countnumber変更後の数

カート内の物販購入数を変更します。

使用方法

ts
const data = await Hedgehog.stage
  .ref("ステージのUUID")
  .product.cart.ref("物販カートのUUID")
  ?.updateCount("物販のUUID", 5);

updateStock()

type
Promise<void>

在庫情報を更新します。

使用方法

ts
await Hedgehog.stage
  .ref("ステージのUUID")
  .product.cart.ref("物販カートのUUID")
  ?.updateStock();