diff --git a/app/code/Magento/Quote/Model/Quote/Address.php b/app/code/Magento/Quote/Model/Quote/Address.php index 5476915d9d649..aee86eb1f8935 100644 --- a/app/code/Magento/Quote/Model/Quote/Address.php +++ b/app/code/Magento/Quote/Model/Quote/Address.php @@ -139,6 +139,8 @@ class Address extends AbstractAddress implements const ADDRESS_TYPE_BILLING = 'billing'; const ADDRESS_TYPE_SHIPPING = 'shipping'; + + private const CACHED_ITEMS_ALL = 'cached_items_all'; /** * Prefix of model events @@ -636,8 +638,7 @@ public function getItemsCollection() public function getAllItems() { // We calculate item list once and cache it in three arrays - all items - $key = 'cached_items_all'; - if (!$this->hasData($key)) { + if (!$this->hasData(self::CACHED_ITEMS_ALL)) { $quoteItems = $this->getQuote()->getItemsCollection(); $addressItems = $this->getItemsCollection(); @@ -676,10 +677,10 @@ public function getAllItems() } // Cache calculated lists - $this->setData('cached_items_all', $items); + $this->setData(self::CACHED_ITEMS_ALL, $items); } - $items = $this->getData($key); + $items = $this->getData(self::CACHED_ITEMS_ALL); return $items; }