|
|
@@ -130,6 +130,18 @@ class CartData
|
|
|
#[ApiProperty(description: 'Formatted VIP member discount amount')]
|
|
|
public ?string $formattedVipPlusAmount = null;
|
|
|
|
|
|
+ #[Groups(['query', 'mutation'])]
|
|
|
+ #[ApiProperty(description: 'VIP discount amount (5%)')]
|
|
|
+ public ?float $vipDiscountAmount = null;
|
|
|
+
|
|
|
+ #[Groups(['query', 'mutation'])]
|
|
|
+ #[ApiProperty(description: 'Base VIP discount amount (5%)')]
|
|
|
+ public ?float $baseVipDiscountAmount = null;
|
|
|
+
|
|
|
+ #[Groups(['query', 'mutation'])]
|
|
|
+ #[ApiProperty(description: 'Formatted VIP discount amount (5%)')]
|
|
|
+ public ?string $formattedVipDiscountAmount = null;
|
|
|
+
|
|
|
#[Groups(['query', 'mutation'])]
|
|
|
#[ApiProperty(description: 'Whether the current customer is a VIP member')]
|
|
|
public ?bool $isVip = null;
|
|
|
@@ -308,14 +320,19 @@ class CartData
|
|
|
$data->giftcardNumber = $cart->giftcard_number ?? null;
|
|
|
$data->giftcardAmount = (float) ($cart->giftcard_amount ?? 0);
|
|
|
$data->baseGiftcardAmount = (float) ($cart->base_giftcard_amount ?? 0);
|
|
|
- $data->formattedGiftcardAmount = core()->currency($cart->giftcard_amount ?? 0);
|
|
|
+ $data->formattedGiftcardAmount = core()->currency($cart->base_giftcard_amount ?? 0);
|
|
|
$data->remainingGiftcardAmount = (float) ($cart->remaining_giftcard_amount ?? 0);
|
|
|
- $data->formattedRemainingGiftcardAmount = core()->currency($cart->remaining_giftcard_amount ?? 0);
|
|
|
+ $data->formattedRemainingGiftcardAmount = core()->formatPrice($cart->remaining_giftcard_amount ?? 0);
|
|
|
|
|
|
// VIP member discount
|
|
|
$data->vipPlusAmount = (float) ($cart->vip_plus_amount ?? 0);
|
|
|
$data->baseVipPlusAmount = (float) ($cart->base_vip_plus_amount ?? 0);
|
|
|
- $data->formattedVipPlusAmount = core()->currency($cart->vip_plus_amount ?? 0);
|
|
|
+ $data->formattedVipPlusAmount = core()->currency($cart->base_vip_plus_amount ?? 0);
|
|
|
+
|
|
|
+ // VIP discount (5%)
|
|
|
+ $data->vipDiscountAmount = (float) ($cart->vip_discount_amount ?? 0);
|
|
|
+ $data->baseVipDiscountAmount = (float) ($cart->base_vip_discount_amount ?? 0);
|
|
|
+ $data->formattedVipDiscountAmount = core()->currency($cart->base_vip_discount_amount ?? 0);
|
|
|
|
|
|
// VIP status
|
|
|
$data->isVip = false;
|