Skip to content

Commit 2697952

Browse files
author
Alexander Akimov
authored
Merge pull request #2732 from magento-tsg/2.3-develop-pr24
[TSG] Upporting for 2.3 (pr24) (2.3.0)
2 parents 8eb668b + a5245cd commit 2697952

File tree

7 files changed

+357
-38
lines changed

7 files changed

+357
-38
lines changed

app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Action/DataProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ private function getSelectForSearchableProducts(
221221
$lastProductId,
222222
$batch
223223
) {
224-
$websiteId = $this->storeManager->getStore($storeId)->getWebsiteId();
224+
$websiteId = (int)$this->storeManager->getStore($storeId)->getWebsiteId();
225225
$lastProductId = (int) $lastProductId;
226226

227227
$select = $this->connection->select()

app/code/Magento/Checkout/view/frontend/web/js/model/totals.js

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,17 @@ define([
1414
'use strict';
1515

1616
var quoteItems = ko.observable(quote.totals().items),
17-
cartData = customerData.get('cart');
17+
cartData = customerData.get('cart'),
18+
quoteSubtotal = parseFloat(quote.totals().subtotal),
19+
subtotalAmount = parseFloat(cartData().subtotalAmount);
1820

1921
quote.totals.subscribe(function (newValue) {
2022
quoteItems(newValue.items);
2123
});
2224

23-
cartData.subscribe(function () {
24-
var quoteSubtotal = parseFloat(quote.totals().subtotal),
25-
subtotalAmount = parseFloat(cartData().subtotalAmount);
26-
27-
if (quoteSubtotal !== subtotalAmount) {
28-
customerData.reload(['cart'], false);
29-
}
30-
}, this);
25+
if (quoteSubtotal !== subtotalAmount) {
26+
customerData.reload(['cart'], false);
27+
}
3128

3229
return {
3330
totals: quote.totals,

app/code/Magento/Checkout/view/frontend/web/js/view/minicart.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,17 +94,17 @@ define([
9494
this.isLoading(addToCartCalls > 0);
9595
sidebarInitialized = false;
9696
this.update(updatedCart);
97-
98-
if (cartData()['website_id'] !== window.checkout.websiteId) {
99-
customerData.reload(['cart'], false);
100-
}
10197
initSidebar();
10298
}, this);
10399
$('[data-block="minicart"]').on('contentLoading', function () {
104100
addToCartCalls++;
105101
self.isLoading(true);
106102
});
107103

104+
if (cartData()['website_id'] !== window.checkout.websiteId) {
105+
customerData.reload(['cart'], false);
106+
}
107+
108108
return this._super();
109109
},
110110
isLoading: ko.observable(false),

app/code/Magento/ConfigurableProduct/view/frontend/web/js/options-updater.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ define([
2626
if (!(data && data.items && data.items.length && productId)) {
2727
return false;
2828
}
29-
changedProductOptions = data.items.find(function (item) {
29+
changedProductOptions = _.find(data.items, function (item) {
3030
if (item['item_id'] === itemId) {
3131
return item['product_id'] === productId;
3232
}

app/code/Magento/Customer/view/frontend/web/js/customer-data.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -232,11 +232,9 @@ define([
232232
if (!_.isEmpty(privateContent)) {
233233
countryData = this.get('directory-data');
234234

235-
countryData.subscribe(function () {
236-
if (_.isEmpty(countryData())) {
237-
customerData.reload(['directory-data'], false);
238-
}
239-
}, this);
235+
if (_.isEmpty(countryData())) {
236+
customerData.reload(['directory-data'], false);
237+
}
240238
}
241239
},
242240

app/code/Magento/Multishipping/Model/Checkout/Type/Multishipping.php

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,11 @@ class Multishipping extends \Magento\Framework\DataObject
170170
*/
171171
private $logger;
172172

173+
/**
174+
* @var \Magento\Framework\Api\DataObjectHelper
175+
*/
176+
private $dataObjectHelper;
177+
173178
/**
174179
* Constructor
175180
*
@@ -227,7 +232,8 @@ public function __construct(
227232
\Magento\Quote\Api\Data\CartExtensionFactory $cartExtensionFactory = null,
228233
AllowedCountries $allowedCountryReader = null,
229234
Multishipping\PlaceOrderFactory $placeOrderFactory = null,
230-
LoggerInterface $logger = null
235+
LoggerInterface $logger = null,
236+
\Magento\Framework\Api\DataObjectHelper $dataObjectHelper = null
231237
) {
232238
$this->_eventManager = $eventManager;
233239
$this->_scopeConfig = $scopeConfig;
@@ -258,6 +264,8 @@ public function __construct(
258264
->get(Multishipping\PlaceOrderFactory::class);
259265
$this->logger = $logger ?: ObjectManager::getInstance()
260266
->get(LoggerInterface::class);
267+
$this->dataObjectHelper = $dataObjectHelper ?: ObjectManager::getInstance()
268+
->get(\Magento\Framework\Api\DataObjectHelper::class);
261269
parent::__construct($data);
262270
$this->_init();
263271
}
@@ -670,7 +678,14 @@ protected function _prepareOrder(\Magento\Quote\Model\Quote\Address $address)
670678
$quote->reserveOrderId();
671679
$quote->collectTotals();
672680

673-
$order = $this->quoteAddressToOrder->convert($address);
681+
$order = $this->_orderFactory->create();
682+
683+
$this->dataObjectHelper->mergeDataObjects(
684+
\Magento\Sales\Api\Data\OrderInterface::class,
685+
$order,
686+
$this->quoteAddressToOrder->convert($address)
687+
);
688+
674689
$order->setQuote($quote);
675690
$order->setBillingAddress($this->quoteAddressToOrderAddress->convert($quote->getBillingAddress()));
676691

0 commit comments

Comments
 (0)