Craft Commerce
Version 4.9.4
October 15, 2025
- Fixed a SQL error that could occur when deleting a shipping method.
Version 4.9.3
September 4, 2025
- Fixed a bug where the
commerce/cart/update-cartaction could return unnecessary validation errors. (3873) - Added
craft\commerce\helpers\Order::normalizeLineItemPurchasableAvailability().
Version 4.9.2
August 20, 2025
- Fixed a PHP error that could occur when saving an order from an
EVENT_ORDER_STATUS_CHANGEevent handler. (#4101)
Version 4.9.1
July 23, 2025
- Fixed a bug where outdated transaction data could be used when completing a payment. (craftcms/commerce-stripe#353)
Version 4.8.4
May 1, 2025
- Fixed a bug where products weren’t getting updated when default variants were saved directly. (#3988)
Version 4.8.3
March 19, 2025
- Fixed a PHP error that could occur when registering a custom shipping method.
Version 4.8.2
March 12, 2025
- Fixed a bug where line items’ sale prices could be calculated incorrectly. (#3928)
Version 4.8.1.2
February 10, 2025
- Fixed a bug where carts’ adjustment totals could be calculated incorrectly. (#3888)
Version 4.8.1.1
February 7, 2025
- Fixed a bug where taxes and shipping totals weren’t being recalculated in
commerce/cart/*action requests. (#3888)
Version 4.8.0
January 30, 2025
Store Management
- Archived gateways are now listed on the Gateways index page. (#3839)
- Improved Craft Commerce navigation and breadcrumb labels.
Extensibility
- Added support for registering custom tax ID validators.
- Added
\craft\commerce\services\Taxes::getEnabledTaxIdValidators(). - Added
\craft\commerce\services\Taxes::getTaxIdValidators(). - Added
craft\commerce\base\TaxIdValidatorInterface. - Added
craft\commerce\services\Gateways\getAllArchivedGateways(). - Added
craft\commerce\services\Taxes::EVENT_REGISTER_TAX_ID_VALIDATORS. - Added
craft\commerce\taxidvalidators\EuVatIdValidator.
Version 4.7.3
January 22, 2025
- Improved the performance of recalculating shipping method prices. (#3841)
- Fixed a bug where users products had a “Save as a new product” action even if a plugin was preventing duplication via
craft\services\Elements::EVENT_AUTHORIZE_DUPLICATE. (#3819) - Fixed a PHP error that could occur when updating a cart. (#3842)
- Fixed a PHP error that could occur when adding an invalid address to a cart. (#3848)
Version 4.7.2
December 18, 2024
- Fixed a bug where the Edit Order page wasn’t showing order errors.
Version 4.7.1
December 2, 2024
- Fixed an error that occurred on the Orders index page when running Craft CMS 4.13.4 or later. (#3793)
Version 4.7.0
October 16, 2024
Store Management
- It’s now possible for discounts to explicitly require a coupon code. (#3132)
- New order addresses now default to the store’s country on Order Edit screens. (#3306)
- Product conditions can now have a “Variant Search” rule. (#3689)
Extensibility
- Added
craft\commerce\console\controllers\UpgradeController::$v3droppableColumns - Added
craft\commerce\console\controllers\UpgradeController::EVENT_BEFORE_DROP_V3_DATABASE_ENTITIES. - Added
craft\commerce\elements\conditions\products\ProductVariantSearchConditionRule. - Added
craft\commerce\events\UpgradeEvent. - Added
craft\commerce\models\Discount::$requireCouponCode.
System
Version 4.6.14
October 16, 2024
- Fixed a PHP error that could occur when creating a subscription. (#3710)
Version 4.6.13
October 2, 2024
- Fixed a PHP error that could occur when deleting a user with orders. (#3686)
Version 4.6.12
September 19, 2024
- Fixed a bug where some strings weren’t getting translated on Edit Order screens.
- Fixed a JavaScript error that could occur when editing an order.
Version 4.6.11
September 10, 2024
- Fixed XSS vulnerabilities.
Version 4.6.10
August 28, 2024
- Fixed a PHP error that could occur when default addresses were set on a cart. (#3641)
Version 4.6.9
August 21, 2024
- Fixed a bug where available shipping methods were not returned in order of price. (#3631)
Version 4.6.7
July 25, 2024
- Fixed a bug where account activation emails weren’t being sent on order completion. (#3226)
Version 4.6.6
July 24, 2024
- Fixed a bug where emails sent via the control panel could be rendered with the wrong language.
Version 4.6.5
July 18, 2024
- Fixed a bug where SCA payment sources prevented subscriptions from starting. (#3590)
Version 4.6.4
July 17, 2024
- Fixed PHP error that occurred when saving an estimated billing address. (#3549)
Version 4.6.3.1
June 20, 2024
- Fixed a PHP error that could occur on app initialization. (#3546)
Version 4.6.2
May 29, 2024
- Fixed a bug where orders’
shippingMethodNamevalues could be cleared out when saving a completed order with a plugin-provided shipping method. (#3519) - Fixed a PHP error that could occur on app initialization.
Version 4.5.1.1
March 1, 2024
- Fixed a bug where the “Share cart” order index action wasn’t working.
- Fixed a bug where editing an adjustment’s amount could cause the adjustment to lose data on the Edit Order page. (#3392)
Version 4.5.1
February 29, 2024
Version 4.5.0
February 26, 2024
- Removed the Lite edition.
- Deprecated
craft\commerce\models\ShippingMethod::isLite. - Deprecated
craft\commerce\models\ShippingRule::isLite. - Deprecated
craft\commerce\models\TaxRate::isLite. - Deprecated
craft\commerce\models\LiteShippingSettings. - Deprecated
craft\commerce\models\LiteTaxSettings. - Deprecated
craft\commerce\controllers\LiteShippingController. - Deprecated
craft\commerce\controllers\LiteTaxController. - Deprecated
craft\commerce\services\ShippingMethods::getLiteShippingMethod().getAllShippingMethods()should be used instead. - Deprecated
craft\commerce\services\ShippingMethods::saveLiteShippingMethod().saveShippingMethod()should be used instead. - Deprecated
craft\commerce\services\ShippingRules::getLiteShippingRule().getAllShippingRules()should be used instead. - Deprecated
craft\commerce\services\ShippingRules::saveLiteShippingRule().saveShippingRule()should be used instead. - Deprecated
craft\commerce\services\TaxRates::getLiteTaxRate().getAllTaxRates()should be used instead. - Deprecated
craft\commerce\services\TaxRates::saveLiteTaxRate().saveTaxRate()should be used instead. - Fixed a SQL error that occurred when running the
commerce/upgradecommand on PostgreSQL. (#3380)
Version 4.4.1.1
January 12, 2024
- Fixed a PHP error that occurred when saving a sale. (#3364)
Version 4.4.0
January 11, 2024
- Craft Commerce now requires Craft CMS 4.6.0 or later.
- Added search to the Discounts index. (#2322)
- Improved the performance of the Discounts index. (#3347)
- Improved the performance of the
commerce/upgradecommand. (#3286) - Added
craft\commerce\services\Discounts::ensureSortOrder(). - Fixed a bug where calling
craft\commerce\services\Carts::forgetCart()wouldn’t completely clear the cart. (#3353) - Fixed a bug where the Edit Order page could become locked when editing an adjustment. (#3351)
- Fixed a bug that prevented the creation of a non-Stripe subscription. (#3365)
Version 4.3.3
December 14, 2023
- Improved the performance of variant queries’
hasProductandhasVariantparams. (#3325) - Order statuses with long names no longer wrap on the Orders index page. (#3335)
- Fixed a bug where carts could get duplicate validation errors. (3334)
- Fixed a bug where tab selection was inconsistent on Edit Order pages.
- Fixed a bug where sales weren’t respecting elements’ site statuses. (#3328)
- Fixed a bug where soft-deleted order statuses and line item statuses weren’t getting restored when applying project config changes. (#3164)
- Fixed a bug where carts weren’t getting restored after signing in.
- Fixed a bug where guests could use discounts with per-user usage limits. (#3326)
- Fixed a bug where orders with a processing transaction weren’t getting completed.
Version 4.3.2
October 31, 2023
- Product GraphQL queries now support
promotable,freeShipping,defaultSku,defaultHeight,defaultLength,defaultWidth, anddefaultWeightarguments. (#3307) - Product GraphQL queries now support
promotable,freeShipping,defaultSku,defaultHeight,defaultLength,defaultWidth,defaultWeight, anddefaultVariantfields. (#3307) - Fixed a bug where it was possible to select soft-deleted tax categories.
- Fixed a PHP error that occurred when sending an email with a missing PDF filename format. (#3309)
- Fixed a PHP error that occurred when viewing soft-deleted orders. (#3308)
- Fixed a bug where saving a shipping zone could fail if a tax zone existed with the same name. (#3317)
- Fixed a bug where
craft\commerce\services\LineItems::getLineItemById()wasn’t decoding the snapshot data. (#3253)
Version 4.3.1
October 18, 2023
- Added the
commerce/gateways/listcommand. - Added the
commerce/gateways/webhook-urlcommand. - Improved the performance of the
commerce/upgradecommand. (#3286) - Auto-generated variant titles and SKUs are now generated before products are saved. (#3297)
- Added
craft\commerce\models\ShippingMethodOption::$shippingMethod. (#3274, #3271) craft\commerce\services\Purchasables::EVENT_PURCHASABLE_SHIPPABLEevent handlers can now access the order. (#3279)- Fixed a bug where Edit Product pages showed a Delete button for users that didn’t have permission to delete the product. (#3285)
- Fixed a bug where it was possible to select soft-deleted shipping categories. (#3272)
- Fixed a bug where the Customer condition rule wasn’t loading correctly. (#3291)
- Fixed an error that could occur when rendering a PDF. (#2633)
- Fixed a bug where sales’ and discounts’ timestamps weren’t getting populated. (#3298)
- Fixed a bug where the
commerce/upgradecommand could create duplicate inactive users. (#3286) - Fixed a bug where
commerce/payments/payJSON responses were missing theredirectkey. (#3265) - Fixed a bug where gateway URLs could be malformed. (#3299)
Version 4.3.0
September 13, 2023
- Sales and discounts now support using related entries in their matching item conditions. (#3134, #2717)
- It’s now possible to query products by shipping category and tax category. (#3219)
- Guest customers registering during checkout now have their addresses saved to their account. (#3203)
- Product conditions can now have “Product Type”, “Variant SKU”, “Variant Has Unlimited Stock”, “Variant Price”, and “Variant Stock” rules. (#3209)
- Improved the performance of discount recalculation.
- Improved the performance of the
commerce/upgradecommand. (#3208) - Added the
commerce/cart/forget-cartaction. (#3206) - The
commerce/cart/update-cartaction now acceptsfirstNameandlastNameaddress parameters. (#3015) - Added
craft\commerce\controllers\OrdersController::EVENT_MODIFY_PURCHASABLES_TABLE_QUERY. (#3198) - Added
craft\commerce\elements\Order::$orderCompletedEmail. (#3138) - Added
craft\commerce\elements\db\ProductQuery::$shippingCategoryId. - Added
craft\commerce\elements\db\ProductQuery::$taxCategoryId. - Added
craft\commerce\elements\db\ProductQuery::shippingCategory(). - Added
craft\commerce\elements\db\ProductQuery::shippingCategoryId(). - Added
craft\commerce\elements\db\ProductQuery::taxCategory(). - Added
craft\commerce\elements\db\ProductQuery::taxCategoryId(). - Added
craft\commerce\models\Discount::hasBillingAddressCondition(). - Added
craft\commerce\models\Discount::hasCustomerCondition(). - Added
craft\commerce\models\Discount::hasOrderCondition(). - Added
craft\commerce\models\Discount::hasShippingAddressCondition(). - Deprecated payment source creation via the
commerce/subscriptions/subscribeaction. - Deprecated
craft\commerce\elements\Order::setEmail().Order::setCustomer()should be used instead. - Removed the
htmxoption from thecommerce/example-templatescommand. - Removed the
coloroption from thecommerce/example-templatescommand. - Added
craft\commerce\events\ModifyPurchasablesTableQueryEvent. (#3198) - Fixed a bug where products/variants could be saved with a minimum quantity that was set higher than the maximum quantity. (#3234)
- Fixed a bug where
craft\commerce\elements\Order::hasMatchingAddresses()could incorrectly returnfalse. (#3183) - Fixed a bug where changing a user’s email could cause additional user elements to be created. (#3138)
- Fixed a bug where related sales were displaying when creating a new product.
- Fixed a bug where Commerce wasn’t invoking
craft\services\Elements::EVENT_AUTHORIZE_*event handlers. - Fixed a bug where discounts’ per user usage counters weren’t getting migrated properly when upgrading to Commerce 4.
- Fixed a bug where address changes weren’t being synced to carts that were using them. (#3178)
- Fixed a SQL error that could occur when fetching emails. (#3267)
- Fixed an XSS vulnerability.
Version 4.2.10
May 31, 2023
- An error notification is now displayed when attempting to delete a user with existing orders or subscriptions. (#3071, #3070)
- Added support for linking to products and variants from CKEditor fields. (#3150)
- Fixed a bug where custom field conditions weren’t showing when editing a shipping zone.
- Fixed a bug where discounts’ user condition values weren’t getting migrated properly when upgrading to Commerce 4. (#3176)
- Fixed a bug where users weren’t permitted to update their subscriptions on the front-end. (#3155)
- Fixed a PHP error that could occur when calling
craft\commerce\services\Payments::processPayment()without passing the new$redirectDataargument.
Version 4.2.9
May 25, 2023
- The
commerce/cart/update-cartaction now acceptsclearAddresses,clearBillingAddress, andclearShippingAddressparams. - Fixed a JavaScript error that occurred when switching control panel tabs on small screens. (#3162)
- Fixed a bug where the
commerce/upgradecommand wasn’t migrating discounts’ and coupons’ Max Uses values properly. (#2947)
Version 4.2.8
May 3, 2023
- Added
craft\commerce\services\Customers::EVENT_UPDATE_PRIMARY_PAYMENT_SOURCE. - Fixed a bug where PDFs could be generated using the wrong formatting locale. (#3145)
Version 4.2.7
April 13, 2023
- Added the “Order Site” order condition rule. (#3131)
- Email jobs are now reattempted up to five times on failure. (#3121)
- Fixed a bug where variants weren’t getting propagated properly when new sites were created. (#3124)
- Fixed a bug where the flash message that was shown for order status changes could be malformed, if there were any errors. (#3116)
- Fixed a bug where Commerce widgets’ “Order Statuses” settings’ instruction text wasn’t getting translated.
- Fixed a bug where the flash message displayed when tax settings failed to save on Commerce Lite wasn’t getting translated.
- Fixed a bug where the
commerce/upgradecommand could fail if there was a large number of orphaned customers.
Version 4.2.6
March 22, 2023
- Discounts’ “Match Customer” conditions can now have a “Signed In” rule.
- Added
craft\commerce\base\Gateway::showPaymentFormSubmitButton() - Added
craft\commmerce\elements\conditions\customer\SignedInConditionRule. - The
commerce/payments/payaction now includes aredirectDatakey in JSON responses. - Fixed a PHP error that could occur when processing a payment. (#3092)
- Fixed a bug where cart cookies weren’t getting removed on logout, if the
defaultCookieDomainCraft config setting was set. (#3091) - Fixed a bug where the
validateCartCustomFieldsOnSubmissionsetting wasn’t being respected in Craft 4.4. (#3109) - Fixed a bug where the “Tax Zone” and “Tax Category” selects could be incorrectly populated when editing a tax category.
- Fixed a PHP error that occurred when saving a tax zone with an empty name on Commerce Lite. (#3089)
- Fixed a PHP error that occurred when saving shipping settings with empty “Shipping Base Rate” or “Shipping Per Item Rate” settings on Commerce Lite.
- Fixed a bug where the flash message that was shown for order status changes was malformed. (#3116)
- Fixed a PHP error that could occur when creating an order in the control panel. (#3115)
Version 4.2.5.1
February 2, 2023
- Fixed a PHP error that occurred when retrieving orders with missing line item descriptions or SKUs. (#2936)
Version 4.2.5
February 1, 2023
- Added support for searching for orders by customer name. (#3050)
- Fixed a PHP error that occurred if
nullwas passed tocraft\commerce\services\Discounts::getDiscountByCode(). (#3045) - Fixed a bug where a large number of shipping rule category queries could be executed.
- Fixed a PHP error that occurred if a product was re-saved before it had finished propagating to all sites. (#1954)
- Fixed a PHP error that occurred if
craft\commerce\services\ProductTypes::getEditableProductTypes()was called when no user was logged in. - Fixed a PHP error that occurred when saving an invalid shipping method.
- Fixed a bug where gateways’ “Enabled for customers to select during checkout” setting wasn’t properly supporting environment variables. (#3052)
- Fixed a PHP error that could occur when entering values on an Edit Discount page. (#3067)
- Fixed a PHP error that could occur when validating an address’s Organization Tax ID field. (#3046)
Version 4.2.4
November 29, 2022
- The “Customer” order condition rule now supports orders with no customer.
Version 4.2.3
November 23, 2022
- Fixed a bug where saving an invalid tax category failed silently. (#3013)
- Fixed a bug where using the
autoSetNewCartAddressesconfig setting was getting applied for guest carts. - Fixed an error that could occur when purging inactive carts.
- Fixed a bug where products and variants weren’t always available as link options in Redactor. (#3041)
Version 4.2.2
November 6, 2022
Fixed
- Fixed a bug where saving an invalid tax category doesn't return an error notice.
- Fixed an error that could occur when purging inactive carts.
- Fixed a bug where the
commerce/cart/update-cartaction wasn’t fully clearing the cart when theclearLineItemsparam was submitted, if the quantity of an exsiting line item was being increased in the same request. (#3014) - Fixed an error that could occur when purging a large number of inactive carts.
- Fixed an error where addresses were assumed to have an owner. (#3021)
Version 4.2.1
October 27, 2022
- Fixed an error that occurred when viewing tax categories.
- Fixed a bug where the Top Products widget wasn’t showing the correct revenue total.
- Added
craft\commerce\models\TaxCategory::dateDeleted. - Added
craft\commerce\models\ShippingCategory::dateDeleted.
Version 4.2.0
October 26, 2022
Store Management
- Discounts’ “Match Customer” conditions can now have a “Has Orders” rule.
- Order conditions can now have a “Completed” rule.
- Order conditions can now have a “Customer” rule.
- Order conditions can now have a “Date Ordered” rule.
- Order conditions can now have a “Has Purchasable” rule.
- Order conditions can now have a “Item Subtotal” rule.
- Order conditions can now have a “Order Status” rule.
- Order conditions can now have a “Paid” rule.
- Order conditions can now have a “Reference” rule.
- Order conditions can now have a “Shipping Method” rule.
- Order conditions can now have a “Total” rule.
- Order conditions can now have a “Total Discount” rule.
- Order conditions can now have a “Total Price” rule.
- Order conditions can now have a “Total Qty” rule.
- Order conditions can now have a “Total Tax” rule.
- It’s now possible to assign primary payment sources on customers.
- It’s now possible to set the quantity when adding a line item on the Edit Order page. (#2993)
- The “Update Order Status…” bulk order action now returns a more helpful response message.
Administration
- Added the
autoSetPaymentSourceconfig setting, which can be enabled to automatically set a customers’ primary payment sources on new carts. - Shipping and tax categories are now archived instead of deleted.
Development
- Order queries now have
itemTotal,itemSubtotal,shippingMethodHandle,totalDiscount,total,totalPaid,totalPrice,totalQty, andtotalTaxparams. - Order queries’
referenceparams now accept a wider range of values. commerce/cart/*actions now returnshippingAddressandbillingAddressvalues in JSON responses. (#2921)
Extensibility
- Added
craft\commerce\base\Stat::getOrderStatuses(). - Added
craft\commerce\base\Stat::setOrderStatuses(). - Added
craft\commerce\base\StatInterface::getOrderStatuses(). - Added
craft\commerce\base\StatInterface::setOrderStatuses(). - Added
craft\commerce\base\StatWidgetTrait. - Added
craft\commerce\behaviors\CustomerBehavoir::getPrimaryPaymentSource(). - Added
craft\commerce\behaviors\CustomerBehavoir::getPrimaryPaymentSourceId(). - Added
craft\commerce\behaviors\CustomerBehavoir::setPrimaryPaymentSourceId(). - Added
craft\commerce\controllers\PaymentSourcesController::actionSetPrimaryPaymentSource(). - Added
craft\commerce\elements\Order::$storedTotalQty. - Added
craft\commerce\elements\Order::autoSetPaymentSource(). - Added
craft\commerce\elements\conditions\customers\HasOrdersConditionRule. - Added
craft\commerce\elements\conditions\orders\CompletedConditionRule. - Added
craft\commerce\elements\conditions\orders\CustomerConditionRule. - Added
craft\commerce\elements\conditions\orders\DateOrderedConditionRule. - Added
craft\commerce\elements\conditions\orders\HasPurchasableConditionRule. - Added
craft\commerce\elements\conditions\orders\ItemSubtotalConditionRule. - Added
craft\commerce\elements\conditions\orders\ItemTotalConditionRule. - Added
craft\commerce\elements\conditions\orders\OrderCurrencyValuesAttributeConditionRule. - Added
craft\commerce\elements\conditions\orders\OrderStatusConditionRule. - Added
craft\commerce\elements\conditions\orders\OrderTextValuesAttributeConditionRule. - Added
craft\commerce\elements\conditions\orders\PaidConditionRule. - Added
craft\commerce\elements\conditions\orders\ReferenceConditionRule. - Added
craft\commerce\elements\conditions\orders\ShippingMethodConditionRule. - Added
craft\commerce\elements\conditions\orders\TotalConditionRule. - Added
craft\commerce\elements\conditions\orders\TotalDiscountConditionRule. - Added
craft\commerce\elements\conditions\orders\TotalPriceConditionRule. - Added
craft\commerce\elements\conditions\orders\TotalQtyConditionRule. - Added
craft\commerce\elements\conditions\orders\TotalTaxConditionRule. - Added
craft\commerce\elements\db\OrderQuery::$itemSubtotal. - Added
craft\commerce\elements\db\OrderQuery::$itemTotal. - Added
craft\commerce\elements\db\OrderQuery::$shippingMethodHandle. - Added
craft\commerce\elements\db\OrderQuery::$totalDiscount. - Added
craft\commerce\elements\db\OrderQuery::$totalPaid. - Added
craft\commerce\elements\db\OrderQuery::$totalPrice. - Added
craft\commerce\elements\db\OrderQuery::$totalQty. - Added
craft\commerce\elements\db\OrderQuery::$totalTax. - Added
craft\commerce\elements\db\OrderQuery::$total. - Added
craft\commerce\elements\db\OrderQuery::itemSubtotal(). - Added
craft\commerce\elements\db\OrderQuery::itemTotal(). - Added
craft\commerce\elements\db\OrderQuery::shippingMethodHandle(). - Added
craft\commerce\elements\db\OrderQuery::total(). - Added
craft\commerce\elements\db\OrderQuery::totalDiscount(). - Added
craft\commerce\elements\db\OrderQuery::totalPaid(). - Added
craft\commerce\elements\db\OrderQuery::totalPrice(). - Added
craft\commerce\elements\db\OrderQuery::totalQty(). - Added
craft\commerce\elements\db\OrderQuery::totalTax(). - Added
craft\commerce\models\PaymentSource::getIsPrimary(). - Added
craft\commerce\models\Settings::$autoSetPaymentSource. - Added
craft\commerce\records\Customer::$primaryPaymentSourceId. - Added
craft\commerce\services\savePrimaryPaymentSourceId(). craft\commerce\elements\Order::hasMatchingAddresses()now has an$attributesargument, which can be used to customize which address attributes should be checked.- Deprecated
craft\commerce\elements\Order::getShippingMethod().$shippingMethodNameand$shippingMethodHandleshould be used instead.
System
- Craft Commerce now requires Craft CMS 4.3.0 or later.
- Fixed a bug where it wasn't possible to use a path value for the
loadCartRedirectUrlsetting. (#2992) - Fixed a bug where custom shipping methods weren’t applying to orders properly. (#2986)
- Fixed a bug where passing an invalid product type handle into product queries’
typeparams wouldn’t have any effect. (#2966) - Fixed a bug where payments made from Edit Order pages weren’t factoring in gateways’
availableForUseWithOrder()methods. (#2988) - Fixed a bug where the Emails index page wasn’t showing emails’ template paths. (#3000)
- Fixed a bug where product slideout editors were showing additional status fields. (#3010)
Version 4.1.3
October 7, 2022
Changed
- The
commerce/downloads/pdfaction now accepts aninlineparam. (#2981)
Fixed
- Fixed a SQL error that occurred when restoring a soft-deleted product. (#2982)
- Fixed a bug where the Edit Product page wasn’t handling site selection changes properly. (#2971)
- Fixed a bug where it wasn't possible to add variants to a sale from the Edit Product page. (#2976)
- Fixed a bug where primary addresses weren’t being automatically set on the Edit Order page. (#2963)
- Fixed a bug where it wasn’t possible to change the default order status. (#2915)
Version 4.1.2
September 15, 2022
Fixed
- Fixed a SQL error that could occur when updating to Commerce 4 on MySQL.
- Fixed an error that could when sorting orders by address attributes. (#2956)
- Fixed a bug where it wasn’t possible to save decimal numbers for variant dimensions. (#2540)
- Fixed a bug where the Edit Product page wasn’t handling site selection changes properly. (#2920)
- Fixed a bug where partial elements were not being deleted during garbage collection.
- Fixed a bug where orders’ item subtotals weren’t being saved to the database.
- Fixed a bug where the “Per Item Amount Off” setting on Edit Discount pages was stripping decimal values for locales that use commas for decimal symbols. (#2937)
Version 4.1.1
September 1, 2022
Fixed
- Fixed a bug where Edit Subscription pages were blank. (#2913)
- Fixed a bug where
craft\commerce\elements\Order::hasMatchingAddresses()wasn’t checking thefullNameproperty. (#2917) - Fixed a bug where discounts’ Purchase Total values weren’t getting saved.
- Fixed a bug where discounts’ shipping address conditions were being saved as billing address conditions. (#2938)
- Fixed an error that occurred when exporting orders using the “Expanded” export type. (#2953)
- Fixed a bug where it wasn’t possible to clear out variants’ min and max quantities. (#2954)
Version 4.1.0
July 19, 2022
Added
- Tax rates now have a “Unit price” taxable subject option. (#2883)
- The Total Revenue widget can now show the total paid, rather than the total invoiced. (#2852)
- Added the
commerce/transfer-customer-datacommand. - Added
craft\commerce\elements\Order::EVENT_BEFORE_APPLY_ADD_NOTICE. (#2676) - Added
craft\commerce\elements\Order::hasMatchingAddresses(). - Added
craft\commerce\services\Customers::transferCustomerData(). (#2801) - Added
craft\commerce\stats\TotalRevenue::$type. - Added
craft\commerce\stats\TotalRevenue::TYPE_TOTAL_PAID. - Added
craft\commerce\stats\TotalRevenue::TYPE_TOTAL. - Added
craft\commerce\widgets\TotalRevenue::$type.
Changed
- Craft Commerce now requires Dompdf 2.0.0 or later. (#2879)
- Addresses submitted to the cart are now validated. (#2874)
- Garbage collection now removes any orphaned variants, as well as partial donation, order, product, subscription, and variant data.
craft\commerce\elements\Productnow supports theEVENT_DEFINE_CACHE_TAGSevent.craft\commerce\elements\Variantnow supports theEVENT_DEFINE_CACHE_TAGSevent.
Fixed
- Fixed an error that occurred when disabling all variants on Edit Product pages.
- Fixed a bug where order address titles weren’t being updated correctly.
- Fixed a bug where it was possible to save an order with the same billing and shipping address IDs. (#2841)
- Fixed a bug where order addresses were not being saved with the
livescenario. - Fixed a PHP error that occurred when editing a subscription with custom fields.
- Fixed an infinite recursion bug that occurred when
autoSetCartShippingMethodOptionwas enabled. (#2875) - Fixed a bug where product slideout editors were attempting to create provisional drafts. (#2886)
Version 4.0.4
June 22, 2022
If you’ve already upgraded a site to Commerce 4, please go to Commerce → Promotions → Discounts and review your discounts’ coupons’ Max Uses values, as the
commerce/upgradecommand wasn’t migrating those values properly before this release.
Fixed
- Fixed a bug where
craft\commerce\services\PaymentSources::getAllGatewayPaymentSourcesByUserId()wasn’t passing along the user ID togetAllPaymentSourcesByCustomerId(). - Fixed an error that could occur when using a discount with a coupon code.
- Fixed a bug where it wasn’t possible to delete a shipping rule. (#2857)
- Fixed a bug where it wasn’t possible to subscribe and create a payment source simultaneously. (#2834)
- Fixed inaccurate PHP type declarations.
- Fixed errors that could occur when expiring, cancelling, or suspending a subscription. (#2831)
- Fixed a bug where the Order Value condition rule wasn’t working.
- Fixed a bug where the
commerce/upgradecommand wasn’t migrating discounts’ coupons’ Max Uses values properly.
Version 4.0.3
June 9, 2022
Deprecated
- Deprecated
craft\commerce\services\Orders::pruneDeletedField(). - Deprecated
craft\commerce\services\ProductType::pruneDeletedField(). - Deprecated
craft\commerce\services\Subscriptions::pruneDeletedField().
Fixed
Version 4.0.2
June 3, 2022
Fixed
- Fixed a bug where it wasn’t possible to set a coupon’s Max Uses setting to
0. - Fixed UI bugs in the “Update Order Status” modal. (#2821)
- Fixed a bug where the
commerce/upgradeconsole command caused customer discount uses to be reset. - Fixed a bug where the
commerce/upgradeconsole command would fail when multiple orders used the same email address with different casing.
Version 4.0.1
May 18, 2022
Changed
- Address forms in the example templates now include any Plain Text custom fields in the address field layout.
Fixed
- Fixed a bug where the
autoSetNewCartAddressessetting didn’t have any effect. (#2804) - Fixed a PHP error that occurred when making a payment on the Edit Order page. (#2795)
- Fixed a PHP error that occurred when duplicating addresses that wasn’t owned by a user.
- Fixed a bug where address cards appeared to be editable when viewing completed orders. (#2817)
- Fixed a front-end validation error that was raised incorrectly on address inputs in the example templates. (#2777)
Version 4.0.0
May 4, 2022
Added
- Customers are now native Craft user elements. (#2524, 2385)
- Discounts can now have condition builders, enabling flexible matching based on the order, user, and addresses. (#2290, #2296, #2299)
- Shipping zones can now have condition builders, enabling flexible matching based on the address. (#2290, #2296)
- Tax zones can now have condition builders, enabling flexible matching based on the address. (#2290, #2296)
- Discounts can now have multiple coupon codes, each with their own usage rules. (#2377, #2303, #2713)
- It’s now possible to bulk-generate coupon codes.
- It’s now possible to create orders from the Edit User page.
- Added a “Commerce” panel to the Debug Toolbar.
- Added “Edit”, “Create”, and “Delete” permissions for product types, sales, and discounts. (#174, #2400)
- Added the
|commercePaymentFormNamespaceTwig filter. - Added
craft\commerce\base\Zone. - Added
craft\commerce\behaviors\CustomerAddressBehavior. - Added
craft\commerce\behaviors\CustomerBehavior. - Added
craft\commerce\console\controllers\UpgradeController. - Added
craft\commerce\controllers\DiscountsController::DISCOUNT_COUNTER_TYPE_EMAIL. - Added
craft\commerce\controllers\DiscountsController::DISCOUNT_COUNTER_TYPE_TOTAL. - Added
craft\commerce\controllers\DiscountsController::DISCOUNT_COUNTER_TYPE_USER. - Added
craft\commerce\controllers\DiscountsController::actionGenerateCoupons(). - Added
craft\commerce\controllers\OrdersController::actionCreateCustomer(). - Added
craft\commerce\controllers\OrdersController::actionGetCustomerAddresses(). - Added
craft\commerce\controllers\OrdersController::actionGetOrderAddress(). - Added
craft\commerce\controllers\OrdersController::actionValidateAddress(). - Added
craft\commerce\controllers\OrdersController::enforceManageOrderPermissions(). - Added
craft\commerce\controllers\SubscriptionsController::enforceManageSubscriptionPermissions(). - Added
craft\commerce\elements\Order::$sourceBillingAddressId - Added
craft\commerce\elements\Order::$sourceShippingAddressId - Added
craft\commerce\elements\Product::canCreateDrafts(). - Added
craft\commerce\elements\Product::canDelete(). - Added
craft\commerce\elements\Product::canDeleteForSite(). - Added
craft\commerce\elements\Product::canDuplicate(). - Added
craft\commerce\elements\Product::canSave(). - Added
craft\commerce\elements\Product::canView(). - Added
craft\commerce\elements\Subscription::canView(). - Added
craft\commerce\elements\actions\UpdateOrderStatus::$suppressEmails. - Added
craft\commerce\events\CommerceDebugPanelDataEvent. - Added
craft\commerce\events\OrderStatusEmailsEvent. - Added
craft\commerce\events\PdfRenderEvent. - Added
craft\commerce\fieldlayoutelements\UserAddressSettings. - Added
craft\commerce\helpers\DebugPanel. - Added
craft\commerce\helpers\PaymentForm. - Added
craft\commerce\models\Coupon. - Added
craft\commerce\models\Discount::$couponFormat. - Added
craft\commerce\models\Discount::getCoupons(). - Added
craft\commerce\models\Discount::setCoupons(). - Added
craft\commerce\models\OrderHistory::$userId. - Added
craft\commerce\models\OrderHistory::$userName. - Added
craft\commerce\models\OrderHistory::getUser(). - Added
craft\commerce\models\ShippingAddressZone::condition. - Added
craft\commerce\models\Store. - Added
craft\commerce\models\TaxAddressZone::condition. - Added
craft\commerce\plugin\Services::getCoupons(). - Added
craft\commerce\record\OrderHistory::$userName. - Added
craft\commerce\records\Coupon. - Added
craft\commerce\records\OrderHistory::$userId. - Added
craft\commerce\records\OrderHistory::getUser(). - Added
craft\commerce\service\Store. - Added
craft\commerce\services\Carts::$cartCookieDuration. - Added
craft\commerce\services\Carts::$cartCookie. - Added
craft\commerce\services\Coupons. - Added
craft\commerce\services\Customers::ensureCustomer(). - Added
craft\commerce\services\Customers::savePrimaryBillingAddressId(). - Added
craft\commerce\services\Customers::savePrimaryShippingAddressId(). - Added
craft\commerce\services\Discounts::clearUserUsageHistoryById(). - Added
craft\commerce\services\OrderStatuses::EVENT_ORDER_STATUS_CHANGE_EMAILS. - Added
craft\commerce\services\Pdfs::EVENT_BEFORE_DELETE_PDF. - Added
craft\commerce\services\ProductTypes::getCreatableProductTypeIds(). - Added
craft\commerce\services\ProductTypes::getCreatableProductTypes(). - Added
craft\commerce\services\ProductTypes::getEditableProductTypeIds(). - Added
craft\commerce\services\ProductTypes::hasPermission(). - Added
craft\commerce\validators\CouponValidator. - Added
craft\commerce\validators\StoreCountryValidator. - Added
craft\commerce\web\assets\coupons\CouponsAsset.
Changed
- Craft Commerce now requires Craft CMS 4.0.0-RC2 or later.
- Tax rate inputs no longer require the percent symbol.
- Subscription plans are no longer accessible via old Control Panel URLs.
- Addresses can no longer be related to both a user’s address book and an order at the same time. (#2457)
- Gateways’
isFrontendEnabledsettings now support environment variables. - The active cart number is now stored in a cookie rather than the PHP session data, so it can be retained across browser reboots. (#2790)
- The installer now archives any database tables that were left behind by a previous Craft Commerce installation.
commerce/*actions no longer acceptorderNumberparams.numbercan be used instead.commerce/cart/*actions no longer acceptcartUpdatedNoticeparams.successMessagecan be used instead.commerce/cart/*actions no longer includeavailableShippingMethodsin their JSON responses.availableShippingMethodOptionscan be used instead.commerce/payment-sources/*actions no longer includepaymentFormin their JSON responses.paymentFormErrorscan be used instead.commerce/payments/*actions now expect payment form fields to be namespaced with the|commercePaymentFormNamespaceTwig filter’s response.craft\commerce\elements\Order::getCustomer()now returns acraft\elements\Userobject.craft\commerce\elements\Product::getVariants(),getDefaultVariant(),getCheapestVariant(),getTotalStock(), andgetHasUnlimitedStock()now only return data related to enabled variants by default.craft\commerce\model\ProductType::$titleFormatwas renamed to$variantTitleFormat.craft\commerce\models\TaxRate::getRateAsPercent()now returns a localized value.craft\commerce\services\LineItems::createLineItem()no longer has an$orderIdargument.craft\commerce\services\LineItems::resolveLineItem()now has an$orderargument rather than$orderId.craft\commerce\services\Pdfs::EVENT_AFTER_RENDER_PDFnow raisescraft\commerce\events\PdfRenderEventrather thanPdfEvent.craft\commerce\services\Pdfs::EVENT_AFTER_SAVE_PDFnow raisescraft\commerce\events\PdfEventrather thanPdfSaveEvent.craft\commerce\services\Pdfs::EVENT_BEFORE_RENDER_PDFnow raisescraft\commerce\events\PdfRenderEventrather thanPdfEvent.craft\commerce\services\Pdfs::EVENT_BEFORE_SAVE_PDFnow raisescraft\commerce\events\PdfEventrather thanPdfSaveEvent.craft\commerce\services\ShippingMethods::getAvailableShippingMethods()has been renamed togetMatchingShippingMethods().craft\commerce\services\Variants::getAllVariantsByProductId()now accepts a$includeDisabledargument.
Deprecated
- Deprecated
craft\commerce\elements\Order::getUser().getCustomer()should be used instead. - Deprecated
craft\commerce\services\Carts::getCartName().$cartCookie['name']should be used instead. - Deprecated
craft\commerce\services\Plans::getAllGatewayPlans().getPlansByGatewayId()should be used instead. - Deprecated
craft\commerce\services\Subscriptions::doesUserHaveAnySubscriptions().doesUserHaveSubscriptions()should be used instead. - Deprecated
craft\commerce\services\Subscriptions::getSubscriptionCountForPlanById().getSubscriptionCountByPlanId()should be used instead. - Deprecated
craft\commerce\services\TaxRates::getTaxRatesForZone().getTaxRatesByTaxZoneId()should be used instead. - Deprecated
craft\commerce\services\Transactions::deleteTransaction().deleteTransactionById()should be used instead.
Removed
- Removed the
orderPdfFilenameFormatsetting. - Removed the
orderPdfPathsetting. - Removed the
commerce-manageCustomerspermission. - Removed the
commerce-manageProductspermission. - Removed
json_encode_filteredTwig filter. - Removed the
commerce/orders/purchasable-searchaction.commerce/orders/purchasables-tablecan be used instead. - Removed
Plugin::getInstance()->getPdf().getPdfs()can be used instead. - Removed
craft\commerce\Plugin::t().Craft::t('commerce', 'My String')can be used instead. - Removed
craft\commerce\base\AddressZoneInterface.craft\commerce\base\ZoneInterfacecan be used instead. - Removed
craft\commerce\base\OrderDeprecatedTrait. - Removed
craft\commerce\controllers\AddressesController. - Removed
craft\commerce\controllers\CountriesController. - Removed
craft\commerce\controllers\CustomerAddressesController. - Removed
craft\commerce\controllers\CustomersController. - Removed
craft\commerce\controllers\PlansController::actionRedirect(). - Removed
craft\commerce\controllers\ProductsPreviewController::actionSaveProduct(). - Removed
craft\commerce\controllers\ProductsPreviewController::enforceProductPermissions(). - Removed
craft\commerce\controllers\StatesController. - Removed
craft\commerce\elements\Order::getAdjustmentsTotalByType().getTotalTax(),getTotalDiscount(), orgetTotalShippingCost()can be used instead. - Removed
craft\commerce\elements\Order::getAvailableShippingMethods().getAvailableShippingMethodOptions()can be used instead. - Removed
craft\commerce\elements\Order::getOrderLocale().$orderLanguagecan be used instead. - Removed
craft\commerce\elements\Order::getShippingMethodId().getShippingMethodHandle()can be used instead. - Removed
craft\commerce\elements\Order::getShouldRecalculateAdjustments().getRecalculationMode()can be used instead. - Removed
craft\commerce\elements\Order::getTotalTaxablePrice(). The taxable price is now calculated within the tax adjuster. - Removed
craft\commerce\elements\Order::removeEstimatedBillingAddress().setEstimatedBillingAddress(null)can be used instead. - Removed
craft\commerce\elements\Order::removeEstimatedShippingAddress().setEstimatedShippingAddress(null)can be used instead. - Removed
craft\commerce\elements\Order::setShouldRecalculateAdjustments().setRecalculationMode()can be used instead. - Removed
craft\commerce\elements\actions\DeleteOrder.craft\elements\actions\Deletecan be used instead. - Removed
craft\commerce\elements\actions\DeleteProduct.craft\elements\actions\Deletecan be used instead. - Removed
craft\commerce\elements\traits\OrderDeprecatedTrait. - Removed
craft\commerce\events\AddressEvent. - Removed
craft\commerce\events\CustomerAddressEvent. - Removed
craft\commerce\events\CustomerEvent. - Removed
craft\commerce\events\DefineAddressLinesEvent.craft\services\Addresses::formatAddress()can be used instead. - Removed
craft\commerce\events\LineItemEvent::isValid. - Removed
craft\commerce\events\PdfSaveEvent. - Removed
craft\commerce\helpers\Localization::formatAsPercentage(). - Removed
craft\commerce\models\Country. - Removed
craft\commerce\models\Discount::$code. - Removed
craft\commerce\models\Discount::getDiscountUserGroups(). - Removed
craft\commerce\models\Discount::getUserGroupIds(). Discount user groups were migrated to the customer condition rule. - Removed
craft\commerce\models\Discount::setUserGroupIds(). Discount user groups were migrated to the customer condition rule. - Removed
craft\commerce\models\Email::getPdfTemplatePath().getPdf()->getTemplatePath()can be used instead. - Removed
craft\commerce\models\LineItem::getAdjustmentsTotalByType().getTax(),getDiscount(), orgetShippingCost()can be used instead. - Removed
craft\commerce\models\LineItem::setSaleAmount(). - Removed
craft\commerce\models\OrderHistory::$customerId.$userIdcan be used instead. - Removed
craft\commerce\models\OrderHistory::getCustomer().getUser()can be used instead. - Removed
craft\commerce\models\ProductType::getLineItemFormat(). - Removed
craft\commerce\models\ProductType::setLineItemFormat(). - Removed
craft\commerce\models\Settings::$showCustomerInfoTab.$showEditUserCommerceTabcan be used instead. - Removed
craft\commerce\models\ShippingAddressZone::getCountries(). - Removed
craft\commerce\models\ShippingAddressZone::getCountriesNames(). - Removed
craft\commerce\models\ShippingAddressZone::getCountryIds(). - Removed
craft\commerce\models\ShippingAddressZone::getStateIds(). - Removed
craft\commerce\models\ShippingAddressZone::getStates(). - Removed
craft\commerce\models\ShippingAddressZone::getStatesNames(). - Removed
craft\commerce\models\ShippingAddressZone::isCountryBased. - Removed
craft\commerce\models\State. - Removed
craft\commerce\models\TaxAddressZone::getCountries(). - Removed
craft\commerce\models\TaxAddressZone::getCountriesNames(). - Removed
craft\commerce\models\TaxAddressZone::getCountryIds(). - Removed
craft\commerce\models\TaxAddressZone::getStateIds(). - Removed
craft\commerce\models\TaxAddressZone::getStates(). - Removed
craft\commerce\models\TaxAddressZone::getStatesNames(). - Removed
craft\commerce\models\TaxAddressZone::isCountryBased. - Removed
craft\commerce\queue\jobs\ConsolidateGuestOrders. - Removed
craft\commerce\records\Country. - Removed
craft\commerce\records\CustomerAddress.craft\records\Addresscan be used instead. - Removed
craft\commerce\records\Discount::CONDITION_USER_GROUPS_ANY_OR_NONE. Discount user groups were migrated to the customer condition rule. - Removed
craft\commerce\records\Discount::CONDITION_USER_GROUPS_EXCLUDE. Discount user groups were migrated to the customer condition rule. - Removed
craft\commerce\records\Discount::CONDITION_USER_GROUPS_INCLUDE_ALL. Discount user groups were migrated to the customer condition rule. - Removed
craft\commerce\records\Discount::CONDITION_USER_GROUPS_INCLUDE_ANY. Discount user groups were migrated to the customer condition rule. - Removed
craft\commerce\records\DiscountUserGroup. - Removed
craft\commerce\records\OrderHistory::getCustomer().getUser()can be used instead. - Removed
craft\commerce\records\ShippingZoneCountry. - Removed
craft\commerce\records\ShippingZoneState. - Removed
craft\commerce\records\State. - Removed
craft\commerce\records\TaxZoneCountry. - Removed
craft\commerce\records\TaxZoneState. - Removed
craft\commerce\services\Addresses::purgeOrphanedAddresses(). - Removed
craft\commerce\services\Addresses. - Removed
craft\commerce\services\Countries. - Removed
craft\commerce\services\Customers::EVENT_AFTER_SAVE_CUSTOMER_ADDRESS. - Removed
craft\commerce\services\Customers::EVENT_AFTER_SAVE_CUSTOMER. - Removed
craft\commerce\services\Customers::EVENT_BEFORE_SAVE_CUSTOMER_ADDRESS. - Removed
craft\commerce\services\Customers::EVENT_BEFORE_SAVE_CUSTOMER. - Removed
craft\commerce\services\Customers::SESSION_CUSTOMER. - Removed
craft\commerce\services\Customers::consolidateOrdersToUser(). - Removed
craft\commerce\services\Customers::deleteCustomer(). - Removed
craft\commerce\services\Customers::forgetCustomer(). - Removed
craft\commerce\services\Customers::getAddressIds(). - Removed
craft\commerce\services\Customers::getCustomer(). - Removed
craft\commerce\services\Customers::getCustomerById(). - Removed
craft\commerce\services\Customers::getCustomerByUserId(). - Removed
craft\commerce\services\Customers::getCustomerId(). - Removed
craft\commerce\services\Customers::getCustomersQuery(). - Removed
craft\commerce\services\Customers::purgeOrphanedCustomers(). - Removed
craft\commerce\services\Customers::saveAddress(). - Removed
craft\commerce\services\Customers::saveCustomer(). - Removed
craft\commerce\services\Customers::saveUserHandler(). - Removed
craft\commerce\services\Discounts::EVENT_BEFORE_MATCH_LINE_ITEM.EVENT_DISCOUNT_MATCHES_LINE_ITEMcan be used instead. - Removed
craft\commerce\services\Discounts::getOrderConditionParams().$order->toArray()can be used instead. - Removed
craft\commerce\services\Discounts::populateDiscountRelations(). - Removed
craft\commerce\services\Orders::cartArray().toArray()can be used instead. - Removed
craft\commerce\services\Payments::getTotalAuthorizedForOrder(). - Removed
craft\commerce\services\Payments::getTotalAuthorizedOnlyForOrder().craft\commerce\elements\Order::getTotalAuthorized()can be used instead. - Removed
craft\commerce\services\Payments::getTotalPaidForOrder().craft\commerce\elements\Order::getTotalPaid()can be used instead. - Removed
craft\commerce\services\Payments::getTotalRefundedForOrder(). - Removed
craft\commerce\services\Sales::populateSaleRelations(). - Removed
craft\commerce\services\States.