Skip to content

Commit 0d99fa8

Browse files
author
Lysenko Olexandr
authored
Merge pull request #3385 from magento-mpi/mpi-fix-1810
[MPI]-fix-1810
2 parents 8648f52 + ea8eed3 commit 0d99fa8

File tree

6 files changed

+22
-14
lines changed

6 files changed

+22
-14
lines changed

app/code/Magento/Quote/Model/ValidationRules/AllowedCountryValidationRule.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use Magento\Directory\Model\AllowedCountries;
1111
use Magento\Framework\Validation\ValidationResultFactory;
1212
use Magento\Quote\Model\Quote;
13+
use Magento\Store\Model\ScopeInterface;
1314

1415
/**
1516
* @inheritdoc
@@ -54,10 +55,15 @@ public function validate(Quote $quote): array
5455
$validationErrors = [];
5556

5657
if (!$quote->isVirtual()) {
58+
$shippingAddress = $quote->getShippingAddress();
59+
$shippingAddress->setStoreId($quote->getStoreId());
5760
$validationResult =
5861
in_array(
59-
$quote->getShippingAddress()->getCountryId(),
60-
$this->allowedCountryReader->getAllowedCountries()
62+
$shippingAddress->getCountryId(),
63+
$this->allowedCountryReader->getAllowedCountries(
64+
ScopeInterface::SCOPE_STORE,
65+
$quote->getStoreId()
66+
)
6167
);
6268
if (!$validationResult) {
6369
$validationErrors = [__($this->generalMessage)];

app/code/Magento/Quote/Model/ValidationRules/BillingAddressValidationRule.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,11 @@ public function __construct(
4343
public function validate(Quote $quote): array
4444
{
4545
$validationErrors = [];
46-
$validationResult = $quote->getBillingAddress()->validate();
46+
47+
$billingAddress = $quote->getBillingAddress();
48+
$billingAddress->setStoreId($quote->getStoreId());
49+
$validationResult = $billingAddress->validate();
50+
4751
if ($validationResult !== true) {
4852
$validationErrors = [__($this->generalMessage)];
4953
}

app/code/Magento/Quote/Model/ValidationRules/ShippingAddressValidationRule.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,10 @@ public function validate(Quote $quote): array
4545
$validationErrors = [];
4646

4747
if (!$quote->isVirtual()) {
48-
$validationResult = $quote->getShippingAddress()->validate();
48+
$shippingAddress = $quote->getShippingAddress();
49+
$shippingAddress->setStoreId($quote->getStoreId());
50+
$validationResult = $shippingAddress->validate();
51+
4952
if ($validationResult !== true) {
5053
$validationErrors = [__($this->generalMessage)];
5154
}

app/code/Magento/Quote/Model/ValidationRules/ShippingMethodValidationRule.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,10 @@ public function validate(Quote $quote): array
4545
$validationErrors = [];
4646

4747
if (!$quote->isVirtual()) {
48-
$shippingMethod = $quote->getShippingAddress()->getShippingMethod();
49-
$shippingRate = $quote->getShippingAddress()->getShippingRateByCode($shippingMethod);
48+
$shippingAddress = $quote->getShippingAddress();
49+
$shippingAddress->setStoreId($quote->getStoreId());
50+
$shippingMethod = $shippingAddress->getShippingMethod();
51+
$shippingRate = $shippingAddress->getShippingRateByCode($shippingMethod);
5052
$validationResult = $shippingMethod && $shippingRate;
5153
if (!$validationResult) {
5254
$validationErrors = [__($this->generalMessage)];

dev/tests/integration/testsuite/Magento/Quote/Model/QuoteValidatorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public function testValidateBeforeSubmitCountryIsNotAllowed()
6464
)->setValue(
6565
'general/country/allow',
6666
'US',
67-
\Magento\Store\Model\ScopeInterface::SCOPE_WEBSITES
67+
\Magento\Store\Model\ScopeInterface::SCOPE_STORE
6868
);
6969
$quote = $this->objectManager->create(Quote::class);
7070
$quote->load('quote123', 'reserved_order_id');

lib/web/magnifier/magnify.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,6 @@ define([
3535
allowZoomOut = false,
3636
allowZoomIn = true;
3737

38-
if (isTouchEnabled) {
39-
$(element).on('fotorama:showend fotorama:load', function () {
40-
$(magnifierSelector).remove();
41-
$(magnifierZoomSelector).remove();
42-
});
43-
}
44-
4538
(function () {
4639
var style = document.documentElement.style,
4740
transitionEnabled = style.transition !== undefined ||

0 commit comments

Comments
 (0)