From e426fad38da0de10bb1e67affa8d528c23e6d2d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Beganovi=C4=87?= Date: Wed, 21 Feb 2024 18:00:06 +0100 Subject: [PATCH] Add showOptionalProductsLabel method to Cart class --- app/Livewire/BillingPortal/Cart/Cart.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/Livewire/BillingPortal/Cart/Cart.php b/app/Livewire/BillingPortal/Cart/Cart.php index 77c461bccc4f..f8fae332df76 100644 --- a/app/Livewire/BillingPortal/Cart/Cart.php +++ b/app/Livewire/BillingPortal/Cart/Cart.php @@ -27,6 +27,16 @@ class Cart extends Component $this->dispatch('purchase.next'); } + public function showOptionalProductsLabel() + { + $optional = [ + ...$this->context['bundle']['optional_recurring_products'] ?? [], + ...$this->context['bundle']['optional_one_time_products'] ?? [], + ]; + + return count($optional) > 0; + } + public function render() { return view('billing-portal.v3.cart.cart');