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