Skip to content

Commit

Permalink
Digital product prices compatible with multi-currency payments
Browse files Browse the repository at this point in the history
  • Loading branch information
lukeholder committed Mar 11, 2017
1 parent c65588c commit 76662d0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ public function getTableAttributeHtml(BaseElementModel $element, $attribute)
return ($taxCategory ? Craft::t($taxCategory->name) : '');
}
case 'defaultPrice': {
$code = craft()->commerce_settings->getOption('defaultCurrency');
$code = craft()->commerce_paymentCurrencies->getPrimaryPaymentCurrencyIso();

return craft()->numberFormatter->formatCurrency($element->$attribute, strtoupper($code));
}
Expand Down
2 changes: 1 addition & 1 deletion digitalproducts/templates/products/_fields.html
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
name: 'price',
value: (product.price == '0' ? '0'|number : (product.price ? product.price|number ?: '')),
placeholder: 'Enter price'|t,
unit: craft.commerce.settings.defaultCurrency,
unit: craft.commerce.primaryPaymentCurrency.iso,
required: true,
errors: product.getErrors('price')
}) }}
Expand Down

0 comments on commit 76662d0

Please sign in to comment.