Skip to content

Commit 24b824c

Browse files
committed
WIP
1 parent 2531752 commit 24b824c

File tree

6 files changed

+351
-9
lines changed

6 files changed

+351
-9
lines changed

CHANGELOG-WIP.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# WIP Release notes for Commerce 5.6
22

33
### Store Management
4-
- Added a new "Use Payment Currency Rate Snapshot" store setting. Payment currency rates are now snapshotted when an order is completed, and when this setting is enabled, subsequent partial payments use the snapshotted exchange rates instead of current rates.
4+
- Added a new "Use Payment Currency Rate Snapshot" store setting. Payment currency rates are now snapshotted when an order is completed, and when this setting is enabled, subsequent payments use the snapshotted exchange rates instead of current rates.
55
- Snapshotted payment currency rates are now displayed in the Transactions tab on order edit pages, with a comparison to current rates.
66

77
### Extensibility

src/elements/Order.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1115,7 +1115,7 @@ class Order extends Element implements HasStoreInterface
11151115
public ?int $storedTotalQty = null;
11161116

11171117
/**
1118-
* The payment currency rates at the time the order was completed. Used to lock in exchange rates for partial payments.
1118+
* The payment currency rates at the time the order was completed. Used to lock in exchange rates for subsequent payments.
11191119
* Stored as an associative array keyed by currency ISO code, e.g. ['EUR' => 0.85, 'GBP' => 0.73]
11201120
*
11211121
* @var array|null
@@ -1842,7 +1842,7 @@ public function markAsComplete(): bool
18421842
$this->estimatedBillingAddressId = null;
18431843
$this->orderCompletedEmail = $this->getEmail();
18441844

1845-
// Capture all payment currency rates for partial payments
1845+
// Capture all payment currency rates for subsequent payments
18461846
$paymentCurrencies = Plugin::getInstance()->getPaymentCurrencies()
18471847
->getAllPaymentCurrencies($this->getStore()->id);
18481848
if ($paymentCurrencies->isNotEmpty()) {

src/models/Store.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,7 @@ public function setUsesSnapshotPaymentCurrencyRate(bool|string $usesSnapshotPaym
621621
}
622622

623623
/**
624-
* Whether to use the snapshotted payment currency rate on order completion for subsequent partial payments.
624+
* Whether to use the snapshotted payment currency rate on order completion for subsequent payments.
625625
*
626626
* @param bool $parse
627627
* @return bool|string

src/templates/orders/_transactions.twig

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
'Show snapshotted payment currency rates',
1414
'Snapshotted Rate',
1515
'Status',
16-
'These exchange rates were captured when the order was completed and are used for subsequent partial payments.',
17-
'These exchange rates were captured when the order was completed and are used for subsequent partial payments. This behavior is controlled by the {link}Use Payment Currency Rate Snapshot{endlink} store setting.',
16+
'These exchange rates were captured when the order was completed and are used for subsequent payments.',
17+
'These exchange rates were captured when the order was completed and are used for subsequent payments. This behavior is controlled by the {link}Use Payment Currency Rate Snapshot{endlink} store setting.',
1818
'Type',
1919
]) %}
2020

@@ -35,12 +35,12 @@
3535
</p>
3636
<div id="snapshotted-payment-currency-rates" class="hidden">
3737
{% if currentUser.admin %}
38-
<p class="light">{{ 'These exchange rates were captured when the order was completed and are used for subsequent partial payments. This behavior is controlled by the {link}Use Payment Currency Rate Snapshot{endlink} store setting.'|t('commerce', {
38+
<p class="light">{{ 'These exchange rates were captured when the order was completed and are used for subsequent payments. This behavior is controlled by the {link}Use Payment Currency Rate Snapshot{endlink} store setting.'|t('commerce', {
3939
link: '<a href="' ~ url('commerce/settings/stores/' ~ order.store.id) ~ '">',
4040
endlink: '</a>'
4141
})|raw }}</p>
4242
{% else %}
43-
<p class="light">{{ 'These exchange rates were captured when the order was completed and are used for subsequent partial payments.'|t('commerce') }}</p>
43+
<p class="light">{{ 'These exchange rates were captured when the order was completed and are used for subsequent payments.'|t('commerce') }}</p>
4444
{% endif %}
4545
{% set currentPaymentCurrencies = craft.commerce.paymentCurrencies.getAllPaymentCurrencies(order.store.id) %}
4646
<table class="data fullwidth">

src/templates/settings/stores/_edit.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@
236236

237237
{{ forms.booleanMenuField({
238238
label: 'Use Payment Currency Rate Snapshot'|t('commerce'),
239-
instructions: 'Payment currency exchange rates are captured when an order is completed. When this setting is enabled, these snapshotted rates are used for subsequent partial payments on the order, ensuring consistent pricing even if exchange rates change.'|t('commerce'),
239+
instructions: 'Payment currency exchange rates are captured when an order is completed. When this setting is enabled, these snapshotted rates are used for subsequent payments on the order, ensuring consistent pricing even if exchange rates change.'|t('commerce'),
240240
id: 'usesSnapshotPaymentCurrencyRate',
241241
name: 'usesSnapshotPaymentCurrencyRate',
242242
value: store.getUsesSnapshotPaymentCurrencyRate(false),

0 commit comments

Comments
 (0)