Skip to content

Commit d24cb2f

Browse files
author
Yevhen Miroshnychenko
committed
Merge branch '2.3-develop' into MAGETWO-93699
2 parents 8410224 + 3074e2b commit d24cb2f

File tree

79 files changed

+374
-310
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+374
-310
lines changed

app/code/Magento/Braintree/view/frontend/web/js/view/payment/method-renderer/paypal.js

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
define([
88
'jquery',
99
'underscore',
10+
'mage/utils/wrapper',
1011
'Magento_Checkout/js/view/payment/default',
1112
'Magento_Braintree/js/view/payment/adapter',
1213
'Magento_Checkout/js/model/quote',
@@ -18,6 +19,7 @@ define([
1819
], function (
1920
$,
2021
_,
22+
wrapper,
2123
Component,
2224
Braintree,
2325
quote,
@@ -218,8 +220,9 @@ define([
218220

219221
/**
220222
* Re-init PayPal Auth Flow
223+
* @param {Function} callback - Optional callback
221224
*/
222-
reInitPayPal: function () {
225+
reInitPayPal: function (callback) {
223226
if (Braintree.checkout) {
224227
Braintree.checkout.teardown(function () {
225228
Braintree.checkout = null;
@@ -228,6 +231,18 @@ define([
228231

229232
this.disableButton();
230233
this.clientConfig.paypal.amount = this.grandTotalAmount;
234+
this.clientConfig.paypal.shippingAddressOverride = this.getShippingAddress();
235+
236+
if (callback) {
237+
this.clientConfig.onReady = wrapper.wrap(
238+
this.clientConfig.onReady,
239+
function (original, checkout) {
240+
this.clientConfig.onReady = original;
241+
original(checkout);
242+
callback();
243+
}.bind(this)
244+
);
245+
}
231246

232247
Braintree.setConfig(this.clientConfig);
233248
Braintree.setup();
@@ -403,15 +418,19 @@ define([
403418
* Triggers when customer click "Continue to PayPal" button
404419
*/
405420
payWithPayPal: function () {
406-
if (additionalValidators.validate()) {
421+
this.reInitPayPal(function () {
422+
if (!additionalValidators.validate()) {
423+
return;
424+
}
425+
407426
try {
408427
Braintree.checkout.paypal.initAuthFlow();
409428
} catch (e) {
410429
this.messageContainer.addErrorMessage({
411430
message: $t('Payment ' + this.getTitle() + ' can\'t be initialized.')
412431
});
413432
}
414-
}
433+
}.bind(this));
415434
},
416435

417436
/**

app/code/Magento/Braintree/view/frontend/web/template/payment/paypal.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
data-bind="attr: {'id': getCode()}, value: getCode(), checked: isChecked, click: selectPaymentMethod, visible: isRadioButtonVisible()" />
1313
<label class="label" data-bind="attr: {'for': getCode()}">
1414
<!-- PayPal Logo -->
15-
<img data-bind="attr: {src: getPaymentAcceptanceMarkSrc(), alt: $t('Acceptance Mark')}, title: $t('Acceptance Mark')}"
15+
<img data-bind="attr: {src: getPaymentAcceptanceMarkSrc(), alt: $t('Acceptance Mark'), title: $t('Acceptance Mark')}"
1616
class="payment-icon"/>
1717
<!-- PayPal Logo -->
1818
<span text="getTitle()"></span>

app/code/Magento/Catalog/Controller/Adminhtml/Category/Delete.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,12 @@ public function execute()
4444
$this->_eventManager->dispatch('catalog_controller_category_delete', ['category' => $category]);
4545
$this->_auth->getAuthStorage()->setDeletedPath($category->getPath());
4646
$this->categoryRepository->delete($category);
47-
$this->messageManager->addSuccess(__('You deleted the category.'));
47+
$this->messageManager->addSuccessMessage(__('You deleted the category.'));
4848
} catch (\Magento\Framework\Exception\LocalizedException $e) {
49-
$this->messageManager->addError($e->getMessage());
49+
$this->messageManager->addErrorMessage($e->getMessage());
5050
return $resultRedirect->setPath('catalog/*/edit', ['_current' => true]);
5151
} catch (\Exception $e) {
52-
$this->messageManager->addError(__('Something went wrong while trying to delete the category.'));
52+
$this->messageManager->addErrorMessage(__('Something went wrong while trying to delete the category.'));
5353
return $resultRedirect->setPath('catalog/*/edit', ['_current' => true]);
5454
}
5555
}

app/code/Magento/Catalog/Controller/Adminhtml/Product/Action/Attribute.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ protected function _validateProducts()
5454
}
5555

5656
if ($error) {
57-
$this->messageManager->addError($error);
57+
$this->messageManager->addErrorMessage($error);
5858
}
5959

6060
return !$error;

app/code/Magento/Catalog/Controller/Adminhtml/Product/Action/Attribute/Save.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ public function execute()
192192
$this->_eventManager->dispatch('catalog_product_to_website_change', ['products' => $productIds]);
193193
}
194194

195-
$this->messageManager->addSuccess(
195+
$this->messageManager->addSuccessMessage(
196196
__('A total of %1 record(s) were updated.', count($this->attributeHelper->getProductIds()))
197197
);
198198

@@ -205,9 +205,9 @@ public function execute()
205205
$this->_productPriceIndexerProcessor->reindexList($this->attributeHelper->getProductIds());
206206
}
207207
} catch (\Magento\Framework\Exception\LocalizedException $e) {
208-
$this->messageManager->addError($e->getMessage());
208+
$this->messageManager->addErrorMessage($e->getMessage());
209209
} catch (\Exception $e) {
210-
$this->messageManager->addException(
210+
$this->messageManager->addExceptionMessage(
211211
$e,
212212
__('Something went wrong while updating the product(s) attributes.')
213213
);

app/code/Magento/Catalog/Controller/Adminhtml/Product/Action/Attribute/Validate.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public function execute()
6868
$response->setError(true);
6969
$response->setMessage($e->getMessage());
7070
} catch (\Exception $e) {
71-
$this->messageManager->addException(
71+
$this->messageManager->addExceptionMessage(
7272
$e,
7373
__('Something went wrong while updating the product(s) attributes.')
7474
);

app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute/Delete.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,23 +21,23 @@ public function execute()
2121
// entity type check
2222
$model->load($id);
2323
if ($model->getEntityTypeId() != $this->_entityTypeId) {
24-
$this->messageManager->addError(__('We can\'t delete the attribute.'));
24+
$this->messageManager->addErrorMessage(__('We can\'t delete the attribute.'));
2525
return $resultRedirect->setPath('catalog/*/');
2626
}
2727

2828
try {
2929
$model->delete();
30-
$this->messageManager->addSuccess(__('You deleted the product attribute.'));
30+
$this->messageManager->addSuccessMessage(__('You deleted the product attribute.'));
3131
return $resultRedirect->setPath('catalog/*/');
3232
} catch (\Exception $e) {
33-
$this->messageManager->addError($e->getMessage());
33+
$this->messageManager->addErrorMessage($e->getMessage());
3434
return $resultRedirect->setPath(
3535
'catalog/*/edit',
3636
['attribute_id' => $this->getRequest()->getParam('attribute_id')]
3737
);
3838
}
3939
}
40-
$this->messageManager->addError(__('We can\'t find an attribute to delete.'));
40+
$this->messageManager->addErrorMessage(__('We can\'t find an attribute to delete.'));
4141
return $resultRedirect->setPath('catalog/*/');
4242
}
4343
}

app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute/Edit.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ public function execute()
2525
$model->load($id);
2626

2727
if (!$model->getId()) {
28-
$this->messageManager->addError(__('This attribute no longer exists.'));
28+
$this->messageManager->addErrorMessage(__('This attribute no longer exists.'));
2929
$resultRedirect = $this->resultRedirectFactory->create();
3030
return $resultRedirect->setPath('catalog/*/');
3131
}
3232

3333
// entity type check
3434
if ($model->getEntityTypeId() != $this->_entityTypeId) {
35-
$this->messageManager->addError(__('This attribute cannot be edited.'));
35+
$this->messageManager->addErrorMessage(__('This attribute cannot be edited.'));
3636
$resultRedirect = $this->resultRedirectFactory->create();
3737
return $resultRedirect->setPath('catalog/*/');
3838
}

app/code/Magento/Catalog/Controller/Adminhtml/Product/Duplicate.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ public function execute()
4343
$product = $this->productBuilder->build($this->getRequest());
4444
try {
4545
$newProduct = $this->productCopier->copy($product);
46-
$this->messageManager->addSuccess(__('You duplicated the product.'));
46+
$this->messageManager->addSuccessMessage(__('You duplicated the product.'));
4747
$resultRedirect->setPath('catalog/*/edit', ['_current' => true, 'id' => $newProduct->getId()]);
4848
} catch (\Exception $e) {
4949
$this->_objectManager->get(\Psr\Log\LoggerInterface::class)->critical($e);
50-
$this->messageManager->addError($e->getMessage());
50+
$this->messageManager->addErrorMessage($e->getMessage());
5151
$resultRedirect->setPath('catalog/*/edit', ['_current' => true]);
5252
}
5353
return $resultRedirect;

app/code/Magento/Catalog/Controller/Adminhtml/Product/Edit.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,12 @@ public function execute()
5252
if (($productId && !$product->getEntityId())) {
5353
/** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */
5454
$resultRedirect = $this->resultRedirectFactory->create();
55-
$this->messageManager->addError(__('This product doesn\'t exist.'));
55+
$this->messageManager->addErrorMessage(__('This product doesn\'t exist.'));
5656
return $resultRedirect->setPath('catalog/*/');
5757
} elseif ($productId === 0) {
5858
/** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */
5959
$resultRedirect = $this->resultRedirectFactory->create();
60-
$this->messageManager->addError(__('Invalid product id. Should be numeric value greater than 0'));
60+
$this->messageManager->addErrorMessage(__('Invalid product id. Should be numeric value greater than 0'));
6161
return $resultRedirect->setPath('catalog/*/');
6262
}
6363

0 commit comments

Comments
 (0)