mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Add OneTimeProducts component and its corresponding view
This commit is contained in:
parent
1b92542d55
commit
8e572f5790
28
app/Livewire/BillingPortal/Cart/OneTimeProducts.php
Normal file
28
app/Livewire/BillingPortal/Cart/OneTimeProducts.php
Normal file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Invoice Ninja (https://invoiceninja.com).
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
*
|
||||
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://www.elastic.co/licensing/elastic-license
|
||||
*/
|
||||
|
||||
namespace App\Livewire\BillingPortal\Cart;
|
||||
|
||||
use App\Models\Subscription;
|
||||
use Livewire\Component;
|
||||
|
||||
class OneTimeProducts extends Component
|
||||
{
|
||||
public Subscription $subscription;
|
||||
|
||||
public array $context;
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('billing-portal.v3.cart.one-time-products');
|
||||
}
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
<div class="space-y-10">
|
||||
@unless(empty($subscription->product_ids))
|
||||
@foreach($subscription->service()->products() as $index => $product)
|
||||
<div>
|
||||
<div class="flex items-start justify-between space-x-4">
|
||||
<div class="flex flex-start">
|
||||
@if(filter_var($product->product_image, FILTER_VALIDATE_URL))
|
||||
<div
|
||||
class="h-16 w-16 flex-shrink-0 overflow-hidden rounded-md border border-gray-200 mr-2"
|
||||
>
|
||||
<img
|
||||
src="{{ $product->product_image }}"
|
||||
alt=""
|
||||
class="h-full w-full object-cover object-center border rounded-md"
|
||||
/>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="flex flex-col">
|
||||
<h2 class="text-lg font-medium">{{ $product->product_key }}</h2>
|
||||
<p class="block text-sm">{{ \App\Utils\Number::formatMoney($product->price, $subscription->company) }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<article class="prose my-3 text-sm">
|
||||
{!! $product->markdownNotes() !!}
|
||||
</article>
|
||||
</div>
|
||||
@endforeach
|
||||
@endunless
|
||||
</div>
|
Loading…
x
Reference in New Issue
Block a user