From f181350a4f676b5878ef469751f4240fe9e30dd2 Mon Sep 17 00:00:00 2001 From: Sam Granger Date: Wed, 10 Jan 2018 08:58:15 +0100 Subject: [PATCH 1/5] Add failsafe to items.phtml We got a warning that $exist is undefined - not entirely sure what the exact scenario was but adding this as a failsafe. Added as default fallback and 'other'. --- .../Catalog/view/frontend/templates/product/list/items.phtml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/code/Magento/Catalog/view/frontend/templates/product/list/items.phtml b/app/code/Magento/Catalog/view/frontend/templates/product/list/items.phtml index fc0967ca60d2d..fef34d61b181b 100644 --- a/app/code/Magento/Catalog/view/frontend/templates/product/list/items.phtml +++ b/app/code/Magento/Catalog/view/frontend/templates/product/list/items.phtml @@ -147,7 +147,11 @@ switch ($type = $block->getType()) { break; case 'other': + $exist = null; break; + + default: + $exist = null; } ?> From ccaf54abbbd2e8eac35c0e74f00d60048fbb693e Mon Sep 17 00:00:00 2001 From: Sam Granger Date: Wed, 10 Jan 2018 10:43:38 +0100 Subject: [PATCH 2/5] Check if 'exist' variable is set in list.phtml --- .../view/frontend/templates/product/list/items.phtml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/app/code/Magento/Catalog/view/frontend/templates/product/list/items.phtml b/app/code/Magento/Catalog/view/frontend/templates/product/list/items.phtml index fef34d61b181b..0bf36fdffbf0b 100644 --- a/app/code/Magento/Catalog/view/frontend/templates/product/list/items.phtml +++ b/app/code/Magento/Catalog/view/frontend/templates/product/list/items.phtml @@ -147,15 +147,11 @@ switch ($type = $block->getType()) { break; case 'other': - $exist = null; break; - - default: - $exist = null; } ?> - + From c9a7eddce0f3b747018cc92ab4bc852b6f03ef0d Mon Sep 17 00:00:00 2001 From: David Manners Date: Wed, 10 Jan 2018 12:56:21 +0100 Subject: [PATCH 3/5] Update the if part of the list.phtml This should work if the variable is set And the variable is true or 1 or greater --- .../Catalog/view/frontend/templates/product/list/items.phtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/view/frontend/templates/product/list/items.phtml b/app/code/Magento/Catalog/view/frontend/templates/product/list/items.phtml index 0bf36fdffbf0b..2db0ffdaef4de 100644 --- a/app/code/Magento/Catalog/view/frontend/templates/product/list/items.phtml +++ b/app/code/Magento/Catalog/view/frontend/templates/product/list/items.phtml @@ -151,7 +151,7 @@ switch ($type = $block->getType()) { } ?> - + From bdcac52fb270e27e5343a18e55cbe0ffb394c81d Mon Sep 17 00:00:00 2001 From: Sam Granger Date: Wed, 10 Jan 2018 14:49:11 +0100 Subject: [PATCH 4/5] Set default value for $exist variable in list.phtml --- .../view/frontend/templates/product/list/items.phtml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/view/frontend/templates/product/list/items.phtml b/app/code/Magento/Catalog/view/frontend/templates/product/list/items.phtml index 2db0ffdaef4de..050b704eec728 100644 --- a/app/code/Magento/Catalog/view/frontend/templates/product/list/items.phtml +++ b/app/code/Magento/Catalog/view/frontend/templates/product/list/items.phtml @@ -147,11 +147,15 @@ switch ($type = $block->getType()) { break; case 'other': + $exist = null; break; + + default: + $exist = null; } ?> - + From d7dc6a95ca75843a34e58212d2617e69456b7021 Mon Sep 17 00:00:00 2001 From: Sam Granger Date: Wed, 10 Jan 2018 14:51:02 +0100 Subject: [PATCH 5/5] Remove 'other' case --- .../Catalog/view/frontend/templates/product/list/items.phtml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/app/code/Magento/Catalog/view/frontend/templates/product/list/items.phtml b/app/code/Magento/Catalog/view/frontend/templates/product/list/items.phtml index 050b704eec728..862375503691c 100644 --- a/app/code/Magento/Catalog/view/frontend/templates/product/list/items.phtml +++ b/app/code/Magento/Catalog/view/frontend/templates/product/list/items.phtml @@ -146,10 +146,6 @@ switch ($type = $block->getType()) { } break; - case 'other': - $exist = null; - break; - default: $exist = null; }