Skip to content

Commit

Permalink
Fixed carts stuck with incorrect recalculation mode
Browse files Browse the repository at this point in the history
  • Loading branch information
lukeholder committed Feb 10, 2025
1 parent 236f9f7 commit 46e3381
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

## 4.8.1.1 - 2025-02-07

- Fixed a bug where taxes and shipping totals weren’t being recalculated in `commerce/cart/*` action requests. ([#3888](https://github.com/craftcms/commerce/issues/3888))
- Fixed a bug where carts’ adjustment totals could be calculated incorrectly. ([#3888](https://github.com/craftcms/commerce/issues/3888))
- Fixed a styling issue on the Edit Order page. ([#3889](https://github.com/craftcms/commerce/issues/3889))

## 4.8.1 - 2025-02-05

Expand Down
2 changes: 1 addition & 1 deletion src/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ public static function editions(): array
/**
* @inheritDoc
*/
public string $schemaVersion = '4.8.0.0';
public string $schemaVersion = '4.8.1.0';

/**
* @inheritdoc
Expand Down
35 changes: 35 additions & 0 deletions src/migrations/m250210_125139_fix_cart_recalculation_modes.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

namespace craft\commerce\migrations;

use craft\commerce\db\Table;
use craft\commerce\elements\Order;
use craft\db\Migration;

/**
* m250210_125139_fix_cart_recalculation_modes migration.
*/
class m250210_125139_fix_cart_recalculation_modes extends Migration
{
/**
* @inheritdoc
*/
public function safeUp(): bool
{
$this->update(Table::ORDERS, ['recalculationMode' => Order::RECALCULATION_MODE_ALL], [
'recalculationMode' => Order::RECALCULATION_MODE_NONE,
'isCompleted' => false,
], [], false);

return true;
}

/**
* @inheritdoc
*/
public function safeDown(): bool
{
echo "m250210_125139_fix_cart_recalculation_modes cannot be reverted.\n";
return false;
}
}

0 comments on commit 46e3381

Please sign in to comment.