From 28db9eb5085cc1a43d7867af97561342f1259e31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Beganovi=C4=87?= Date: Mon, 12 Feb 2024 18:55:25 +0100 Subject: [PATCH] Add OptionalOneTimeProducts component and its corresponding view --- .../Cart/OptionalOneTimeProducts.php | 26 ++++++++++ .../cart/optional-one-time-products.blade.php | 51 +++++++++++++++++++ 2 files changed, 77 insertions(+) create mode 100644 app/Livewire/BillingPortal/Cart/OptionalOneTimeProducts.php create mode 100644 resources/views/billing-portal/v3/cart/optional-one-time-products.blade.php diff --git a/app/Livewire/BillingPortal/Cart/OptionalOneTimeProducts.php b/app/Livewire/BillingPortal/Cart/OptionalOneTimeProducts.php new file mode 100644 index 000000000000..bf5f3aaa0030 --- /dev/null +++ b/app/Livewire/BillingPortal/Cart/OptionalOneTimeProducts.php @@ -0,0 +1,26 @@ + + @unless(empty($subscription->optional_recurring_product_ids)) + @foreach($subscription->service()->optional_products() as $index => $product) +
+
+
+ @if(filter_var($product->product_image, FILTER_VALIDATE_URL)) +
+ +
+ @endif + +
+

{{ $product->product_key }}

+

{{ \App\Utils\Number::formatMoney($product->price, $subscription->company) }}

+
+
+ +
+
+ @if(is_numeric($product->max_quantity)) + @if($subscription->use_inventory_management && $product->in_stock_quantity == 0) +

{{ ctrans('texts.out_of_stock') }}

+ @else +

{{ ctrans('texts.qty') }}

+ @endif + + + @endif +
+
+
+ +
+ {!! $product->markdownNotes() !!} +
+
+ @endforeach + @endunless +