- Fixed changelog version typo
- Added the ability to place a note on a refund transaction.
- Added
craft\commerce\services\TaxCategories::getAllTaxCategoriesAsList()
.
- Fixed a JavaScript error on the Edit Product Type page.
- Fixed a bug where the state was not saving correctly on the Store Location settings page.
- Fixed a bug where line items with zero quantity were not ignored when adding multiple items to the cart. (#330)
- Fixed a bug where variants weren't getting saved in the user-defined order on the Edit Product page. (#337)
- Fixed a bug where zero-value shipping adjustments were getting added to line items when only a base rate existed.
- Fixed a bug where
craft\commerce\elements::getDefaultVariant()
was not returning the default variant.
- Added the
craft\commerce\elements\Order::EVENT_AFTER_ADD_LINE_ITEM
event.
- Fixed a bug where variant fields did not appear on the Edit Product page if no product fields existed. (#317)
- Fixed a bug where subscription payment details were not being syntax-highlighted.
- Fixed a PHP error that occurred when saving the primary payment currency while using PostgreSQL.
- Fixed a bug where trial status was being incorrectly reported by subscriptions.
- Fixed a bug where it was impossible to pay with a stored payment source.
- Added
craft\commerce\elements\db\VariantQuery::hasSales()
.
- Fixed a bug on the Edit Order page where the info buttons on line items were unresponsive. (#297)
- Fixed a bug where customer addresses were not editable from the Edit User page. (#315)
- Fixed a PHP error that occurred when submitting a payment source at checkout. (#313)
- Fixed a PHP error that occurred when submitting a gateway choice at checkout. (#312)
- Fixed a PHP error that occurred when calling
count()
on a variant query. - Fixed a PHP 7.0 compatibility issue. (#305)
- Fixed a PHP 7.2 compatibility issue. (#308)
- Fixed a PHP error that occurred when purging abandoned carts without an email.
- Updating from Commerce 1.x now requires that Commerce 1.2.1360 or greater is installed.
- Fixed an SQL error that occurred when updating from Commerce 1.x that had existing discounts. (#299)
- Fixed currency editing template where it was calling deprecated methods (#303)
- Fixed a bug where visiting the payment currencies settings page could result in fatal error on new installs.
- Fixed a SQL error that occurred when installing Commerce.
- Fixed a SQL error that occurred when updating from Commerce 1.x.
- Added 'Copy' Reference tag to Product actions.
- Added the possibility for users to save payment sources.
- Added subscriptions features for gateways that support them.
- Added
craft\commerce\services\PaymentSources
service. - Added
craft\commerce\services\Plans
service. - Added
craft\commerce\services\Subscriptions
service. - Added additional ways for sales to affect the price of matching products.
- Added
paidStatus
attribute to the Order element. - Added
craft.variants
twig variable which returns the new VariantQuery class. - Added
craft.subscriptions
twig variable which returns the new SubscriptionQuery class. - Added the ability for any purchasable to have sales.
- Added ability to have sales applied based on a Craft category related to a purchasable.
- Added
craft\commerce\models\Customer::getPrimaryBillingAddress()
- Added
craft\commerce\models\Customer::getPrimaryShippingAddress()
- Added
craft\commerce\services\Address::getAddressByIdAndCustomerId()
- Added
craft\commerce\services\Customers::setLastUsedAddresses()
- Removed the
cartCookieDuration
config item. All carts are now related to php session. - Replaced
customer.lastUsedShippingAddress
andcustomer.lastUsedBillingAddress
withcustomer.primaryBillingAddress
andcustomer.primaryShippingAddress
- Removed
baseShipping
,baseDiscount
,baseTax
,baseTaxIncluded
attributes from the order model. Order's now have order level adjustments. - Removed
shipping
,discount
,tax
,taxIncluded
attributes from the line item model. Line item's now have line item level adjustments. - The Shipping Rule interface now expects a shipping category ID passed to each rate method.
paymentMethodSettings
setting is now calledgatewaySettings
and it now uses handles to reference gateways instead of IDs.Payment Methods
are now calledGateways
and this is reflected across the entire plugin and it's API.sendCartInfoToGateways
is now calledsendCartInfo
and is a per-gateway setting.requireEmailForAnonymousPayments
config setting removed as completed order now always require the correct email address to make anonymous payments on orders.Variant::setSalesApplied()
andVariant::getSalesApplied()
is now calledVariant::setSales()
andVariant::getSales()
respectively.OrderAdjustment::optionsJson
is now calledOrderAdjustment::sourceSnapshot
.- Removed the purchasable interface
PurchasableInterface::validateLineItem()
. Your purchasables should now usePurchasableInterface::getLineItemRules()
to add validation rules to line items. - The payment method overrides in commerce.php config file have been moved to a commerce-gateway.php config file.
- Vat ID validation is now using the MIT licenced dannyvankooten/vat.php
- The
Variants::EVENT_PURCHASE_VARIANT
event has been replaced byElementInterface::afterOrderComplete($lineItem)
craft\commerce\services\Cart
is nowcraft\commerce\services\Carts
craft\commerce\services\Carts::addToCart()
now requires acraft\commerce\models\LineItem
object as the second parameter.craft\commerce\services\LineItems::getLineItemByOrderPurchasableOptions()
is nowcraft\commerce\services\LineItems::resolveLineItem()
craft\commerce\services\Pdf::pdfForOrder()
is nowcraft\commerce\services\Pdf::renderPdfForOrder()
- Last addresses used by customers are no longer stored. Instead, customers have primary shipping and billing addresses.
craft\commerce\elements\Orders
now fires the following events:beforeCompleteOrder
, andafterCompleteOrder
.craft\commerce\services\Addresses
now fires the following events:beforeSaveAddress
, andafterSaveAddress
.craft\commerce\services\Carts
now fires the following events:beforeAddToCart
,afterAddToCart
,afterRemoveFromCart
and a cancelablebeforeRemoveFromCart
event.craft\commerce\services\Discounts
now fires the cancelablebeforeMatchLineItem
event.craft\commerce\services\Emails
now fires the following events:afterSendEmail
, and a cancelablebeforeSendEmail
.craft\commerce\services\LineLitems
now fires the following events:beforeSaveLineItem
,afterSaveLineItem
,createLineItem
, andpopulateLineItem
.craft\commerce\services\OrderHistories
now fires theorderStatusChange
event.craft\commerce\services\Payments
now fires the following events:beforeCaptureTransaction
,afterCaptureTransaction
,beforeRefundTransaction
,afterRefundTransaction
,afterProcessPaymentEvent
and a cancelablebeforeProcessPaymentEvent
event.craft\commerce\services\PaymentSources
now fires the following events:deletePaymentSource
,beforeSavePaymentSource
andafterSavePaymentSource
events.craft\commerce\services\Plans
fires the following events:archivePlan
,beforeSavePlan
andafterSavePlan
events.craft\commerce\services\Purchasables
fires theregisterPurchasableElementTypes
event.craft\commerce\services\Sales
now fires the cancelablebeforeMatchPurchasableSale
event.craft\commerce\services\Subscriptions
fires theexpireSubscription
,afterCreateSubscription
,afterReactivateSubscription
,afterSwitchSubscriptionPlan
,afterCancelSubscription
,beforeUpdateSubscription
,receiveSubscriptionPayment
and cancelablebeforeCreateSubscription
,beforeReactivateSubscription
,beforeSwitchSubscriptionPlan
andbeforeCancelSubscription
events.craft\commerce\services\Transactions
now fires theafterSaveTransaction
event.craft\commerce\services\Variants
now fires thepurchaseVariant
event.- Instead of the
commerce_modifyEmail
hook you should use the cancelablebeforeSendEmail
event fired bycraft\commerce\services\Emails
. - Instead of the
commerce_registerOrderAdjusters
hook you should use theregisterOrderAdjusters
event fired bycraft\commerce\services\OrderAdjustments
. - To register new gateway types, use the
registerGatewayTypes
event fired bycraft\commerce\services\Gateways
. - The
commerce_modifyOrderSources
,commerce_getOrderTableAttributeHtml
,commerce_getProductTableAttributeHtml
,commerce_defineAdditionalOrderTableAttributes
,commerce_defineAdditionalProductTableAttributes
hooks have been replaced by more generic Craft 3 hooks.
- Removed
craft\commerce\services\Countries::getCountryByAttributes()
- Removed
craft\commerce\services\States::getStatesByAttributes()
- Removed
craft\commerce\models\Customer::getLastUsedBillingAddress()
- Removed
craft\commerce\models\Customer::getLatUsedShippingAddress()
- Removed the
commerce_modifyGatewayRequestData
,commerce_modifyGatewayRequestData
andcommerce_modifyItemBag
hooks.