diff --git a/app/Http/Livewire/BillingPortalPurchase.php b/app/Http/Livewire/BillingPortalPurchase.php index 387528942cbb..94d5e007cbcd 100644 --- a/app/Http/Livewire/BillingPortalPurchase.php +++ b/app/Http/Livewire/BillingPortalPurchase.php @@ -139,6 +139,16 @@ class BillingPortalPurchase extends Component */ public $request_data; + /** + * @var string + */ + public $price; + + public function mount() + { + $this->price = $this->subscription->service()->price(); + } + /** * Handle user authentication * @@ -331,6 +341,13 @@ class BillingPortalPurchase extends Component return 0; } + public function handleCoupon() + { + if ($this->coupon == $this->subscription->promo_code) { + $this->price = $this->subscription->promo_price; + } + } + public function render() { if ($this->contact instanceof ClientContact) { diff --git a/resources/views/portal/ninja2020/components/livewire/billing-portal-purchase.blade.php b/resources/views/portal/ninja2020/components/livewire/billing-portal-purchase.blade.php index 01625448208d..d74698642873 100644 --- a/resources/views/portal/ninja2020/components/livewire/billing-portal-purchase.blade.php +++ b/resources/views/portal/ninja2020/components/livewire/billing-portal-purchase.blade.php @@ -37,7 +37,7 @@