|
|
@@ -146,6 +146,10 @@ class CartData
|
|
|
#[ApiProperty(description: 'Whether the current customer is a VIP member')]
|
|
|
public ?bool $isVip = null;
|
|
|
|
|
|
+ #[Groups(['query', 'mutation'])]
|
|
|
+ #[ApiProperty(description: 'VIP Plus expiration date')]
|
|
|
+ public ?string $vipExpireDate = null;
|
|
|
+
|
|
|
#[Groups(['query', 'mutation'])]
|
|
|
public ?bool $success = null;
|
|
|
|
|
|
@@ -336,11 +340,13 @@ class CartData
|
|
|
|
|
|
// VIP status
|
|
|
$data->isVip = false;
|
|
|
+ $data->vipExpireDate = null;
|
|
|
if ($cart->customer_id) {
|
|
|
$customer = \Webkul\Customer\Models\Customer::find($cart->customer_id);
|
|
|
if ($customer && $customer->vip_expire_date) {
|
|
|
$expireDate = \Carbon\Carbon::parse($customer->vip_expire_date);
|
|
|
$data->isVip = !$expireDate->isPast();
|
|
|
+ $data->vipExpireDate = $expireDate->toIso8601String();
|
|
|
}
|
|
|
}
|
|
|
|