|
@@ -94,6 +94,42 @@ class CartData
|
|
|
#[ApiProperty(description: 'Applied coupon code')]
|
|
#[ApiProperty(description: 'Applied coupon code')]
|
|
|
public ?string $couponCode = null;
|
|
public ?string $couponCode = null;
|
|
|
|
|
|
|
|
|
|
+ #[Groups(['query', 'mutation'])]
|
|
|
|
|
+ #[ApiProperty(description: 'Applied gift card number')]
|
|
|
|
|
+ public ?string $giftcardNumber = null;
|
|
|
|
|
+
|
|
|
|
|
+ #[Groups(['query', 'mutation'])]
|
|
|
|
|
+ #[ApiProperty(description: 'Gift card discount amount')]
|
|
|
|
|
+ public ?float $giftcardAmount = null;
|
|
|
|
|
+
|
|
|
|
|
+ #[Groups(['query', 'mutation'])]
|
|
|
|
|
+ #[ApiProperty(description: 'Base gift card discount amount')]
|
|
|
|
|
+ public ?float $baseGiftcardAmount = null;
|
|
|
|
|
+
|
|
|
|
|
+ #[Groups(['query', 'mutation'])]
|
|
|
|
|
+ #[ApiProperty(description: 'Formatted gift card discount amount')]
|
|
|
|
|
+ public ?string $formattedGiftcardAmount = null;
|
|
|
|
|
+
|
|
|
|
|
+ #[Groups(['query', 'mutation'])]
|
|
|
|
|
+ #[ApiProperty(description: 'Remaining gift card balance after use')]
|
|
|
|
|
+ public ?float $remainingGiftcardAmount = null;
|
|
|
|
|
+
|
|
|
|
|
+ #[Groups(['query', 'mutation'])]
|
|
|
|
|
+ #[ApiProperty(description: 'Formatted remaining gift card balance')]
|
|
|
|
|
+ public ?string $formattedRemainingGiftcardAmount = null;
|
|
|
|
|
+
|
|
|
|
|
+ #[Groups(['query', 'mutation'])]
|
|
|
|
|
+ #[ApiProperty(description: 'VIP member discount amount')]
|
|
|
|
|
+ public ?float $vipPlusAmount = null;
|
|
|
|
|
+
|
|
|
|
|
+ #[Groups(['query', 'mutation'])]
|
|
|
|
|
+ #[ApiProperty(description: 'Base VIP member discount amount')]
|
|
|
|
|
+ public ?float $baseVipPlusAmount = null;
|
|
|
|
|
+
|
|
|
|
|
+ #[Groups(['query', 'mutation'])]
|
|
|
|
|
+ #[ApiProperty(description: 'Formatted VIP member discount amount')]
|
|
|
|
|
+ public ?string $formattedVipPlusAmount = null;
|
|
|
|
|
+
|
|
|
#[Groups(['query', 'mutation'])]
|
|
#[Groups(['query', 'mutation'])]
|
|
|
public ?bool $success = null;
|
|
public ?bool $success = null;
|
|
|
|
|
|
|
@@ -264,6 +300,19 @@ class CartData
|
|
|
(is_string($cart->additional) ? json_decode($cart->additional, true) : $cart->additional) : [];
|
|
(is_string($cart->additional) ? json_decode($cart->additional, true) : $cart->additional) : [];
|
|
|
$data->couponCode = $additional['coupon_code'] ?? null;
|
|
$data->couponCode = $additional['coupon_code'] ?? null;
|
|
|
|
|
|
|
|
|
|
+ // Gift card
|
|
|
|
|
+ $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->remainingGiftcardAmount = (float) ($cart->remaining_giftcard_amount ?? 0);
|
|
|
|
|
+ $data->formattedRemainingGiftcardAmount = core()->currency($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);
|
|
|
|
|
+
|
|
|
if ($cart->billing_address) {
|
|
if ($cart->billing_address) {
|
|
|
$data->billingAddress = [
|
|
$data->billingAddress = [
|
|
|
'id' => $cart->billing_address->id,
|
|
'id' => $cart->billing_address->id,
|