Skip to content

Commit

Permalink
Merge branch '4.x' of github.com:craftcms/commerce into 4.x
Browse files Browse the repository at this point in the history
  • Loading branch information
nfourtythree committed Feb 5, 2025
2 parents 737c89a + 62a75f3 commit 8ddb421
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@

## Unreleased

- Fixed a bug where the `commerce/cart/update-cart` action could return unnecessary validation errors. ([3873](https://github.com/craftcms/commerce/issues/3873))
- Improved logging when a user deletion is prevented due to the user having Commerce orders. ([#3686](https://github.com/craftcms/commerce/issues/3686))
- Added `craft\commerce\base\Gateway::transactionsSupportsRefund()`.

## 4.8.0.1 - 2025-02-03

- Fixed a bug where the deprecated `TaxRate::$isVat` property was still being set. ([#3874](https://github.com/craftcms/commerce/issues/3874))
- Fixed a PHP error that could occur when updating an order’s status on console requests. ([#3858](https://github.com/craftcms/commerce/issues/3858))
- Fixed a bug where the deprecated `craft\commerce\models\TaxRate::$isVat` property was still being set. ([#3874](https://github.com/craftcms/commerce/issues/3874))
- Fixed a PHP error that could occur when updating an order’s status from the CLI. ([#3858](https://github.com/craftcms/commerce/issues/3858))

## 4.8.0 - 2025-01-30

Expand Down
5 changes: 5 additions & 0 deletions src/controllers/CartController.php
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,9 @@ private function _returnCart(): ?Response

$updateCartSearchIndexes = Plugin::getInstance()->getSettings()->updateCartSearchIndexes;

$this->_cart->recalculate();
$this->_cart->recalculationMode = Order::RECALCULATION_MODE_NONE;

// Do not clear errors, as errors could be added to the cart before _returnCart is called.
if (!$this->_cart->validate($attributes, false) || !Craft::$app->getElements()->saveElement($this->_cart, false, false, $updateCartSearchIndexes)) {
$error = Craft::t('commerce', 'Unable to update cart.');
Expand Down Expand Up @@ -559,6 +562,8 @@ private function _returnCart(): ?Response
$this->_mutex->release($this->_mutexLockName);
}

$this->_cart->recalculationMode = Order::RECALCULATION_MODE_ALL;

return $this->asModelSuccess(
$this->_cart,
$message,
Expand Down

0 comments on commit 8ddb421

Please sign in to comment.