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 1010use Magento \Directory \Model \AllowedCountries ;
1111use Magento \Framework \Validation \ValidationResultFactory ;
1212use 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 )];
Original file line number Diff line number Diff 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 }
Original file line number Diff line number Diff 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 }
Original file line number Diff line number Diff 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 )];
Original file line number Diff line number Diff 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 ' );
Original file line number Diff line number Diff 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 ||
You can’t perform that action at this time.
0 commit comments