Show the message about coupon code/discount under the input field

This commit is contained in:
Benjamin Beganović 2021-03-18 13:51:10 +01:00
parent 2a89a12b69
commit 85c09ecf11
3 changed files with 8 additions and 21 deletions

View File

@ -123,8 +123,6 @@ class BillingPortalPurchase extends Component
public function handleBeforePaymentEvents() public function handleBeforePaymentEvents()
{ {
//stubs
$data = [ $data = [
'client_id' => $this->contact->client->id, 'client_id' => $this->contact->client->id,
'date' => now()->format('Y-m-d'), 'date' => now()->format('Y-m-d'),
@ -153,13 +151,6 @@ class BillingPortalPurchase extends Component
$this->emit('beforePaymentEventsCompleted'); $this->emit('beforePaymentEventsCompleted');
} }
//this isn't managed here - this is taken care of in the BS
public function applyCouponCode()
{
dd('Applying coupon code: ' . $this->coupon);
}
public function render() public function render()
{ {
if ($this->contact instanceof ClientContact) { if ($this->contact instanceof ClientContact) {

View File

@ -4160,7 +4160,7 @@ $LANG = array(
'security_settings' => 'Security Settings', 'security_settings' => 'Security Settings',
'resend_email' => 'Resend Email', 'resend_email' => 'Resend Email',
'confirm_your_email_address' => 'Please confirm your email address', 'confirm_your_email_address' => 'Please confirm your email address',
'freshbooks' => 'FreshBooks', 'freshbooks' => 'FreshBooks',
'invoice2go' => 'Invoice2go', 'invoice2go' => 'Invoice2go',
'invoicely' => 'Invoicely', 'invoicely' => 'Invoicely',
'waveaccounting' => 'Wave Accounting', 'waveaccounting' => 'Wave Accounting',
@ -4170,6 +4170,7 @@ $LANG = array(
'migration_auth_label' => 'Let\'s continue by authenticating.', 'migration_auth_label' => 'Let\'s continue by authenticating.',
'api_secret' => 'API secret', 'api_secret' => 'API secret',
'migration_api_secret_notice' => 'You can find API_SECRET in the .env file or Invoice Ninja v5. If property is missing, leave field blank.', 'migration_api_secret_notice' => 'You can find API_SECRET in the .env file or Invoice Ninja v5. If property is missing, leave field blank.',
'billing_coupon_notice' => 'Your discount will be applied on the checkout.',
); );
return $LANG; return $LANG;

View File

@ -110,17 +110,12 @@
</div> </div>
</div> </div>
<form wire:submit.prevent="applyCouponCode" class="mt-4"> <div class="flex items-center mt-4">
@csrf <label class="w-full mr-2">
<input type="text" wire:model.lazy="coupon" class="input w-full m-0"/>
<div class="flex items-center"> <small class="block text-gray-900 mt-2">{{ ctrans('texts.billing_coupon_notice') }}</small>
<label class="w-full mr-2"> </label>
<input type="text" wire:model.defer="coupon" class="input w-full m-0" /> </div>
</label>
<button class="button bg-primary m-0 text-white">{{ ctrans('texts.apply') }}</button>
</div>
</form>
</div> </div>
</div> </div>
</div> </div>