From 63ebd01a84e649ea7b03505cba0fa347e851f22e Mon Sep 17 00:00:00 2001 From: Sergey Nezbritskiy Date: Wed, 12 Nov 2025 14:59:10 +0400 Subject: [PATCH 1/2] Fix fatal error on line 427, as method hasWarranty expects product id instead of sku. --- ViewModel/Warranty.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ViewModel/Warranty.php b/ViewModel/Warranty.php index 9e0866aa..adf5b2ac 100644 --- a/ViewModel/Warranty.php +++ b/ViewModel/Warranty.php @@ -413,10 +413,10 @@ public function itemHasLeadWarrantyInQuote($orderItem): bool * Check does quote have warranty item for the item * Kept for backwards compatibility with Hyva module * - * @param string $sku + * @param int $productId * @return bool */ - public function isWarrantyInQuote(string $sku): bool + public function isWarrantyInQuote(int $productId): bool { try { $quote = $this->checkoutSession->getQuote(); @@ -424,7 +424,7 @@ public function isWarrantyInQuote(string $sku): bool $quote = null; } if ($quote) { - $hasWarranty = $this->hasWarranty($quote, $sku); + $hasWarranty = $this->hasWarranty($quote, $productId); } return $hasWarranty ?? false; } From d7dfa14bc14dbb055a5a7fa0f1bfaf47de2b3112 Mon Sep 17 00:00:00 2001 From: Sergey Nezbritskiy Date: Wed, 12 Nov 2025 15:25:17 +0400 Subject: [PATCH 2/2] Rename the argument --- ViewModel/Warranty.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ViewModel/Warranty.php b/ViewModel/Warranty.php index adf5b2ac..1d629f03 100644 --- a/ViewModel/Warranty.php +++ b/ViewModel/Warranty.php @@ -413,10 +413,10 @@ public function itemHasLeadWarrantyInQuote($orderItem): bool * Check does quote have warranty item for the item * Kept for backwards compatibility with Hyva module * - * @param int $productId + * @param int $quoteItemId * @return bool */ - public function isWarrantyInQuote(int $productId): bool + public function isWarrantyInQuote(int $quoteItemId): bool { try { $quote = $this->checkoutSession->getQuote(); @@ -424,7 +424,7 @@ public function isWarrantyInQuote(int $productId): bool $quote = null; } if ($quote) { - $hasWarranty = $this->hasWarranty($quote, $productId); + $hasWarranty = $this->hasWarranty($quote, $quoteItemId); } return $hasWarranty ?? false; }