Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Release Notes for Craft Commerce

## Unreleased

- Fixed a bug where currency-based order condition rules could show the incorrect currency. ([#4368](https://github.com/craftcms/commerce/issues/4368))

## 5.7.4 - 2026-09-15

- Fixed a bug where custom order fields with a visibility condition based on order attributes couldn’t be saved. ([#4198](https://github.com/craftcms/commerce/issues/4198))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
use craft\elements\conditions\ElementConditionInterface;
use craft\fields\conditions\MoneyFieldConditionRule;
use craft\fields\Money;
use craft\helpers\Cp;
use craft\models\Site;
use Money\Currency;
use yii\db\QueryInterface;
Expand Down Expand Up @@ -71,10 +72,14 @@ public function setCondition(ConditionInterface $condition): void
if ($this->getCondition() instanceof HasStoreInterface) {
$this->currency = $this->getCondition()->getStore()->getCurrency();
} else {
if (Craft::$app->getRequest()->getIsCpRequest()) {
$currentSite = Cp::requestedSite();
} else {
$currentSite = Craft::$app->getSites()->getCurrentSite();
}
/** @var Site|StoreBehavior|null $currentSite */
$currentSite = Craft::$app->getSites()->getCurrentSite();

if ($currentSite->getBehavior(StoreBehavior::class)) {
if ($currentSite->getBehavior('commerce:store')) {
$this->currency = $currentSite?->getStore()->getCurrency();
}
}
Expand Down
Loading