Install
Works with Drupal: 7.xUsing Composer to manage Drupal site dependencies
Downloads
Release notes
With this release, we're moving forward in our development cycle to the release candidate phase. While in release candidate, we're doing aggressive testing and bug fixing on any issues that pop up. If all goes well over the next few weeks, we'll call it a 1.0 in preparation for DrupalCon London. We may or may not have additional release candidates depending on whether or not any serious bugs get reported or database updates are required.
Update instructions:
If you are updating from a previous release, you should first test the new release in a development environment. Do not attempt to update initially on your live site in case something goes wrong!
You should start the process by updating all of your Drupal Commerce dependencies to the latest tagged releases. This includes Address Field 1.0-beta1, Ctools 1.0-beta1, Views 3.0-rc1, Entity API 1.0-beta10, and Rules 2.0-beta2. Then update to the latest version of Drupal Commerce and run your site's update.php.
If you're updating from a version prior to 1.0-beta4, you should also review the notes associated with that release. There were reported API and Rules integration changes that you must take into account.
Additionally, since beta4, three changes will require manual intervention:
- If you have been entering prices including VAT, you must use the product edit form to reselect the included VAT and submit it to resave those products. In order to automatically accommodate changes in tax rates, we changed included tax calculation to happen on load instead of on save. Resaving via the edit form will update the product to use the new method. Until that happens, VAT will still be included in any products whose prices you have entered with it.
- If you have any product pricing rules using the Commerce Line Item actions for manipulating the unit price of line items, you will need to perform a similar edit and reserve process. These actions now include an additional parameter for specifying the type of price component to use for the manipulation. It defaults to "Base price" (the same it was using before), but any existing actions will need to be resaved for Rules to know about the selection.
- The Add to Cart form and its associated API have gone through a round of changes to both expand the functionality of the form and reduce the memory footprint of the line items it creates. As a result, the signature of the form has changed to receive a $line_item object instead of the $product_ids array and parameters specifying the default product on the form. If you have a module or custom code that interacts with the Add to Cart form, the product line item API, and the cart product add API functions, you must update your module to work with this latest release. Please refer to the function documentations in the code.
Summary of changes:
So much work has gone into this release in just the last month that it's hard to summarize it succinctly. For a brief overview of the big items, refer to my blog post announcing the release candidate.
In addition to the items mentioned, I can add some more technical details:
- The rendering of referenced product fields into nodes has been abstracted to support rendering product fields into any entity that references products. This was made possible thanks to the new entity controller Damien gave us for beta4.
- We've resolved issues with order total currency determination so that it now properly supports mixed currency orders. If the default currency is represented by an item on the order, it will always default to that currency. If it is not, then the currency of the first line item will be used as the order total currency.
- All tests are passing! Incorporating automated testing into our development workflow has been very helpful to the stability of the project, and we'll continue to refine and expand our tests as we go. New tests may be introduced at any time in the release cycle, so test patches are always welcome. ; )
- Line items no longer have a $line_item->data['display_uri'] parameter. This is good, because that parameter was being stuffed full of node objects and entire View objects! It was a huge performance cost that is now mitigated with a more succinct array of settings indicating the context from which a product was added to the cart.
- Additionally, the Add to Cart form no longer needs an entire array of product IDs to build itself. It can pull product IDs from the line item object passed to it, or it can use the product IDs from an entity's product reference field.
- You can define as many product line item types as you need and expect them all to work just fine throughout the Cart system. To do so, you simply need to implement hook_commerce_line_item_type_info() and define a line item type with the 'base' property set to 'commerce_product_line_item'. This will reuse the various callbacks associated with the default product line item type, but you can use a custom base and custom callbacks if you require.
- Fields attached to line items now show up on the Add to Cart form where they can be filled in by customers. This allows for Ubercart style product customization attributes.
- Customer profile handling has been greatly improved. We added deletion protection to customer profiles much like we have for products to prevent them from being deleted once they've been used on an order. The same check determines whether editing a profile's field data is allowed or results in a clone of the profile being created. All this maintains the integrity of data entered for a given order at that point in time and supports the reuse of previous profiles by modules like Commerce Addressbook.
- The Address Field module received a major overhaul thanks to Damien. It requires less now from developers to properly format the address form and render an address on output based on the country. Expect to see additional improvements in the near future to better support addresses in different parts of the world.
That's all for now! It's been a lot of fun to tie up a lot of these loose ends, and I look forward to improving more of the core as the project matures. The code we have gives us a very solid foundation, so we'll be redoubling our efforts to package releases of essential contributed modules as soon as possible.
Changes since 7.x-1.0-beta4 (71 commits):
- #1218580 by rszrama: fix the altering of Add to Cart form context arrays when the form is displayed on a node; this preserves the view mode used to render product fields in the node when an AJAX refresh occurs.
- Apply a fix to product deletion by directly manipulating product reference field data instead of depending on the entity_metadata_wrapper().
- Accommodate both the default and node_teaser view modes for the display settings of price fields created with commerce_price_create_instance().
- #1218758 by TheWizz, rszrama: update docs for our various entity save functions and controller methods to indicate the proper return value.
- Prevent a notice on credit card number validation; HT beejeebus.
- #1195060 by Haza, rszrama: update permission names to be a little more user-friendly (using type instead of bundle and dropping the use of entities).
- #1119974 by rszrama: change the storage of prices including VAT to just retain a tax rate name and apply the tax via hook_field_attach_load() instead of on save.
- #1106042 by rszrama: add a hook to allow modules to alter the line item used for product sell price calculation.
- Update commerce_order_commerce_customer_profile_can_delete() to properly check every possible customer profile reference field instead of just returning based on the value of the first one found.
- #1192200 by googletorp, rszrama: Optionally skip adding base price price components on price fields.
- #858722 by rszrama: properly delete instance and field data when modules are uninstalled so they can be reinstalled later without field creation errors.
- #1217060 by rszrama: only check the order status if there are non-cart statuses when determining if a profile can be deleted or should be saved as a clone on edit.
- #1064236 by rbayliss, rszrama: properly handle the disabling of customer profile reference fields and profiles when a module defining a customer profile type is disabled and/or reinstalled.
- Fix the Order and Commerce Views to properly use the requested format handlers instead of the widget handlers.
- #1208174 by Damien Tournoud: Update commerce to the API change in Entity, deprecate our own custom solution.
- #1215988 by pcambra, rszrama: update API docs to not present object parameters as explicitly received by reference.
- Update formatters for Addressfield reloaded.
- #1181944 by rszrama: force a profile being edited to be saved as a new profile if it is referenced from another order; update the Order module's check on customer profile deletion to consider the context from which a profile is being deleted, so a profile can be deleted from within the sole order referencing it.
- Add a similar function for customer profiles and use it to set a more appropriate title for the deletion option on the customer profile manager widget.
- Add an API function for determining whether or not a given product can be deleted.
- #1195506 by rszrama: add missing Entity and Rules module dependencies to modules using the entity_metadata_wrapper() and rules_invoke_*().
- #1181944 by rszrama: prevent the deletion of customer profiles that are currently referenced by orders.
- #1124414 by rszrama: add the ability to rebase unit prices on an amount entered by the administrator on the order edit form; this includes a new hook with documentation allowing other modules to add components to the price based on the base price.
- Add safeguards to the Add to Cart display formatter to ensure users don't attempt to add a product to the cart with a NULL line item type b/c of stale field info arrays.
- Follow-up to #1208174: remove invalid comment.
- #1208174 by rszrama: remove the page property from a few view modes, add an entity label callback for orders, and update some of the base controller class's buildContent() method.
- #1208174 by Damien Tournoud: switch rendering of entities to CommerceEntityController::view().
- Fix DrupalCommerceEntityController::view().
- #1033050 by rszrama: add optional line item type selection to the Add to Cart form display formatter.
- #1033050 by rszrama: updated the shopping cart system, parts of the line item API, and Product Reference Views integration to support defining multiple product line item types and using them in the cart; updated all tests to passing.
- #1033050 by rszrama: pass a whole line item to commerce_cart_product_add() and support combining products into existing line items on the basis of field comparisons; added an option to the Add to Cart form display formatter to bypass combination.
- #1033050 by rszrama: add line item fields to the Add to Cart form that have been marked for inclusion on the form in the Field UI field edit form.
- #1118326 by rszrama: add the default product value to the form state even when only 1 product is included on the form.
- #1064778 by das-peter, rszrama: add a widget for the product reference field that displays nothing at all; useful for sites referencing a lot of products from a single source that manage the field data through some alternate means.
- Update the checkout completion pane settings form to use the proper pre-fixed tokens in its replacement patterns fieldset.
- Allow the Add to Cart form to pull a product IDs array from a referencing entity instead of always having to include the full array of product IDs in the line item parameter (essential when forms include a lot of products, especially if their values are updated often).
- #1204062 by das-peter: declare locale integration with the product entity so translation happens properly.
- #1201096 by rszrama: define the product status in the entity property info array.
- Remove the display_uri parameter from line item data arrays and the API, preferring instead to store just the display_path in the line item context data array along with less but more specific data if the form is displayed in the context of an entity or a View.
- Delete all line items when emptying a cart order and add a hook to allow other modules to react to the process.
- Convert the Add to Cart form to use a line item parameter instead of the product IDs array and default quantity value.
- Add a basic discount price component type.
- Update commerce_tax_field_attach_form() to ensure the validate handler executes on every price field, whether there are options or not (fixing a bug whereby you could not get rid of inclusive VAT if the tax rate was deleted).
- Fix by Damien Tournoud to prevent refreshing an order multiple times at once, resulting in potentially infinite recurring loops.
- #1196600 by Haza: Added Add css class to add to cart button.
- Allow line item unit price manipulation actions to specify the price component that should be used when the difference is saved.
- Merge branch '7.x-1.x' of git.drupal.org:project/commerce into 7.x-1.x
- Fix the hook documentation for hook_commerce_cart_attributes_refresh_alter() and add an example.
- Fix a fatal error when accessing the Cart module's checkout router with no current cart order.
- #1198680 by rszrama: remove a notice when displaying a customer profile checkout pane for a profile type that does not have an address field.
- #1198692 by Haza: Fixed Views notice after creating new customer profile type.
- Remove unecessary debug call in the checkout tests.
- #1194336 by rszrama: put the conditional statement from commerce_cart_field_attribute_eligible() into commerce_cart_update_7100() instead of calling the function to avoid failure when updating with a disabled Cart module.
- Add a hook_commerce_cart_attributes_refresh() to allow modules to alter or add to the AJAX commands array that is returned by the Add to Cart form's default AJAX refresh callback.
- #1191658 by joseph11: fix CZK currency formatting.
- #1189702 by rszrama: update commerce_line_items_total() to include the same currency selection logic uesd in commerce_order_calculate_total().
- When combining price components, convert components to the proper currency before attempting to combine them into the primary components array.
- #1189702 by rszrama: move order total calculation out to an API function and frontload the decision making process on what currency to use so line item and component price amounts can be converted on a single iteration to the order total currency.
- #1189702 by googletorp, better handle of order's order_total currency code.
- #1188700 by recrit: fix permission update functions to use the proper variable.
- #1187340 by googletorp, rszrama: add configure links on module page, including to product and customer profile type pages.
- #1188252 by googletorp: return order instead save status for functions saving order.
- #1187262 by bojanz: remove a deprecated method in a Views handler causing errors.
- #1108180 by bojanz - Add an inverse relationship from products to nodes referencing them.
- Update payment transaction and customer profile labels to include Commerce.
- #1181364 by rszrama: remove the magic configuration required to inject product fields into other entity displays.
- #1165158 by Damien Tournoud: abstract the injection of product fields into nodes to allow it the injection of product fields into any referencing entity. Hot diggety dog!
- Implement tests for commerce order conditions. Fix them.
- Implement tests for payment conditions.
- Fixed the order product quantity comparison to use the proper operator callback.
- Fix the creation of a payment transaction to properly set the payment method property.