Creating orders with the Drupal Commerce API
Update: The code in this article is now available as a ready-to-use example in the Order Example in the Commerce Examples project.
Update: The code in this article is now available as a ready-to-use example in the Order Example in the Commerce Examples project.
Tonight I needed a coupon on one product on a site that only sells one product. I didn't really want to deploy and configure Commerce Coupon, so I just did it with a quick combination of a line item field and a rule.
Here's what I did:
That's it.
Lots of people have been asking about how to do donations in Drupal Commerce, and since I've been exploring custom line item types, it seemed like that would be a reasonable way to do it.
This screencast is based on the previous Introduction to Custom Line Item Types, so if you're not familiar with the basic concepts try that one.
Custom Line Item Types were a late addition to the Drupal Commerce store technology suite. From the beginning, we've had custom product types, which could have any number of custom fields. These were great when the store defines all the information about the products (like red-small-t-shirts and blue-medium-t-shirts) but don't provide enough power when the customer needs to define something about the product.
In the last couple of weeks, we've had a few users ask questions pertaining to installing Drupal Commerce on a site updated from Drupal 6. The sites in question weren't Ubercart migrations, so there was no e-commerce data to bring forward. That's where you'd usually expect hangups to occur, which is why we're devoted significant time to the Commerce Migrate module to help transfer data from an Ubercart site into Drupal Commerce.
Commerce Guys will be providing a full day of hands-on Drupal Commerce training after the Pacific Northwest Drupal Summit on Monday, October 17, 2011, presented by Randy Fay. We continually revise our curriculum based on attendee feedback, and we keep it updated to reflect the latest hotness in the Drupal Commerce modules. Now that Drupal Commerce 1.0 is out, we'll be focusing on the basic steps everybody needs to build a store.
Views Bulk Operations has the capability to execute Rules. A simple example of this use is just setting field values on products in Drupal Commerce, which VBO alone doesn't yet do (although it will). This screencast demonstrates how to execute a simple Rules Component using Views Bulk Operations.
Commerce Migrate is an extension of the excellent Migrate Project allowing its full capabilities to be used with Commerce entities like product, customer profile, etc. Commerce Migrate includes a submodule, Commerce Migrate Ubercart, which can import an Ubercart D6 or D7 database and turn it into a Drupal Commerce store.
In this screencast I give the basics of how to set up a migration.
Commerce Guys Says Beta Opens Floodgates To E-Commerce On Drupal 7
Change is at the center of eCommerce, but our team and mission remain the same.
Our consulting, development, and support offerings apply our expertise to help you adapt to change and grow.
Find us now at: https://www.centarro.io