Skip to content

Commit

Permalink
Return cart errors for ajax-applying of voucher codes
Browse files Browse the repository at this point in the history
  • Loading branch information
engram-design committed Jun 22, 2020
1 parent a10a341 commit 188f723
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/controllers/CartController.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ private function _returnCart()
if ($request->getAcceptsJson()) {
return $this->asJson([
'error' => $error,
'errors' => $this->_cart->getErrors(),
'success' => !$this->_cart->hasErrors(),
$this->_cartVariable => $this->cartArray($this->_cart)
]);
Expand All @@ -130,6 +131,7 @@ private function _returnCart()
if ($request->getAcceptsJson()) {
return $this->asJson([
'error' => $error,
'errors' => $this->_cart->getErrors(),
'success' => !$this->_cart->hasErrors(),
$this->_cartVariable => $this->cartArray($this->_cart)
]);
Expand Down

0 comments on commit 188f723

Please sign in to comment.