Skip to content

Commit 24715b2

Browse files
committed
MAGETWO-37614: Stabilize story
1 parent 46aba35 commit 24715b2

File tree

2 files changed

+10
-36
lines changed

2 files changed

+10
-36
lines changed

app/code/Magento/Newsletter/Model/Resource/Subscriber/Collection.php

Lines changed: 9 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,6 @@ protected function _construct()
9191
$this->_queueLinkTable = $this->getTable('newsletter_queue_link');
9292
$this->_storeTable = $this->getTable('store');
9393

94-
// defining mapping for fields represented in several tables
95-
$this->_map['fields']['customer_lastname'] = 'customer_lastname_table.value';
96-
$this->_map['fields']['customer_firstname'] = 'customer_firstname_table.value';
9794
$this->_map['fields']['type'] = $this->getResource()->getReadConnection()->getCheckSql(
9895
'main_table.customer_id = 0',
9996
1,
@@ -145,37 +142,16 @@ public function useOnlyUnsent()
145142
*/
146143
public function showCustomerInfo()
147144
{
148-
$adapter = $this->getConnection();
149-
150-
$lastNameData = $this->_customerHelperData->getAttributeMetadata(
151-
\Magento\Customer\Api\CustomerMetadataInterface::ENTITY_TYPE_CUSTOMER,
152-
'lastname'
153-
);
154-
$firstNameData = $this->_customerHelperData->getAttributeMetadata(
155-
\Magento\Customer\Api\CustomerMetadataInterface::ENTITY_TYPE_CUSTOMER,
156-
'firstname'
145+
$this->getSelect()->joinLeft(
146+
[
147+
'customer' => $this->getTable('customer_entity')
148+
],
149+
'main_table.customer_id',
150+
[
151+
'customer_lastname' => 'lastname',
152+
'customer_firstname' => 'firstname'
153+
]
157154
);
158-
159-
$this->getSelect()
160-
->joinLeft(
161-
['customer_lastname_table' => $lastNameData['attribute_table']],
162-
$adapter->quoteInto(
163-
'customer_lastname_table.entity_id=main_table.customer_id
164-
AND customer_lastname_table.attribute_id = ?',
165-
(int)$lastNameData['attribute_id']
166-
),
167-
['customer_lastname' => 'value']
168-
)
169-
->joinLeft(
170-
['customer_firstname_table' => $firstNameData['attribute_table']],
171-
$adapter->quoteInto(
172-
'customer_firstname_table.entity_id=main_table.customer_id
173-
AND customer_firstname_table.attribute_id = ?',
174-
(int)$firstNameData['attribute_id']
175-
),
176-
['customer_firstname' => 'value']
177-
);
178-
179155
return $this;
180156
}
181157

app/code/Magento/Quote/Model/Observer/Frontend/Quote/Address/CollectTotals.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,11 @@ public function dispatch(\Magento\Framework\Event\Observer $observer)
7373
$customer = $quote->getCustomer();
7474
$storeId = $customer->getStoreId();
7575

76-
if (($customer->getCustomAttribute('disable_auto_group_change')
77-
&& $customer->getCustomAttribute('disable_auto_group_change')->getValue())
76+
if ($customer->getDisableAutoGroupChange()
7877
|| false == $this->vatValidator->isEnabled($quoteAddress, $storeId)
7978
) {
8079
return;
8180
}
82-
8381
$customerCountryCode = $quoteAddress->getCountryId();
8482
$customerVatNumber = $quoteAddress->getVatId();
8583
$groupId = null;

0 commit comments

Comments
 (0)