Skip to content

Commit

Permalink
Merge branch '5.x' into 5.2
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/web/assets/commerceui/dist/js/app.js
#	src/web/assets/commerceui/dist/js/app.js.map
  • Loading branch information
nfourtythree committed Oct 16, 2024
2 parents a0d443c + 9e33559 commit beaa1c5
Show file tree
Hide file tree
Showing 22 changed files with 1,038 additions and 615 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- Fixed a bug where inventory items could appear with blank descriptions on the Inventory management screen. ([#3706](https://github.com/craftcms/commerce/issues/3706))
- Fixed a bug where additional buttons defined with `Order::EVENT_DEFINE_ADDITIONAL_BUTTONS` weren’t displayed on the Edit Order screen. ([#3692](https://github.com/craftcms/commerce/issues/3692))
- Fixed a bug where email errors weren’t displayed on the Edit Order screen. ([#3693](https://github.com/craftcms/commerce/issues/3693))
- Fixed a bug where `craft\commerce\helpers\Currency::formatAsCurrency()` wasn't stripping zeros. ([#3716](https://github.com/craftcms/commerce/issues/3716))

## 5.1.3 - 2024-10-02

Expand Down
1,453 changes: 856 additions & 597 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"devDependencies": {
"@craftcms/vue": "^1.0.0",
"@craftcms/webpack": "^1.1.0",
"axios": "^0.26.1",
"axios": "^0.28.0",
"chart.js": "^2.9.4",
"chartjs-adapter-moment": "^0.1.2",
"craftcms-sass": "^3.5.6",
Expand Down
5 changes: 4 additions & 1 deletion src/elements/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -1426,7 +1426,10 @@ public function getMetadata(): array
protected function searchKeywords(string $attribute): string
{
if ($attribute === 'sku') {
return $this->getVariants()->only('sku')->implode(' ');
return $this->getVariants()
->pluck('sku')
->filter(fn(?string $sku) => $sku && !PurchasableHelper::isTempSku($sku))
->implode(' ');
}

return parent::searchKeywords($attribute);
Expand Down
7 changes: 7 additions & 0 deletions src/helpers/Currency.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,13 @@ public static function formatAsCurrency($amount, mixed $currency = null, bool $c

if ($format) {
$numberFormatter = new \NumberFormatter(Craft::$app->getFormattingLocale(), \NumberFormatter::CURRENCY);

// Strip zeros if requested and only if the amount won't have any decimal places
if ($stripZeros && (int)$amount == $amount) {
$numberFormatter->setAttribute(\NumberFormatter::MAX_FRACTION_DIGITS, 0);
$numberFormatter->setAttribute(\NumberFormatter::MIN_FRACTION_DIGITS, 0);
}

$moneyFormatter = new IntlMoneyFormatter($numberFormatter, new ISOCurrencies());
$money = Plugin::getInstance()->getCurrencies()->getTeller($currencyIso)->convertToMoney($amount);

Expand Down
2 changes: 1 addition & 1 deletion src/web/assets/catalogpricing/dist/CatalogPricing.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/web/assets/catalogpricing/dist/CatalogPricing.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/web/assets/chartjs/dist/Chart.bundle.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/web/assets/chartjs/dist/moment-with-locales.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/web/assets/commercecp/dist/commercecp.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/web/assets/commercecp/dist/commercecp.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/web/assets/coupons/dist/coupons.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/web/assets/coupons/dist/coupons.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/web/assets/editproduct/dist/CommerceProductEdit.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/web/assets/editproduct/dist/CommerceProductEdit.js.map

Large diffs are not rendered by default.

Loading

0 comments on commit beaa1c5

Please sign in to comment.