Skip to content

Commit bca35a9

Browse files
authored
Update redirect path to be a param (#769)
1 parent 241a1aa commit bca35a9

File tree

1 file changed

+7
-2
lines changed
  • app/code/Meta/Sales/Controller/Checkout

1 file changed

+7
-2
lines changed

app/code/Meta/Sales/Controller/Checkout/Index.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ public function execute()
171171
$externalBusinessId = $this->httpRequest->getParam('external_business_id');
172172
$products = explode(',', $this->httpRequest->getParam('products'));
173173
$coupon = $this->httpRequest->getParam('coupon');
174+
$redirect = $this->httpRequest->getParam('redirect');
174175
$signature = $this->httpRequest->getParam('signature');
175176

176177
$storeId = $this->orderHelper->getStoreIdByExternalBusinessId($externalBusinessId);
@@ -283,10 +284,14 @@ public function execute()
283284
}
284285
}
285286

286-
// Redirect to checkout
287+
// Redirect to indicated path or checkout
287288
$this->checkoutSession->replaceQuote($quote);
288289
$resultRedirect = $this->resultRedirectFactory->create();
289-
$resultRedirect->setPath('checkout');
290+
if ($redirect) {
291+
$resultRedirect->setPath($redirect);
292+
} else {
293+
$resultRedirect->setPath('checkout');
294+
}
290295

291296
return $resultRedirect;
292297
}

0 commit comments

Comments
 (0)