From d6e8ce940235903b2296c5fbb7ee70c39b57e544 Mon Sep 17 00:00:00 2001 From: Jon Shipman Date: Wed, 23 May 2018 15:36:53 -0500 Subject: [PATCH 1/2] Issue 15467 where a configuration sku gets deleted but is still saved in a customer cart --- .../Block/Cart/Item/Renderer/Configurable.php | 2 +- .../ConfigurableProduct/CustomerData/ConfigurableItem.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/ConfigurableProduct/Block/Cart/Item/Renderer/Configurable.php b/app/code/Magento/ConfigurableProduct/Block/Cart/Item/Renderer/Configurable.php index 17f0651cd5ff6..0d7dd320bfeb1 100644 --- a/app/code/Magento/ConfigurableProduct/Block/Cart/Item/Renderer/Configurable.php +++ b/app/code/Magento/ConfigurableProduct/Block/Cart/Item/Renderer/Configurable.php @@ -65,7 +65,7 @@ public function getProductForThumbnail() self::CONFIG_THUMBNAIL_SOURCE, \Magento\Store\Model\ScopeInterface::SCOPE_STORE ) == ThumbnailSource::OPTION_USE_PARENT_IMAGE || - !($this->getChildProduct()->getThumbnail() && $this->getChildProduct()->getThumbnail() != 'no_selection') + !($this->getChildProduct() && $this->getChildProduct()->getThumbnail() && $this->getChildProduct()->getThumbnail() != 'no_selection') ) { $product = $this->getProduct(); } else { diff --git a/app/code/Magento/ConfigurableProduct/CustomerData/ConfigurableItem.php b/app/code/Magento/ConfigurableProduct/CustomerData/ConfigurableItem.php index 3a9ed653305c5..e61967139606b 100644 --- a/app/code/Magento/ConfigurableProduct/CustomerData/ConfigurableItem.php +++ b/app/code/Magento/ConfigurableProduct/CustomerData/ConfigurableItem.php @@ -63,7 +63,7 @@ protected function getProductForThumbnail() ); $product = $config == ThumbnailSource::OPTION_USE_PARENT_IMAGE - || (!$this->getChildProduct()->getThumbnail() || $this->getChildProduct()->getThumbnail() == 'no_selection') + || (!$this->getChildProduct() || !$this->getChildProduct()->getThumbnail() || $this->getChildProduct()->getThumbnail() == 'no_selection') ? $this->getProduct() : $this->getChildProduct(); From 66dc4d8b9a053b6746cd0920266c087751b145f5 Mon Sep 17 00:00:00 2001 From: Jon Shipman Date: Fri, 25 May 2018 08:30:01 -0500 Subject: [PATCH 2/2] linetoobig --- .../Block/Cart/Item/Renderer/Configurable.php | 6 +++++- .../ConfigurableProduct/CustomerData/ConfigurableItem.php | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/ConfigurableProduct/Block/Cart/Item/Renderer/Configurable.php b/app/code/Magento/ConfigurableProduct/Block/Cart/Item/Renderer/Configurable.php index 0d7dd320bfeb1..ae43381d32288 100644 --- a/app/code/Magento/ConfigurableProduct/Block/Cart/Item/Renderer/Configurable.php +++ b/app/code/Magento/ConfigurableProduct/Block/Cart/Item/Renderer/Configurable.php @@ -65,7 +65,11 @@ public function getProductForThumbnail() self::CONFIG_THUMBNAIL_SOURCE, \Magento\Store\Model\ScopeInterface::SCOPE_STORE ) == ThumbnailSource::OPTION_USE_PARENT_IMAGE || - !($this->getChildProduct() && $this->getChildProduct()->getThumbnail() && $this->getChildProduct()->getThumbnail() != 'no_selection') + !( + $this->getChildProduct() && + $this->getChildProduct()->getThumbnail() && + $this->getChildProduct()->getThumbnail() != 'no_selection' + ) ) { $product = $this->getProduct(); } else { diff --git a/app/code/Magento/ConfigurableProduct/CustomerData/ConfigurableItem.php b/app/code/Magento/ConfigurableProduct/CustomerData/ConfigurableItem.php index e61967139606b..67e51b3797540 100644 --- a/app/code/Magento/ConfigurableProduct/CustomerData/ConfigurableItem.php +++ b/app/code/Magento/ConfigurableProduct/CustomerData/ConfigurableItem.php @@ -63,7 +63,11 @@ protected function getProductForThumbnail() ); $product = $config == ThumbnailSource::OPTION_USE_PARENT_IMAGE - || (!$this->getChildProduct() || !$this->getChildProduct()->getThumbnail() || $this->getChildProduct()->getThumbnail() == 'no_selection') + || ( + !$this->getChildProduct() || + !$this->getChildProduct()->getThumbnail() || + $this->getChildProduct()->getThumbnail() == 'no_selection' + ) ? $this->getProduct() : $this->getChildProduct();