diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9a38aac9e6..00885faee4 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,11 @@
# Release Notes for Craft Commerce
+## Unreleased
+
+- Improved the performance of the `craft\commerce\elements\db\VariantQuery::hasProduct()` and `craft\commerce\elements\db\ProductQuery::hasVariant()` query params. ([#3325](https://github.com/craftcms/commerce/pull/3325))
+- Order statuses with long names no longer line wrap on the Orders index page. ([#3335](https://github.com/craftcms/commerce/issues/3335))
+- Fixed duplicate validate errors that occurred when submitting a zero quantity to the cart. ([3334](https://github.com/craftcms/commerce/issues/3334))
+
## 4.3.2 - 2023-10-31
- Product GraphQL queries now support `promotable`, `freeShipping`, `defaultSku`, `defaultHeight`, `defaultLength`, `defaultWidth`, and `defaultWeight` arguments. ([#3307](https://github.com/craftcms/commerce/pull/3307))
diff --git a/src/elements/Order.php b/src/elements/Order.php
index d8a544278b..fccdc16776 100644
--- a/src/elements/Order.php
+++ b/src/elements/Order.php
@@ -2457,7 +2457,7 @@ public function getCustomerLinkHtml(): string
public function getOrderStatusHtml(): string
{
if ($status = $this->getOrderStatus()) {
- return ' ' . $status->name . '';
+ return '' . $status->name . '';
}
return '';
@@ -2469,10 +2469,10 @@ public function getOrderStatusHtml(): string
public function getPaidStatusHtml(): string
{
return match ($this->getPaidStatus()) {
- self::PAID_STATUS_OVERPAID => ' ' . Craft::t('commerce', 'Overpaid') . '',
- self::PAID_STATUS_PAID => ' ' . Craft::t('commerce', 'Paid') . '',
- self::PAID_STATUS_PARTIAL => ' ' . Craft::t('commerce', 'Partial') . '',
- self::PAID_STATUS_UNPAID => ' ' . Craft::t('commerce', 'Unpaid') . '',
+ self::PAID_STATUS_OVERPAID => '' . Craft::t('commerce', 'Overpaid') . '',
+ self::PAID_STATUS_PAID => '' . Craft::t('commerce', 'Paid') . '',
+ self::PAID_STATUS_PARTIAL => '' . Craft::t('commerce', 'Partial') . '',
+ self::PAID_STATUS_UNPAID => '' . Craft::t('commerce', 'Unpaid') . '',
default => '',
};
}
diff --git a/src/elements/Variant.php b/src/elements/Variant.php
index 4f45813467..5ee3eb9599 100644
--- a/src/elements/Variant.php
+++ b/src/elements/Variant.php
@@ -823,7 +823,6 @@ function($attribute, $params, Validator $validator) use ($lineItem, $getQty) {
}
},
],
- [['qty'], 'integer', 'min' => 1, 'skipOnError' => false],
];
}
diff --git a/src/elements/db/ProductQuery.php b/src/elements/db/ProductQuery.php
index 9bd6d6e935..4332978d03 100644
--- a/src/elements/db/ProductQuery.php
+++ b/src/elements/db/ProductQuery.php
@@ -1126,12 +1126,11 @@ private function _applyHasVariantParam(): void
$variantQuery->limit = null;
$variantQuery->select('commerce_variants.productId');
- $productIds = $variantQuery->asArray()->column();
// Remove any blank product IDs (if any)
- $productIds = array_filter($productIds);
+ $variantQuery->andWhere(['not', ['commerce_variants.productId' => null]]);
- $this->subQuery->andWhere(['commerce_products.id' => array_values($productIds)]);
+ $this->subQuery->andWhere(['commerce_products.id' => $variantQuery]);
}
/**
diff --git a/src/elements/db/VariantQuery.php b/src/elements/db/VariantQuery.php
index 1c4a136b4a..d5cadac2cd 100644
--- a/src/elements/db/VariantQuery.php
+++ b/src/elements/db/VariantQuery.php
@@ -927,11 +927,11 @@ private function _applyHasProductParam(): void
$productQuery->limit = null;
$productQuery->select('commerce_products.id');
- $productIds = $productQuery->column();
// Remove any blank product IDs (if any)
- $productIds = array_filter($productIds);
- $this->subQuery->andWhere(['commerce_variants.productId' => $productIds]);
+ $productQuery->andWhere(['not', ['commerce_products.id' => null]]);
+
+ $this->subQuery->andWhere(['commerce_variants.productId' => $productQuery]);
}
/**
diff --git a/src/models/LineItemStatus.php b/src/models/LineItemStatus.php
index feb67a19dd..fec0af341b 100644
--- a/src/models/LineItemStatus.php
+++ b/src/models/LineItemStatus.php
@@ -102,7 +102,7 @@ public function getCpEditUrl(): string
public function getLabelHtml(): string
{
- return sprintf('%s', $this->color, Html::encode($this->name));
+ return sprintf('%s', $this->color, Html::encode($this->name));
}
/**
diff --git a/src/models/OrderStatus.php b/src/models/OrderStatus.php
index 1705c8e9d1..9b228a611e 100644
--- a/src/models/OrderStatus.php
+++ b/src/models/OrderStatus.php
@@ -158,7 +158,7 @@ public function getEmails(): array
public function getLabelHtml(): string
{
- return sprintf('%s', $this->color, Html::encode($this->getDisplayName()));
+ return sprintf('%s', $this->color, Html::encode($this->getDisplayName()));
}
/**