When a site has multiple currencies enabled and a user goes to enter price information, the default currency is whatever wins in alphabetical sorting. If a country serves AU, CA, and US then all prices would default to the AUD currency, even though the store may primarily be in the US. This causes additional working during data entry to change the currency value (especially if using price list to control the other currencies pricing.)
The commerce_price_default
should allow specifying the default currency:
This can be done by adding an else
for an empty field value
if (!$items[$delta]->isEmpty()) {
$element['#default_value'] = $items[$delta]->toPrice()->toArray();
}
An empty price with the default currency can be passed.
Test.
Bikeshed wording.
Allows configuring the price field widget and defaulting the currency.
None
None
Needs work
2.0
Price
The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.