- Added a new template hook (
cp.commerce.product.edit.right-pane
) for the right pane of the edit product screen. - Added the
pdfAllowRemoteImages
config setting, which can be set totrue
to allow external images to be loaded in PDF templates.
- Fixed an issue in the example templates where the
same address
checkbox still being checked when different addresses where previously selected. - Fixed the error array returned from
commerce/customerAddresses/save
to include field names as the error keys.
- The order email address now always returns the user’s email address if the order was made as a registered user, even after the user changes their email address.
- Added the
autoSetNewCartAddresses
config setting, which can be set tofalse
to prevent Commerce from automatically assigning the last-used billing and shipping addresses on new carts.
- Fixed an API authentication error when making payments using the Stripe gateway.
- Fixed a bug where the
commerce/payments/pay
action was still processing the payment even if the cart had errors placed on it by other plugins. - Fixed a bug where
LineItemModel::onSale()
could sometimes return an incorrect response due to rounding errors. - Fixed a PHP error that could occur if a purchasable invalidated a line item when it was being added to a new cart.
- Fixed an issue where credit card forms’ First/Last Name fields were getting overridden by billing addresses’ values for some gateways.
- Fixed a bug where adding to cart with invalid
options
params would pass stock validation.
- Updated the Migs omnipay driver to 2.2.2
- Updated the Stripe omnipay driver to 2.4.7
- Percentage-based discounts now have the option to be applied to the item’s original price or its discounted price (if other discounts were already applied).
- Ajax requests to
commerce/cart/*
actions will now get aitemSubtotal
key in the response JSON. - Updated the Omnipay Stripe driver to 2.4.6.
- Updated the Omnipay Payment Express driver to 2.2.1.
- Updated the Omnipay MultiSafePay driver to 2.3.6.
- Updated the Omnipay Worldpay driver to 2.2.1.
- Fixed a bug where email address limits on discounts were able to by circumvented if the customer changed the casing of the coupon code.
- Fixed a PHP error that occurred when viewing a cart in the Control Panel if no payment methods had been created yet.
- Fixed a bug where discounts based on user group were not being added/removed after the user logged in/out.
- Fixed a bug where variants’ sale prices were only getting rounded when at least one sale was applied.
- Fixed a bug where special characters in Tax and Shipping Category names could break some form inputs in the Control Panel.
- Fixed a validation error that occurred when saving two shipping rules with the same name.
- Added the
pdfPaperSize
config setting. - Added the
pdfPaperOrientation
config setting. - Added a new Stripe gateway setting that determines whether the
receipt_email
param should be sent in payment requests. - Added the
commerce_transactions.onCreateTransaction
event, which enables plugins to modify a newly-created transaction model.
- Updated the Buckeroo driver to 2.2.
- Updated the Stripe driver to 2.4.5.
- Enabled the Buckeroo Credit Card Gateway within the Buckeroo Omnipay driver.
- Added support for Worldpay's new
v1
API.
- Fixed a bug where
VariantModel:onSale()
could sometimes return an incorrect response due to rounding errors. - Fixed a PHP error that occurred when saving a product with an empty dimension input on servers running PHP 7.
- Fixed a issue where orders were getting recalculated after receiving a completion response, when using the Sage Pay gateway.
- Fixed a PHP error that occurred when a plugin prevented a purchasable from getting added to the cart.
- Increased the tax rate decimal storage length to allow 3 decimal places in tax rate percentages.
- The
CommerceDbHelper
class has be deprecated.
- Fixed a bug where some characters in product names were getting double-encoded on Edit Order pages.
- Fixed a bug where orders were incorrectly recalculating their adjustments when receiving notifications from the SagePay payment gateway.
- Fixed a tax calculation bug that occurred when using the “Total Order Price” taxable subject.
- Added new “Taxable Subject” options to Tax Rates, enabling taxes to be applied at the order level.
- Added the
datePaid
order element criteria attribute.
- Updated the Dompdf package to 0.8.
- Updated the Omnipay Mollie driver to 3.2.
- Updated the Omnipay Authorize.net driver to 2.5.
- Updated the Omnipay MultiSafePay driver to 2.3.4.
- Fixed some PHP errors that occurred when rendering PDFs on servers running PHP 7.1.
- Added the
requireBillingAddressAtCheckout
config setting. - Added the
cp.commerce.order.main-pane
template hook to the Edit Order page. - Added
Commerce_VariantModel::hasStock()
.
- Fixed some PHP errors that occurred when saving products on servers running PHP 7.1.
- Fixed a bug where the
commerce/payments/pay
action was not blocking disabled payment methods. - Fixed a bug where old carts did not default to the primary payment currency when their current payment currency was no longer valid.
- Added the commerce_sale.onBeforeMatchProductAndSale event, which enables plugins to add custom matching logic to sales.
- Added the commerce_products.onBeforeEditProduct event.
- Added the
cp.commerce.product.edit
template hook to the Edit Product page.
- If a product SKU can’t be generated from its product type’s Automatic SKU Format, Commerce now logs why.
- Fixed some PHP errors that occurred on servers running PHP 7.1.
- Fixed a bug where line items could be removed if their
qty
param was missing from acommerce/cart/updateLineItem
request. - The Orders index page now displays zero-value currency amounts, instead of leaving the cell blank.
- Fixed bug where duplicate products could be displayed when editing sales when the User Groups condition was in use.
- Fixed a bug where the
isUnpaid
andisPaid
order element criteria params did not work correctly. - Fixed a PHP error that occurred if a plugin’s custom shipping method object didn’t inherit
BaseModel
. - Fixed a bug where payments made with MultiSafepay would be marked as successful before the user was redirected to the offsite gateway.
- Fixed a bug where shipping rule names were required to be unique across the entire installation, rather than per-shipping method.
- Added a new purgeInactiveCarts config setting, which determines whether Commerce should purge inactive carts from the database (
true
by default). - Added a new
commerce_modifyOrderAdjusters
hook, which enables plugins to modify the order adjusters before they are applied. - Added the “Shipping Method” and “Payment Method” table attribute options to the Orders index page.
- Updated the Stripe gateway library to 2.4.2.
- Updated the PayPal gateway library to 2.6.3.
- Fixed a memory error that occurred when purging a large number of carts.
- Fixed a bug where the
hasVariant
product criteria attribute would only account the first 100 variants. - Fixed a bug where custom order adjusters could not inspect earlier adjustments made to the order within the current recalculation.
- Fixed a bug where the default product type that gets created on installation was referencing the old
commerce
templates path, rather thanshop
. - Fixed compatibility with some payment gateways that were expecting abbreviated state names in the billing address.
- Fixed a PHP error that occurred when retrieving the sale price of variants that were fetched via
craft.commerce.products
.
- Added the commerce_modifyItemBag hook, allowing plugins to modify cart information sent to the payment gateway.
- Added the requireShippingAddressAtCheckout config setting.
- Added a new
defaultHeight
product criteria param, for querying products by their default variant’s height. - Added a new
defaultLength
product criteria param, for querying products by their default variant’s length. - Added a new
defaultWidth
product criteria param, for querying products by their default variant’s width. - Added a new
defaultWeight
product criteria param, for querying products by their default variant’s weight.
- Fixed a bug where sales were not being applied to variants that were fetched via
craft.commerce.variants
. - Fixed a bug where line items’
salePrice
were not reflecting any changes made to theirsaleAmount
via thelineItem.onPopulateLineItem
event.
- Commerce now includes a gateway adapter for Payeezy by First Data.
- Added Commerce_VariantModel::getSalesApplied(), which returns an array of the Commerce_SaleModel objects that were used to calculate the salePrice of the variant.
- Ajax requests to
commerce/cart/*
actions now include ‘subtotal’ and ‘shippingCategoryId’ properties in the response data. - The ‘commerce_orders/beforeOrderComplete’ event now gets fired a little later than before, giving plugins a chance to change the order status ID.
- Fixed a bug where MultiSafepay was not being treated as an offsite payment gateway.
- Added a new 'baseTax' attribute to order models, which can be modified by custom order adjusters to add taxes to the order as a whole.
- Commerce_OrderModel::getTotalTax() now includes the new 'baseTax' amount.
- Fixed a rounding error that occurred with some percentage-based discounts.
- Fixed a PHP error that occurred when searching for products with the 'hasVariants' criteria param, in some cases.
- Fixed a bug where discounts without a coupon code condition could apply before their start date.
- Fixed a bug where the
hasSales
product criteria attribute would only apply to the first 100 products. - Fixed a bug where the post-payment redirect would take the customer to the site homepage.
- Commerce now includes a gateway adapter for MultiSafepay.
- Ajax requests to ‘cart/updateCart’ now include a ‘cart’ object in the response data in the event of an error.
- Fixed a bug where PayPal payments could fail due to inconsistencies between how Commerce and PayPal calculated the total payment amount for transactions.
- Fixed a bug where First Name and Last Name customer field labels weren’t being translated for the current locale in the Control Panel.
- Fixed a bug some offsite gateway payment requests were not getting sent with the correct return and cancel URLs.
- Fixed a bug that prevented Commerce from updating successfully from pre-1.0 versions on case-sensitive file systems.
- Fixed a bug where applicable VAT taxes were not being removed correctly for customers with a valid VAT ID.
- Fixed a bug where archived payment methods were still showing up as options in Control Panel payment form modals.
- When saving a product type, if any tax/shipping categories had been deselected, Commerce will now reassign any existing products with the no-longer-available tax/shipping categories to the default categories.
- The “HTML Email Template Path” Email setting can now contain Twig code.
- Fixed a bug where Commerce was not respecting the system time zone when purging inactive carts.
- Fixed a bug where a no-longer-applicable shipping method could still be selected by a cart if it was the only defined shipping method.
- Fixed a bug where the Commerce_ProductModel provided by the onSaveProduct event was not updated with the latest and greatest values based on its default variant.
- Fixed a bug where all products were being re-saved when a product type was saved, rather than just the products that belong to that product type.
- Fixed a PHP error that occurred when adding something to the cart, if the cart didn’t have a shipping address yet and the default tax zone’s tax rate was marked as VAT.
- Fixed a bug where a coupon based discount could apply before its start date.
- Fixed a PHP error that occurred when a custom purchasable didn't provide a tax category ID.
- Fixed a bug where the relevant template caches were not being cleared after the stock of a variant was deducted.
- Fixed a display issue on the order transaction details modal when a large amount of gateway response data was present.
- Fixed a bug where orders were not being marked as complete after successful offsite gateway payments.
- Fixed a PHP error that occurred when deleting a product type.
- It is now possible to accept payments in multiple currencies.
- Added Shipping Categories.
- Discounts can now be user-sorted, which defines the order that they will be applied to carts.
- Discounts now have the option to prevent subsequent discounts from being applied.
- The start/end dates for Discounts and Sales can now specify the time of day.
- Discounts can now have a “Minimum Purchase Quantity” condition.
- Product Types now have an “Order Description Format” setting, which can be used to override the description of the products in orders’ line items.
- Addresses now have “Attention”, “Title”, and “Business ID” fields.
- Added the “Order PDF Filename Format” setting in Commerce → Settings → General Settings, for customizing the format of order PDF filenames.
- Added the ‘useBillingAddressForTax’ config setting. If enabled, Commerce will calculate taxes based on orders’ billing addresses, rather than their shipping addresses.
- Added the ‘requireEmailForAnonymousPayments’ config setting. If enabled, Commerce will require the email address of the order to be submitted in anonymous payment requests.
- The IP address of the customer is now stored on the order during order completion.
- Commerce now makes all payment gateways available to unregistered installs, rather than limiting users to a single “Dummy” gateway.
- Added support for SagePay Server.
- Added support for the Netbanx Hosted.
- Added the |commerceCurrency filter, which works identically to the |currency filter by default, but also has
convert
andformat
arguments that can be used to alter the behavior. - Added ‘craft.commerce.shippingMethods’.
- Added ‘craft.commerce.shippingCategories’.
- Added ‘craft.commerce.shippingZones’.
- Added ‘craft.commerce.taxZones’.
- Added OrderStatusService::getDefaultOrderStatusId().
- Added the ‘commerce_payments.onBeforeCaptureTransaction’ and ‘onCaptureTransaction’ events.
- Added the ‘commerce_payments.onBeforeRefundTransaction’ and ‘onRefundTransaction’ events.
- Added the ‘commerce_email.onBeforeSendEmail’ and ‘onSendEmail’ events.
- Added the ‘cp.commerce.order.edit’ hook to the Edit Order page template.
- Added the PHP Units of Measure PHP package.
- Added the Vat Validation PHP package.
- The tax categories returned by the template function ‘craft.commerce.getTaxCategories()’ are now represented by Commerce_TaxCategory models by default, rather than arrays. To get them returned as arrays, you can pass ‘true’ into the function.
- Status-change notification emails are now sent to the customer in the language they placed the order with.
- It’s now possible to update product statuses on the Products index page.
- The example templates folder has been renamed from “commerce” to “shop”.
- Commerce now re-saves existing products when a Product Type’s settings are saved.
- The Tax Rates index page now lists the Tax Categories and Tax Zones each Tax Rate uses.
- Tax Rates now have the option to exclude themselves from orders with a valid VAT ID.
- Transaction Info HUDs on Edit Order pages now show the transaction IDs.
- Commerce now stores the complete response data for gateway transaction requests in the commerce_transactions table.
- The commerce/cart/updateCart action now includes all validation errors found during partial cart updates in its response.
- Reduced the number of order recalculations performed during payment.
- The Edit Order page no longer labels an order as paid if its total price is zero.
- Commerce now logs invalid email addresses when attempting to send order status notification emails.
- Custom fields on an order can now only be updated during payment if it is the user’s active cart.
- Commerce now provides Stripe with the customer’s email address to support Stripe’s receipt email feature.
- Payment failures using PayPal Express now redirect the customer back to PayPal automatically, rather than displaying a message instructing the customer to return to PayPal.
- Updated the Authorize.Net gateway library to 2.4.2.
- Updated the Dummy gateway library to 2.1.2.
- Updated the Molli gateway library to 3.1.
- Updated the Payfast gateway library to 2.1.2.
- Updated the Payflow gateway library to 2.2.1.
- Updated the Stripe gateway library to 2.4.1.
- Deprecated the ‘update’ variable in email templates. Use ‘orderHistory’ instead, which returns the same Commerce_OrderHistoryModel.
- Fixed a bug where Commerce_OrderService::completeOrder() was not checking to make sure the order was not already completed before doing its thing.
- Fixed a bug where addresses’ “Map” links on Edit Order pages were not passing the full address to the Google Maps window.
- Fixed an bug where address validation was not respecting the country setting, “Require a state to be selected when this country is chosen”.
- Fixed a bug where submitting new addresses to a fresh cart caused a cart update failure.
- Fixed a bug where collapsed variants’ summary info was overlapping the “Default” button.
- Craft Commerce is now translated into Portuguese.
- Fixed a bug where Edit Address modals on Edit Order pages were not including custom states in the State field options.
- Fixed a PHP error that occurred when referencing the default currency.
- Fixed a bug where eager-loading product variants wasn't working.
- Fixed a bug where customer addresses were not showing up in the Edit Order page if they contained certain characters.
- Fixed a bug where orders were not getting marked as complete when they should have in some cases, due to a rounding comparison issue.
- Customer Info fields now return the user's CustomerModel when accessed in a template.
- Fixed a bug where discounts that apply free shipping to an order were not including the shipping reduction amount in the discount order adjustment amount.
- Fixed a bug where editing an address in the address book would unintentionally select that address as the active cart's shipping address.
- Fixed SagePay Server gateway support.
- Fixed an error that occurred when PayPal rejected a payment completion request due to duplicate counting of included taxes.
- Fixed a MySQL error that could occur when ElementsService::getTotalElements() was called for orders, products, or variants.
- Transaction dates are now shown on the Edit Order page.
- Order status change dates are now shown on the Edit Order page.
- Updated the Authorize.Net Omnipay gateway to 2.4, fixing issues with Authorize.Net support.
- Cart item information is now sent on gateway payment completion requests, in addition to initial payment requests.
- Fixed a bug where payments using Worldpay were not getting automatically redirected back to the store.
- Line item detail HUDs within the Edit Order page now include the items’ subtotals.
- Renamed Commerce_LineItemModel’s
subtotalWithSale
attribute tosubtotal
, deprecating the former. - Renamed Commerce_OrderModel’s
itemSubtotalWithSale
attribute toitemSubtotal
, deprecating the former. - Each of the nested arrays returned by
craft.commerce.availableShippingMethods
now include amethod
key that holds the actual shipping method object.
- Fixed a MySQL error that occurred when MySQL was running in Strict Mode.
- Fixed a rounding error that occurred when calculating tax on shipping costs.
- Added a new “Per Email Address Limit” condition to coupon-based discounts, which will limit the coupons’ use by email address.
- Added the ability to clear usage counters for coupon-based discounts.
- Added a new hasSales product criteria param, which can be used to limit the resulting products to those that have at least one applicable sale.
- Added a new hasPurchasables order criteria param, which can be used to limit the resulting orders to those that contain specific purchasables.
- Added a new commerce_lineItems.onPopulateLineItem event which is called right after a line item has been populated with a purchasable, and can be used to modify the line item attributes, such as its price.
- Added LineItemModel::getSubtotal() as an alias of the now-deprecated getSubtotalWithSale().
- Fixed a bug where the “Per User Limit” discount condition was not being enforced for anonymous users.
- Fixed a bug where the quantity was not being taken into account when calculating a weight-based shipping cost.
- Fixed a validation error that could occur when submitting a payment for an order with a percentage-based discount.
- Fixed a bug where the cart was not getting recalculated when an associated address was updated in the user’s address book.
- Fixed a bug where sales could be applied to the same line item more than once.
- Fixed a bug where the "commerce/cart/cartUpdate" controller action's Ajax response did not have up-to-date information.
- Added commerce_products.onBeforeDeleteProduct and onDeleteProduct events.
- Fixed a PHP error that occurred when adding a new item to the cart.
- Fixed a PHP error that occurred when saving a product with unlimited stock.
- It is now possible to show customers' names and companies' names on the Orders index page.
- Commerce now sends customers' full names to the payment gateways, pulled from the billing address.
- Commerce now ensures that orders' prices don't change in the middle of payment requests, and declines any payments where the price does change.
- The onBeforeSaveProduct event is now triggered earlier to allow more modification of the product model before saving.
- Updated the Omnipay gateway libraries to their latest versions.
- Fixed a bug where changes to purchasable prices were not reflected in active carts.
- Fixed a PHP error that occurred when an active cart contained a variant that had no stock or had been disabled.
- Fixed a PHP error that occurred when paying with the Paypal Express gateway.
- Added the commerce_lineItems.onCreateLineItem event.
- Added the hasStock variant criteria param, which can be set to
true
to find variants that have stock (including variants with unlimited stock).
- The View Order page now shows whether a coupon code was used on the order.
- All payment gateways support payments on the View Order page now.
- It is now possible to delete countries that are in use by tax/shipping zones and customer addresses.
- State-based tax/shipping zones now can match on the state abbreviation, in addition to the state name/ID.
- Commerce now sends descriptions of the line items to gateways along with other cart info, when the sendCartInfoToGateways config setting is enabled.
- Fixed a bug where payment method setting values that were set from config/commerce.php would get saved to the database when the payment method was resaved in the Control Panel.
- Fixed a PHP error that occurred when calling Commerce_OrderStatusesService::getAllEmailsByOrderStatusId() if the order status ID was invalid.
- Fixed a PHP error that occurred when a cart contained a disabled purchasable.
- Fixed a bug where an order status's sort order was forgotten when it was resaved.
- Fixed a bug where the hasVariant product criteria param was only checking the first 100 variants.
- Fixed a bug where only logged-in users could view a tokenized product preview URL.
- Fixed an issue where the selected shipping method was not getting removed from the cart when it was no longer available, in some cases.
- Added the commerce_products.onBeforeSaveProduct and onSaveProduct events.
- Added the commerce_lineItems.onBeforeSaveLineItem and onSaveLineItem events.
- Stock fields are now marked as required to make it more clear that they are.
- Added a new "The Fleece Awakens" default product.
- Fixed an error that occurred when a variant was saved without a price.
- Fixed a bug where various front-end templates wouldn't load correctly from the Control Panel if the defaultTemplateFileExtensions or indexTemplateFilename config settings had custom values.
- Fixed a bug where products'
defaultVariantId
property was not being set on first save. - Fixed a validation error that occurred when a cart was saved with a new shipping address and an existing billing address.
- Fixed a bug where customers' last-used billing addresses were not being remembered.
- Fixed a MySQL error that occurred when attempting to delete a user that had an order transaction history.
- Fixed an XSS vulnerability.
- Added the sendCartInfoToGateways config setting, which defines whether Commerce should send info about a cart's line items and adjustments when sending payment requests to gateways.
- Product models now have a
totalStock
property, which returns the sum of all available stock across all of a product's variants. - Product models now have an
unlimitedStock
property, which returns whether any of a product's variants have unlimited stock. - Added the commerce_variants.onOrderVariant event.
- Updated the Omnipay Authorize.Net driver to 2.3.1.
- Updated the Omnipay FirstData driver to 2.3.0.
- Updated the Omnipay Mollie driver to 3.0.5.
- Updated the Omnipay MultiSafePay driver to 2.3.0.
- Updated the Omnipay PayPal driver to 2.5.3.
- Updated the Omnipay Pin driver to 2.2.1.
- Updated the Omnipay SagePay driver to 2.3.1.
- Updated the Omnipay Stripe driver to v2.3.1.
- Updated the Omnipay WorldPay driver to 2.2.
- Fixed a bug where shipping address rules and tax rates were not finding their matching shipping zone in some cases.
- Fixed a bug where the credit card number validator was not removing non-numeric characters.
- Fixed a PHP error that occurred when saving an order from a console command.
- Ajax requests to the "commerce/payments/pay" controller action now include validation errors in the response, if any.
- Fixed a credit card validation bug that occurred when using the eWay Rapid gateway.
- Fixed an error that occurred on the Orders index page when searching for orders.
- Fixed a bug where refreshing the browser window after refunding or paying for an order on the Edit Order page would attempt to re-submit the refund/payment request.
- Fixed a bug where Commerce_PaymentsService::processPayment() was returning
false
when the order was already paid in full (e.g. due to a 100%-off coupon code). - Fixed a bug where variants were defaulting to disabled for products that only had a single variant.
- Added Slovak message translations.
- Added Shipping Zones, making it easier to relate multiple Shipping Methods/Rules to a common list of countries/states. (Existing Shipping Rules will be migrated to use Shipping Zones automatically.)
- Added a “Recent Orders” Dashboard widget that shows a table of recently-placed orders.
- Added a “Revenue” Dashboard widget that shows a chart of recent revenue history.
- The Orders index page now shows a big, beautiful revenue chart above the order listing.
- It is now possible to edit Billing and Shipping addresses on the Edit Order page.
- It is now possible to manually mark orders as complete on the Edit Order page.
- It is now possible to submit new order payments from the Edit Order page.
- Edit Product pages now have a "Save as a new product" option in the Save button menu.
- Edit Product pages now list any sales that are associated with the product.
- It is now possible to sort custom order statuses.
- It is now possible to sort custom payment methods.
- It is now possible to soft-delete payment methods.
- Added a “Link to a product” option to Rich Text fields’ Link menus, making it easy to create links to products.
- Added support for Omnipay “item bags”, giving gateways some information about the cart contents.
- Added the “gatewayPostRedirectTemplate” config setting, which can be used to specify the template that should be used to render the POST redirection page for gateways that require it.
- Added support for eager-loading variants when querying products, by setting the
with: 'variants'
product param. - Added support for eager-loading products when querying variants, by setting the
with: 'product'
variant param. - Added
craft.commerce.variants
for querying product variants with custom parameters. - Added the “defaultPrice” product criteria parameter, for querying products by their default variant’s price.
- Added the “hasVariant” product criteria parameter, for querying products that have a variant matching a specific criteria. (This replaces the now-deprecated “withVariant” parameter”.)
- Added the “stock” variant criteria parameter, for querying variants by their available stock.
- Added the “commerce/payments/pay” controller action, replacing the now-deprecated “commerce/cartPayment/pay” action.
- Added the “commerce/payments/completePayment” controller action, replacing the now-deprecated “commerce/cartPayment/completePayment” action.
- The “commerce/payments/pay” controller action now accepts an optional “orderNumber” param, for specifying which order should receive the payment. (If none is provided, the active cart is used.)
- The “commerce/payments/pay” controller action now accepts an optional “expiry” parameter, which takes a combined month + year value in the format “MM/YYYY”.
- The “commerce/payments/pay” controller action doesn’t required “redirect” and “cancelUrl” params, like its predecessor did.
- The “commerce/payments/pay” controller action supports Ajax requests.
- Added an abstract Purchasable class that purchasables can extend, if they want to.
- Gateway adapters are now responsible for creating the payment form model themselves, via the new getPaymentFormModel() method.
- Gateway adapters are now responsible for populating the CreditCard object based on payment form data themselves, via the new populateCard() method.
- Gateway adapters now have an opportunity to modify the Omnipay payment request, via the new populateRequest() method.
- Gateway adapters can now add support for Control Panel payments by implementing cpPaymentsEnabled() and getPaymentFormHtml().
- Commerce_PaymentFormModel has been replaced by an abstract BasePaymentFormModel class and subclasses that target specific gateway types.
- Gateway adapters must now implement the new getPaymentFormModel() and populateCard() methods, or extend CreditCardGatewayAdapter.
- The signatures and behaviors of Commerce_PaymentsService::processPayment() and completePayment() have changed.
- New Sales and Discounts are now enabled by default.
- The Orders index page now displays orders in chronological order by default.
- It is no longer possible to save a product with a disabled default variant.
- It is no longer possible to add a disabled variant, or the variant of a disabled product, to the cart.
- Commerce_PaymentsService::processPayment() and completePayment() no longer respond to the request directly, unless the gateway requires a redirect via POST. They now return
true
orfalse
indicating whether the operation was successful, and leave it up to the controller to handle the client response.
- The “commerce/cartPayment/pay” controller action has been deprecated. Templates should be updated to use “commerce/payments/pay” instead.
- The “commerce/cartPayment/completePayment” controller action has been deprecated. Templates should be updated to use “commerce/payments/completePayment” instead.
- The “withVariant” product criteria parameter has been deprecated. Templates should be updated to use “hasVariant” instead.
- Fixed a bug where product-specific sales were not being applied correctly.
- Reduced the number of SQL queries required to perform various actions.
- The "Enabled" checkbox is now checked by default when creating new promotions and payment methods.
- Edit Product page URLs no longer require the slug to be appended after the product ID.
- Completed orders are now sorted by Date Ordered by default, and incomplete orders by Date Updated, in the Control Panel.
- Fixed a PHP error that occurred if an active cart contained a purchasable that had been deleted in the back-end.
- Fixed a PHP error that occurred when trying to access the addresses of a non-existent customer.
- Fixed a bug where only a single sale was being applied to products even if there were multiple matching sales.
- Order queries will now return zero results if the
number
criteria param is set to any empty value besidesnull
(e.g.false
or0
). - Improved the behavior of the Status menu in the Update Order Status modal on View Order pages.
- Added some
<body>
classes to some of Commerce's Control Panel pages.
- Fixed a bug where new carts could be created with an existing order number.
- Fixed a bug where the default descriptions given to discounts were not necessarily using the correct currency and number formats.
- Fixed a bug where a default state was getting selected when creating a new shipping rule, but it was not getting saved.
- Fixed a bug where variants could not be saved as disabled.
- Added
craft.commerce.getDiscountByCode()
, making it possible for templates to fetch info about a discount by its code.
- OrderHistoryModel objects now have a
dateCreated
attribute.
- Fixed a bug where customers could select addresses that did not belong to them.
- Fixed a bug where new billing addresses were not getting saved properly when carts were set to use an existing shipping address, but
sameAddress
was left unchecked. - Fixed a bug where numeric variant fields (e.g Price) were storing incorrect values when entered from locales that use periods as the grouping symbol.
- Fixed a PHP error that occurred when saving a custom order status with no emails selected.
- Fixed a bug where discounts were being applied to carts even after the discount had been disabled.
- Fixed a bug where carts were not displaying descriptions for applied discounts.
- Fixed a bug where variants’ Title fields were not showing the correct locale ID in some cases.
- Updated the translation strings.
- Fixed a PHP error that occurred when attempting to change a tax category's handle.
- Fixed a PHP error that occurred when attempting to save a discount or sale without selecting any products or product types.
- Orders now have an 'email' criteria parameter which can be used to only query orders placed with the given email.
- Address objects now have 'getFullName()' method, for returning the customer's first and last name combined.
- Added the 'totalLength' attribute to front-end cart Ajax responses.
- It's now possible to sort orders by Date Ordered and Date Paid on the Orders index page.
- A clear error message is now displayed when attempting to save a product, if the product type's Title Format setting is invalid.
- A clear error message is now displayed when attempting to save a product, if the product type's Automatic SKU Format setting is invalid.
- Any Twig errors that occur when rendering email templates are now caught and logged, without affecting the actual order status change.
- The Payment Methods index now shows the payment methods' gateways' actual display names, rather than their class names.
- Payment method settings that are being overridden in craft/config/commerce.php now get disabled from Edit Payment Method pages.
- The extended line item info HUD now displays the included tax for the line item.
- Fixed a bug where the cart was not immediately forgotten when an order was completed.
- Fixed a bug where Commerce_OrderModel::getTotalLength() was returning the total height of each of its line items, rather than the length.
- Fixed a bug where variants' height, length, and width were not being saved correctly on order line item snapshots.
- Fixed a bug where order queries would return results even when the 'user' or 'customer' params were set to invalid values.
- Fixed a PHP error that occurred when accessing a third party shipping method from an order object.
- Fixed a PHP error that occurred when accessing the Sales index page.
- Fixed a PHP error that occurred when loading dependencies on some servers.
- Fixed a JavaScript error that occurred when viewing extended info about an order's line items.
- Fixed some language and styling bugs.
- Added support for inline product creation from product selection modals.
- Products now have an 'editable' criteria parameter which can be used to only query products which the current user has permission to edit.
- Added support for payment methods using the eWAY Rapid gateway.
- Improved compatibility with some payment gateways.
- Added the 'shippingMethodId' attribute to front-end cart Ajax responses.
- Users that have permission to access Commerce in the Control Panel, but not permission to manage Orders, Products, or Promotions now get a 403 error when accessing /admin/commerce, rather than a blank page.
- The "Download PDF" button no longer appears on the View Order page if no PDF template exists yet.
- Commerce_OrderModel::getPdfUrl() now only returns a URL if the PDF template exists; otherwise null will be returned.
- Errors that occur when parsing email templates now get logged in craft/storage/runtime/logs/commerce.log.
- Improved the wording of error messages that occur when an unsupported gateway request is made.
- Fixed a bug where entering a sale's discount amount to a decimal number less than '1' would result in the sale applying a negative discount (surcharge) to applicable product prices. Please check any existing sales to make sure the correct amount is being discounted.
- Fixed bug where email template errors would cause order completion to fail.
- Fixed a bug where shipping rule description fields were not being saved.
- Fixed a PHP error that could occur when saving a product via an Element Editor HUD.
- Fixed a bug where billing and shipping addresses were receiving duplicate validation errors when the
sameAddress
flag was set to true. - Fixed a JavaScript error that occurred when changing an order's status on servers with case-sensitive file systems.
- Discounts are now entered as positive numbers in the CP (e.g. a 50% discount is defined as either “0.5” or “50%” rather than “-0.5” or “-50%”).
- Added the commerce_cart.onBeforeAddToCart event.
- Added the commerce_discounts.onBeforeMatchLineItem event, making it possible for plugins to perform additional checks when determining if a discount should be applied to a line item.
- Added the commerce_payments.onBeforeGatewayRequestSend event.
- Fixed a PHP error that would occur when the Payment Methods index page if any of the existing payment methods were using classes that could not be found.
- Fixed a bug where some failed payment requests were not returning an error message.
- Fixed a bug where PaymentsService::processPayment() was attempting to redirect to the order's return URL even if it didn't have one, in the event that the order was already paid in full before processPayment() was called. Now
true
is returned instead. - Fixed some UI strings that were not getting properly translated.
- Tax Rates now have a "Taxable Subject" setting, allowing admins to choose whether the Tax Rate should be applied to shipping costs, price, or both.
- View Order pages now display notes and options associated with line items.
- Added new 'commerce_addresses.beforeSaveAddress' and 'saveAddress' events.
- Purchasables now must implement a 'getIsPromotable()' method, which returns whether the purchasable can be subject to discounts.
- Variants now support a 'default' element criteria param, for only querying variants that are/aren't the default variant of an invariable product.
- All number fields now display values in the current locale's number format.
- Variant descriptions now include the product's title for products that have variants.
- It is now more obvious in the UI that you are unable to delete an order status while orders exist with that status.
- The 'commerce_orders.beforeSaveOrder' event now respects event's '$peformAction' value.
- The 'commerce_orders.beforeSaveOrder' and 'saveOrder' events trigger for carts, in addition to completed orders.
- Commerce_PaymentsService::processPayment() no longer redirects the browser if the '$redirect' argument passed to it is
null
. - Renamed Commerce_VariantsService::getPrimaryVariantByProductId() to getDefaultVariantByProductId().
- Updated all instances of 'craft.commerce.getCart()' to 'craft.commerce.cart' in the example templates.
- Customers are now redirected to the main products page when attempting to view their cart while it is empty.
- Removed the 'commerceDecimal' and 'commerceCurrency' template filters. Craft CMS's built-in number and currency filters should be used instead. Note that you will need to explicitly pass in the cart's currency to the 'currency' filter (e.g.
|currency(craft.commerce.cart.currency)
).
- Fixed a bug where View Order pages were displaying links to purchased products even if the product didn't exist anymore, which would result in a 404 error.
- Fixed a bug where orders' base shipping costs and base discounts were not getting reset when adjustments were recalculated.
- Fixed the "Country" and "State" field labels on Edit Shipping Rule pages, which were incorrectly pluralized.
- Fixed a bug where toggling a product/variant's "Unlimited" checkbox was not enabling/disabling the Stock text input.
- Fixed a PHP error that occurred on order completion when purchasing a third party purchasable.
- Fixed a PHP error that occurred when attempting to add a line item to the cart with zero quantity.
- Fixed a bug where the state name was not getting included from address models' 'getStateText()' methods.
- Fixed a PHP error that would occur when saving a variable product without any variants.
- Added a new “Manage orders” user permission, which determines whether the current user is allowed to manage orders.
- Added a new “Manage promotions” user permission, which determines whether the current user is allowed to manage promotions.
- Added new “Manage [type] products” user permissions for each product type, which determines whether the current user is allowed to manage products of that type.
- It is now possible to set payment method settings from craft/config/commerce.php. To do so, have the file return an array with a
'paymentMethodSettings'
key, set to a sub-array that is indexed by payment method IDs, whose sub-values are set to the payment method’s settings (e.g.return ['paymentMethodSettings' => ['1' => ['apiKey' => getenv('STRIPE_API_KEY')]]];
). - Added an ‘isGuest()’ method to order models, which returns whether the order is being made by a guest account.
- The ‘cartPayment/pay’ controller action now checks for a ‘paymentMethodId’ param, making it possible to select a payment gateway at the exact time of payment.
- Added Commerce_TaxCategoriesService::getTaxCategoryByHandle().
- Ajax requests to ‘commerce/cart/*’ controller actions now get the
totalIncludedTax
amount in the response. - Renamed Commerce_ProductTypeService::save() to saveProductType().
- Renamed Commerce_PurchasableService to Commerce_PurchasablesService (plural).
- Renamed all Commerce_OrderStatusService methods to be more explicit (e.g. “save()” is now “saveOrderStatus()”).
- Renamed Commerce_TaxCategoriesService::getAll() to getAllTaxCategories().
- Added “TYPE_” and “STATUS_” prefixes to each of the constants on TransactionRecord, to clarify their purposes.
- Order models no longer have $billingAddressData and $shippingAddressData properties. The billing/shipping addresses chosen by the customer during checkout are now duplicated in the craft_commerce_addresses table upon order completion, and the order’s billingAddressId and shippingAddressId attributes are updated to the new address records’ IDs.
- Purchasables must now have a ‘getTaxCategoryId()’ method, which returns the ID of the tax category that should be applied to the purchasable.
- Third-party purchasables can now have taxes applied to their line items when in the cart.
- Added
totalTax
,totalTaxIncluded
,totalDiscount
, andtotalShippingCost
to the example templates’ order totals info.
- Fixed a bug where variants were not being returned in the user-defined order on the front end.
- Fixed a bug where Commerce_OrdersService::getOrdersByCustomer() was returning incomplete carts. It now only returns completed orders.
- Fixed a bug where the line items’ ‘taxIncluded’ amount was not getting reset to zero before recalculating the amount of included tax.
- Fixed a bug where products of a type that had been switched from having variants to not having variants could end up with an extra Title field on the Edit Product page.
- Fixed an issue where Craft Personal and Client installations where making user groups available to sale and discount conditions.
- Fixed a PHP error that occurred when an order model’s ‘userId’ attribute was set to the ID of a user account that didn’t have a customer record associated with it.
- Fixed a bug where quantity restrictions on a product/variant were not being applied consistently to line items that were added with custom options.
- Fixed some language strings that were not getting static translations applied to them.
- Fixed a bug where Price fields were displaying blank values when they had previously been set to ‘0’.
- Fixed a bug where Commerce_TaxCategoriesService::getAllTaxCategories() could return null values if getTaxCategoryById() had been called previously with an invalid tax category ID.
- The example templates now display credit card errors more clearly.
- Fixed a bug where products’ and variants’ Stock fields were displaying blank values.
- Craft Commerce is now translated into German, Dutch, French (FR and CA), and Norwegian.
- Added the “Automatic SKU Format” Product Type setting, which defines what products’/variants’ SKUs should look like when they’re submitted without a value.
- It is now possible to save arbitrary “options” to line items. When the same purchasable is added to the cart twice, but with different options, it will result in two separate line items rather than one line item with a quantity of 2.
- Order models now have a ‘totalDiscount’ property, which returns the total of all discounts applied to its line items, in addition to the base discount.
- The tax engine now records the amount of included tax for each line item, via a new ‘taxIncluded’ property on line item models. (This does not affect existing tax calculation behaviors in any way.)
- Customer data stored in session is now cleared out whenever a user logs in/out, and when a logged-out guest completes their order.
- The example templates have been updated to demonstrate the new Line Item Options feature.
- Address management features are now hidden for guest users in the example templates to avoid confusion.
- Fixed a bug where products/variants that were out of stock would show a blank value for the “Stock” field, rather than “0”.
- Fixed a bug where the
shippingMethod
property returned by Ajax requests to ‘commerce/cart/*’ was getting set to an incorrect value. The property is now set to the shipping method’s handle.
- Added a new “Show the Title field for variants” setting to Product Types that have variants. When checked, variants of products of that Product Type will get a new “Title” field that can be directly edited by product managers.
- It’s now possible to update an order’s custom fields when posting to the ‘commerce/cartPayment/pay’ controller action.
- Renamed
craft.commerce.getShippingMethods()
togetAvailableShippingMethods()
. - The shipping method info arrays returned by
craft.commerce.getAvailableShippingMethods()
now includedescription
properties, set to the shipping methods’ active rules’ description. It also returns the shipping methods’type
. - The shipping method info arrays returned by
craft.commerce.getAvailableShippingMethods()
are now sorted by their added cost, from cheapest to most expensive. - Ajax requests to
commerce/cart/*
controller actions now get information about the available shipping methods in the response. - Customer address info is now purged from the session when a user logs out with an active cart.
- Changes to the payment method in the example templates’ checkout process are now immediately applied to the cart.
- When the Stripe gateway is selected as the Payment Method during checkout we now show an example implementation of token billing with stripe.js
- Fixed a bug where the user-managed shipping methods’ edit URLs were missing a
/
before their IDs. - Fixed a bug where it was possible to complete an order with a shipping method that was not supposed to be available, per its rules.
- Fixed a bug where it was possible to log out of Craft but still see address data in the cart.
- Fixed a bug where plugin-based shipping methods were getting re-instantiated each time
craft.commerce.getShippingMethods()
was called. - Fixed a bug where batch product deletion from the Products index page was not also deleting their associated variants.
- Added a “Business Name” field to customer addresses (accessible via a
businessName
attribute), which replaces the “Company” field (andcompany
attribute), and can be used to store customers’ businesses’ names when purchasing on behalf of their company. - Added a “Business Tax ID” field to customer addresses (accessible via a
businessTaxId
attribute), which can be used to store customers’ businesses’ tax IDs (e.g. VAT) when purchasing on behalf of their company. - Added a getCountriesByTaxZoneId() method to the Tax Zones service.
- Added a getStatesByTaxZoneId() method to the Tax Zones service.
- It is now possible to create new Tax Zones and Tax Categories directly from the Edit Tax Rate page.
- The ShippingMethod interface has three new methods: getType(), getId(), and getCpEditUrl(). (getId() should always return
null
for third party shipping methods.) - It is no longer necessary to have created a Tax Zone before accessing Commerce → Settings → Tax Rates and creating a tax rate.
- The “Handle” field on Edit Tax Category pages is now automatically generated based on the “Name” field.
- Plugin-based shipping methods are now listed in Commerce → Settings → Shipping Methods alongside the user-managed ones.
- Orders can now be sorted by ID in the Control Panel.
- Updated the example templates to account for the new
businessName
andbusinessTaxId
address attributes.
- Fixed a PHP error that occurred when editing a product if PHP was configured to display strict errors.
- Fixed a bug where products/variants would always show the “Dimensions” and “Weight” fields, even for product types that were configured to hide those fields.
- Fixed a PHP error that occurred when the tax calculator accessed third-party Shipping Methods.
- Fixed a MySQL error that occurred when saving a Tax Rate without a Tax Zone selected.
- Fixed an issue where clicking on the “Settings” global nav item under “Commerce” could direct users to the front-end site.
- The “Promotable” and “Free Shipping” field headings on Edit Product pages now act as labels for their respective checkboxes.
- Commerce now logs an error message when an order’s custom status is changed and the notification email’s template cannot be found.
- Commerce Customer Info fields are now read-only. (Customers can still edit their own addresses from the front-end.)
- Commerce now keeps its customers’ emails in sync with their corresponding user accounts’ emails.
- Added a ‘shortNumber’ attribute to order models, making it easy for templates to access the short version of the order number.
- The example templates’ product listings have new and improved icon images.
- Fixed a bug where the “Craft Commerce” link in the global sidebar would direct users to the front-end site, if the ‘cpTrigger’ config setting was not set to “admin”.
- Updated the “Post Date” and “Expiry Date” table column headings on the Products index page, which were still labeled “Available On” and “Expires On”.
- Fixed a bug where one of the Market Commerce → Craft Commerce upgrade migrations wouldn’t run on case-sensitive file systems.
- Fixed a PHP error that occurred when viewing an active cart without an address from the Control Panel.
- Fixed a bug where custom field data was not saved via the ‘commerce/cart/updateCart’ controller action if it wasn’t submitted along with other cart updates.
- Added some missing CSRF inputs to the example templates, when CSRF protection is enabled for the site.
- The example templates’ third party scripts now load over a protocol-relative URL, resolving security warnings.
- Renamed the plugin from Market Commerce to Craft Commerce. (See the upgrade guide for upgrade instructions if you’re coming from Market Commerce.)
- Craft Commerce supports One-Click Updating from the Updates page in the Control Panel.
- Gave Craft Commerce a fancy new plugin icon.
- Updated all of the Control Panel templates for improved consistency with Craft 2.5, and improved usability.
- Non-admins can now access Commerce’s Control Panel pages via the “Access Craft Commerce” user permission (with the exception of its Settings section).
- Products are now localizable.
- It’s now possible to create a new sale or discount right from the Products index page, via a new Batch Action.
- It’s now possible to delete products from the Products index page in the Control Panel.
- Product variants are now managed right inline on Edit Product pages, via a new Matrix-inspired UI.
- Added Live Preview and Sharing support to Edit Product pages.
- It’s now possible to create new products right from Product Selector Modals (like the ones used by Products fields).
- Product types now have a “Has dimensions?” setting. The Width, Height, Length, and Weight variant fields will only show up when this is enabled now.
- It’s now possible to update multiple order statuses simultaneously from the Orders index page, via a new Batch Action.
- It’s now possible to delete orders from the Orders index page in the Control Panel.
- The View Order page now uses the same modal window to update order statuses as the Orders index page uses when updating statuses via the Batch Action.
- The View Order page now has “info” icons beside each line item and recorded transaction, for viewing deeper information about them.
- The View Order page now shows adjustments made on the order.
- Renamed the
craft.market
variable tocraft.commerce
. - Added a new
commerce/cart/updateCart
controller action that can handle customer address/email changes, coupon application, line item additions, and shipping/payment method selections, replacing most of the old Cart actions. (The only othercommerce/cart/*
actions that remain areupdateLineItem
,removeLineItem
, andremoveAllLineItems
.) - It is now possible to use token billing with some gateways, like Stripe, by passing a ‘token’ POST param to the
cartPay/pay
controller action, so your customers’ credit card info never touches your server. - It is now possible to access through all custom Order Statuses
craft.commerce.orderStatuses
. - Added the ‘itemSubtotalWithSale’ attribute to order models, to get the subtotal of all order items before any adjustments have been applied.
- Renamed all class namespaces and prefixes for the Craft Commerce rename.
- Renamed nearly all service method names to be more explicit and follow Craft CMS naming conventions (i.e.
getById()
is nowgetOrderById()
). - All gateways must now implement the GatewayAdapterInterface interface. Craft Commerce provides a BaseGatewayAdapter class that adapts OmniPay gateway classes for this interface.
- Added the
commerce_transactions.onSaveTransaction
event. - Added the
commerce_addOrderActions
hook. - Added the
commerce_addProductActions
hook. - Added the
commerce_defineAdditionalOrderTableAttributes
hook. - Added the
commerce_defineAdditionalProductTableAttributes
hook. - Added the
commerce_getOrderTableAttributeHtml
hook. - Added the
commerce_getProductTableAttributeHtml
hook. - Added the
commerce_modifyEmail
hook. - Added the
commerce_modifyOrderSortableAttributes
hook. - Added the
commerce_modifyOrderSources
hook. - Added the
commerce_modifyPaymentRequest
hook. - Added the
commerce_modifyProductSortableAttributes
hook. - Added the
commerce_modifyProductSources
hook. - Added the
commerce_registerShippingMethods
hook.
- Sales rates and percentages are now entered as a positive number, and can be entered with or without a ‘%’ sign.
- Products are now sorted by Post Date in descending order by default.
- All of the Settings pages have been cleaned up significantly.
- Renamed the ‘isPaid’ order criteria param to ‘isUnpaid’.
- Renamed products’
availableOn
andexpiresOn
attributes topostDate
andexpiryDate
. - Craft Commerce now records all failed payment transactions and include the gateway response.
- Reduced the number of SQL queries that get executed on order/product listing pages, depending on the attributes being accessed.
- Tax Categories now have “handles” rather than “codes”.
- When a Product Type is changed from having variants to not having variants, all of the existing products’ variants will be deleted, save for the Default Variants.
- If a default zone is not selected on an included tax rate, an error is displayed.
- Improved the extendability of the shipping engine. The new
ShippingMethod
andShippingRule
interfaces now allow a plugin to provide their own methods and rules which can dynamically add shipping costs to the cart. - Added an
$error
argument to Commerce_CartService::setPaymentMethod() and setShippingMethod(). - The example templates have been updated for the new variable names and controller actions, and their Twig code has been simplified to be more clear for newcomers (including more detailed explanation comments).
- The example PDF template now includes more information about the order, and a “PAID” stamp graphic.
- The example templates now include a customer address management section.
- Improved the customer address selection UI.
- The “Cart Purge Interval” and “Cart Cookie Expiry Settings” have been removed from Control Panel. You will now need to add a commerce.php file in craft/config and set those settings from there. (See commerce/config.php for the default values.)
- Removed the default Shipping Method and improved the handling of blank shipping methods.
- Removed customer listing page. Add the Commerce Customer Info field type to your User field layout instead.
- Fixed a bug where you could pass an invalid
purchasableId
to the Cart. - Fixed a bug where the customer link on the View Order page didn’t go to the user’s profile.
- Fixed a Twig error that occurred if a user manually went to /admin/commerce/orders/new. A 404 error is returned instead now.
- Fixed a bug where it was possible to use currency codes unsupported by OmniPay.
- Fixed a bug where the Mollie gateway was not providing the right token for payment completion.
- Fixed a bug where the
totalShipping
cost was incorrect when items with Free Shipping were in the cart. - Fixed a bug in the Sale Amount logic.
- Products are now Promotable by default.
- Fixed bug where the logic to determine if an order is paid in full had a rounding error.