File tree Expand file tree Collapse file tree 6 files changed +22
-14
lines changed
app/code/Magento/Quote/Model/ValidationRules
dev/tests/integration/testsuite/Magento/Quote/Model Expand file tree Collapse file tree 6 files changed +22
-14
lines changed Original file line number Diff line number Diff line change 10
10
use Magento \Directory \Model \AllowedCountries ;
11
11
use Magento \Framework \Validation \ValidationResultFactory ;
12
12
use Magento \Quote \Model \Quote ;
13
+ use Magento \Store \Model \ScopeInterface ;
13
14
14
15
/**
15
16
* @inheritdoc
@@ -54,10 +55,15 @@ public function validate(Quote $quote): array
54
55
$ validationErrors = [];
55
56
56
57
if (!$ quote ->isVirtual ()) {
58
+ $ shippingAddress = $ quote ->getShippingAddress ();
59
+ $ shippingAddress ->setStoreId ($ quote ->getStoreId ());
57
60
$ validationResult =
58
61
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
+ )
61
67
);
62
68
if (!$ validationResult ) {
63
69
$ validationErrors = [__ ($ this ->generalMessage )];
Original file line number Diff line number Diff line change @@ -43,7 +43,11 @@ public function __construct(
43
43
public function validate (Quote $ quote ): array
44
44
{
45
45
$ validationErrors = [];
46
- $ validationResult = $ quote ->getBillingAddress ()->validate ();
46
+
47
+ $ billingAddress = $ quote ->getBillingAddress ();
48
+ $ billingAddress ->setStoreId ($ quote ->getStoreId ());
49
+ $ validationResult = $ billingAddress ->validate ();
50
+
47
51
if ($ validationResult !== true ) {
48
52
$ validationErrors = [__ ($ this ->generalMessage )];
49
53
}
Original file line number Diff line number Diff line change @@ -45,7 +45,10 @@ public function validate(Quote $quote): array
45
45
$ validationErrors = [];
46
46
47
47
if (!$ quote ->isVirtual ()) {
48
- $ validationResult = $ quote ->getShippingAddress ()->validate ();
48
+ $ shippingAddress = $ quote ->getShippingAddress ();
49
+ $ shippingAddress ->setStoreId ($ quote ->getStoreId ());
50
+ $ validationResult = $ shippingAddress ->validate ();
51
+
49
52
if ($ validationResult !== true ) {
50
53
$ validationErrors = [__ ($ this ->generalMessage )];
51
54
}
Original file line number Diff line number Diff line change @@ -45,8 +45,10 @@ public function validate(Quote $quote): array
45
45
$ validationErrors = [];
46
46
47
47
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 );
50
52
$ validationResult = $ shippingMethod && $ shippingRate ;
51
53
if (!$ validationResult ) {
52
54
$ validationErrors = [__ ($ this ->generalMessage )];
Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ public function testValidateBeforeSubmitCountryIsNotAllowed()
64
64
)->setValue (
65
65
'general/country/allow ' ,
66
66
'US ' ,
67
- \Magento \Store \Model \ScopeInterface::SCOPE_WEBSITES
67
+ \Magento \Store \Model \ScopeInterface::SCOPE_STORE
68
68
);
69
69
$ quote = $ this ->objectManager ->create (Quote::class);
70
70
$ quote ->load ('quote123 ' , 'reserved_order_id ' );
Original file line number Diff line number Diff line change @@ -35,13 +35,6 @@ define([
35
35
allowZoomOut = false ,
36
36
allowZoomIn = true ;
37
37
38
- if ( isTouchEnabled ) {
39
- $ ( element ) . on ( 'fotorama:showend fotorama:load' , function ( ) {
40
- $ ( magnifierSelector ) . remove ( ) ;
41
- $ ( magnifierZoomSelector ) . remove ( ) ;
42
- } ) ;
43
- }
44
-
45
38
( function ( ) {
46
39
var style = document . documentElement . style ,
47
40
transitionEnabled = style . transition !== undefined ||
You can’t perform that action at this time.
0 commit comments