10
10
use Magento \Checkout \Controller \Cart ;
11
11
use Magento \Checkout \Controller \Sidebar \UpdateItemQty ;
12
12
use Magento \Checkout \Model \Session ;
13
- <<<<<<< HEAD
14
13
use Magento \Checkout \Model \Cart as CartModel ;
15
- =======
16
- >>>>>>> 50 b054ffc2e (Resolved conflicts)
17
14
use Magento \Customer \Api \AddressRepositoryInterface ;
18
15
use Magento \Framework \App \RequestInterface ;
19
16
use Magento \Framework \Exception \LocalizedException ;
23
20
24
21
/**
25
22
* Cleans shipping addresses and item assignments after MultiShipping flow
26
- <<<<<<< HEAD
27
23
*
28
24
* @SuppressWarnings(PHPMD.CookieAndSessionMisuse)
29
- =======
30
- >>>>>>> 50b054ffc2e (Resolved conflicts)
31
25
*/
32
26
class MultishippingClearItemAddress
33
27
{
@@ -52,42 +46,29 @@ class MultishippingClearItemAddress
52
46
private $ disableMultishipping ;
53
47
54
48
/**
55
- <<<<<<< HEAD
56
49
* @var CartModel
57
50
*/
58
51
private $ cartmodel ;
59
52
60
53
/**
61
- =======
62
- >>>>>>> 50b054ffc2e (Resolved conflicts)
63
54
* @param CartRepositoryInterface $cartRepository
64
55
* @param Session $checkoutSession
65
56
* @param AddressRepositoryInterface $addressRepository
66
57
* @param DisableMultishipping $disableMultishipping
67
- <<<<<<< HEAD
68
58
* @param CartModel $cartmodel
69
- =======
70
- >>>>>>> 50b054ffc2e (Resolved conflicts)
71
59
*/
72
60
public function __construct (
73
61
CartRepositoryInterface $ cartRepository ,
74
62
Session $ checkoutSession ,
75
63
AddressRepositoryInterface $ addressRepository ,
76
- <<<<<<< HEAD
77
64
DisableMultishipping $ disableMultishipping ,
78
65
CartModel $ cartmodel
79
- =======
80
- DisableMultishipping $ disableMultishipping
81
- >>>>>>> 50 b054ffc2e (Resolved conflicts)
82
66
) {
83
67
$ this ->cartRepository = $ cartRepository ;
84
68
$ this ->checkoutSession = $ checkoutSession ;
85
69
$ this ->addressRepository = $ addressRepository ;
86
70
$ this ->disableMultishipping = $ disableMultishipping ;
87
- <<<<<<< HEAD
88
71
$ this ->cartmodel = $ cartmodel ;
89
- =======
90
- >>>>>>> 50 b054ffc2e (Resolved conflicts)
91
72
}
92
73
93
74
/**
@@ -120,14 +101,8 @@ public function clearAddressItem($subject, $request)
120
101
}
121
102
$ this ->cartRepository ->save ($ quote );
122
103
if ($ subject instanceof UpdateItemQty) {
123
- <<<<<<< HEAD
124
104
$ quote = $ this ->cartRepository ->get ($ quote ->getId ());
125
105
$ this ->cartmodel ->setQuote ($ quote );
126
- =======
127
- $ quote = $ this ->checkoutSession ->getQuote ();
128
- $ quote ->setTotalsCollectedFlag (false );
129
- $ this ->cartRepository ->save ($ quote );
130
- >>>>>>> 50 b054ffc2e (Resolved conflicts)
131
106
}
132
107
} elseif ($ this ->disableMultishipping ->execute ($ quote ) && $ this ->isVirtualItemInQuote ($ quote )) {
133
108
$ quote ->setTotalsCollectedFlag (false );
@@ -168,4 +143,4 @@ private function isDisableMultishippingRequired(RequestInterface $request, Quote
168
143
{
169
144
return $ request ->getActionName () !== "add " && $ quote ->getIsMultiShipping ();
170
145
}
171
- }
146
+ }
0 commit comments