Hide/show coupon code field if promo code configured in billing tableclear

This commit is contained in:
Benjamin Beganović 2021-03-22 13:34:59 +01:00
parent 8839bfabd3
commit 8bc4896daa
2 changed files with 16 additions and 14 deletions

View File

@ -262,7 +262,7 @@ class BillingPortalPurchase extends Component
'client_contact_id' => $this->contact->hashed_id,
]],
'user_input_promo_code' => $this->coupon,
'coupon' => $this->coupon,
'coupon' => empty($this->billing_subscription->promo_code) ? '' : $this->coupon,
'quantity' => $this->quantity,
];

View File

@ -139,6 +139,7 @@
</form>
@endif
@if(!empty($billing_subscription->promo_code))
<div class="relative mt-8">
<div class="absolute inset-0 flex items-center">
<div class="w-full border-t border-gray-300"></div>
@ -155,6 +156,7 @@
<small class="block text-gray-900 mt-2">{{ ctrans('texts.billing_coupon_notice') }}</small>
</label>
</div>
@endif
</div>
</div>
</div>