Skip to content

Commit 36e8d3f

Browse files
author
Serhiy Shkolyarenko
committed
MAGETWO-50912: Custom Customer Attributes not saving at checkout
reverted fix
1 parent 00011bd commit 36e8d3f

File tree

6 files changed

+11
-77
lines changed

6 files changed

+11
-77
lines changed

app/code/Magento/Checkout/view/frontend/web/js/model/new-customer-address.js

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,18 @@
44
*/
55
/*jshint browser:true jquery:true*/
66
/*global alert*/
7-
define([], function () {
7+
define([], function() {
88
/**
9-
* @param {Object} addressData
9+
* @param addressData
1010
* Returns new address object
1111
*/
1212
return function (addressData) {
1313
var identifier = Date.now();
14-
1514
return {
1615
email: addressData.email,
1716
countryId: (addressData.country_id) ? addressData.country_id : window.checkoutConfig.defaultCountryId,
18-
regionId: (addressData.region && addressData.region.region_id) ?
19-
addressData.region.region_id
17+
regionId: (addressData.region && addressData.region.region_id)
18+
? addressData.region.region_id
2019
: window.checkoutConfig.defaultRegionId,
2120
regionCode: (addressData.region) ? addressData.region.region_code : null,
2221
region: (addressData.region) ? addressData.region.region : null,
@@ -34,26 +33,25 @@ define([], function () {
3433
suffix: addressData.suffix,
3534
vatId: addressData.vat_id,
3635
saveInAddressBook: addressData.save_in_address_book,
37-
customAttributes: addressData.custom_attributes,
38-
isDefaultShipping: function () {
36+
isDefaultShipping: function() {
3937
return addressData.default_shipping;
4038
},
41-
isDefaultBilling: function () {
39+
isDefaultBilling: function() {
4240
return addressData.default_billing;
4341
},
44-
getType: function () {
42+
getType: function() {
4543
return 'new-customer-address';
4644
},
47-
getKey: function () {
45+
getKey: function() {
4846
return this.getType();
4947
},
50-
getCacheKey: function () {
48+
getCacheKey: function() {
5149
return this.getType() + identifier;
5250
},
53-
isEditable: function () {
51+
isEditable: function() {
5452
return true;
5553
},
56-
canUseForBilling: function () {
54+
canUseForBilling: function() {
5755
return true;
5856
}
5957
}

app/code/Magento/Customer/Model/Address.php

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,6 @@ class Address extends \Magento\Customer\Model\Address\AbstractAddress
4747
*/
4848
protected $indexerRegistry;
4949

50-
/**
51-
* @var \Magento\Customer\Model\Address\CustomAttributeListInterface
52-
*/
53-
private $attributeList;
54-
5550
/**
5651
* @param \Magento\Framework\Model\Context $context
5752
* @param \Magento\Framework\Registry $registry
@@ -352,27 +347,4 @@ public function reindex()
352347
$indexer = $this->indexerRegistry->get(Customer::CUSTOMER_GRID_INDEXER_ID);
353348
$indexer->reindexRow($this->getCustomerId());
354349
}
355-
356-
/**
357-
* {@inheritdoc}
358-
*/
359-
protected function getCustomAttributesCodes()
360-
{
361-
return array_keys($this->getAttributeList()->getAttributes());
362-
}
363-
364-
/**
365-
* Get new AttributeList dependency for application code.
366-
* @return \Magento\Customer\Model\Address\CustomAttributeListInterface
367-
* @deprecated
368-
*/
369-
private function getAttributeList()
370-
{
371-
if (!$this->attributeList) {
372-
$this->attributeList = \Magento\Framework\App\ObjectManager::getInstance()->get(
373-
\Magento\Customer\Model\Address\CustomAttributeListInterface::class
374-
);
375-
}
376-
return $this->attributeList;
377-
}
378350
}

app/code/Magento/Customer/Model/Address/CustomAttributeList.php

Lines changed: 0 additions & 17 deletions
This file was deleted.

app/code/Magento/Customer/Model/Address/CustomAttributeListInterface.php

Lines changed: 0 additions & 16 deletions
This file was deleted.

app/code/Magento/Customer/etc/di.xml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,6 @@
4949
type="Magento\Customer\Model\EmailNotification" />
5050
<preference for="Magento\Customer\Api\CustomerNameGenerationInterface"
5151
type="Magento\Customer\Helper\View" />
52-
<preference for="Magento\Customer\Model\Address\CustomAttributeListInterface"
53-
type="Magento\Customer\Model\Address\CustomAttributeList" />
5452
<type name="Magento\Customer\Model\Session">
5553
<arguments>
5654
<argument name="configShare" xsi:type="object">Magento\Customer\Model\Config\Share\Proxy</argument>

app/code/Magento/Customer/view/frontend/web/js/model/customer/address.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ define([], function() {
3232
vatId: addressData.vat_id,
3333
sameAsBilling: addressData.same_as_billing,
3434
saveInAddressBook: addressData.save_in_address_book,
35-
customAttributes: addressData.custom_attributes,
3635
isDefaultShipping: function() {
3736
return addressData.default_shipping;
3837
},

0 commit comments

Comments
 (0)