File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
app/code/Magento/Paypal/Controller/Express Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 1
1
<?php
2
2
/**
3
- * Copyright © Magento, Inc. All rights reserved.
4
- * See COPYING.txt for license details .
3
+ * Copyright 2015 Adobe
4
+ * All Rights Reserved .
5
5
*/
6
6
namespace Magento \Paypal \Controller \Express ;
7
7
@@ -151,6 +151,9 @@ public function __construct(
151
151
protected function _initCheckout (?CartInterface $ quoteObject = null )
152
152
{
153
153
$ quote = $ quoteObject ? $ quoteObject : $ this ->_getQuote ();
154
+ if ($ quote ->getId ()) {
155
+ $ this ->_getCheckoutSession ()->setPayPalQuoteId ($ quote ->getId ());
156
+ }
154
157
if (!$ quote ->hasItems () || $ quote ->getHasError ()) {
155
158
$ this ->getResponse ()->setStatusHeader (403 , '1.1 ' , 'Forbidden ' );
156
159
throw new \Magento \Framework \Exception \LocalizedException (__ ('We can \'t initialize Express Checkout. ' ));
@@ -248,6 +251,9 @@ protected function _getQuote()
248
251
$ this ->_getCheckoutSession ()->replaceQuote ($ this ->_quote );
249
252
} else {
250
253
$ this ->_quote = $ this ->_getCheckoutSession ()->getQuote ();
254
+ if (!$ this ->_quote ->getId () && $ this ->_getCheckoutSession ()->getPayPalQuoteId ()) {
255
+ $ this ->_quote = $ this ->quoteRepository ->get ($ this ->_getCheckoutSession ()->getPayPalQuoteId ());
256
+ }
251
257
}
252
258
}
253
259
return $ this ->_quote ;
You can’t perform that action at this time.
0 commit comments