Skip to content

Commit

Permalink
Update redirect path to be a param (#769)
Browse files Browse the repository at this point in the history
  • Loading branch information
ajello-meta authored Jul 15, 2024
1 parent 241a1aa commit bca35a9
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions app/code/Meta/Sales/Controller/Checkout/Index.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ public function execute()
$externalBusinessId = $this->httpRequest->getParam('external_business_id');
$products = explode(',', $this->httpRequest->getParam('products'));
$coupon = $this->httpRequest->getParam('coupon');
$redirect = $this->httpRequest->getParam('redirect');
$signature = $this->httpRequest->getParam('signature');

$storeId = $this->orderHelper->getStoreIdByExternalBusinessId($externalBusinessId);
Expand Down Expand Up @@ -283,10 +284,14 @@ public function execute()
}
}

// Redirect to checkout
// Redirect to indicated path or checkout
$this->checkoutSession->replaceQuote($quote);
$resultRedirect = $this->resultRedirectFactory->create();
$resultRedirect->setPath('checkout');
if ($redirect) {
$resultRedirect->setPath($redirect);
} else {
$resultRedirect->setPath('checkout');
}

return $resultRedirect;
}
Expand Down

0 comments on commit bca35a9

Please sign in to comment.