Archive for June, 2008

June 23 2008

Product Propertiesby railsdog

Sonny has just committed a very promising feature that introduces the concept of product properties. Think of it as “free tagging” but with a little bit of structure to keep things sane. Products can now have an arbitrary number of name-value pair properties which can be used for a variety of purposes. The first possible use would be to build a product taxonomy in an automated fashion. Product taxonomy is a feature that Sonny is still working on and we’re hoping to see it in a few more days.

Another interesting use for product properties is to assist with a taxation extension. I plan to use this in the current TaxCalculator and the upcoming VAT Calculator to help determine the taxability of a product. For instance, in certain U.S. states, clothing is not taxable. By introducing a tax category property for all products you can create your own rules about what gets taxed. In the case of our clothing example, you simply create a property of “tax category” and assign it a value of “clothing.” In your tax calculations you can then check for items that are clothing and exempt them from taxation.

We have also introduced the concept of a product prototype. The prototype is basically a template of properties that can be assigned in bulk to a product. For instance, you might want to construct a prototype called “Shirt” which would contain the following properties: Brand, Style, Fabric, Gender, etc. This way every time you added a new shirt product to your store you could say “use the shirt prototype” and you would get all of these properties assigned to your new product at once. The properties will be empty, however, so you still need to specify the values of these properties for each product.

Properties are useful for business logic that needs to check from a finite list of values. They are not a substitute for product taxonomy (which requires several levels of nesting) but they can be used to assist in the generation of taxonomies. They can also be used to allow for navigation by “tags” and provide a structured mechanism for keeping the universe of tags somewhat organized.

Currently there is no way to limit the values of your properties. For instance, if you had a property for “Gender”, there is no way to limit the choices to just “Men’s” and “Women’s.” We’re considering implementing an option to specify that a property has a known list of values but right now, its free text.

The code is currently available in Github and you can also experiment with it on the demo server. The interface is a little bit rough around the edges but you will get the idea. Please post any and all feedback to the spree-user mailing list of course.

June 23 2008

Introducing Rails 2.1 Supportby railsdog

Spree now supports Rails 2.1. This change is effective immediately for all of those working off the latest Github source code. If you are using the gem version of Spree (as opposed to the source) you will have to wait until the upcoming Spree 0.3.0 release. We are also no longer including a frozen version of Rails in the gem (or git repository.) This will cut down on file size considerably. If you require a frozen version of Rails you can add it to your app and/or local check out of the Spree git repository and things will work fine.

We’re still working out the process of how to smoothly upgrade from 0.2.0 deployments. Most likely there aren’t too many of those yet but we intend to make future upgrades as easy as possible so we are doing our best to resolve these issues. Please read the wiki for complete details on how to upgrade your existing application (you can ignore these instructions if you’re starting a new Spree application.) Please report any issues on the spree-user mailing list.

June 05 2008

Spree 0.2.0 Releasedby railsdog

Spree 0.2.0 has been released. This release contains several major improvements including the long awaited extension mechanism. The data model contains several improvements but we were not able to make all of the changes we were hoping for. We are still working on a major overhaul of the taxonomy/categorization system but that should be ready in another few weeks. Now that the data model has stabilized significantly we will now be incrementing migrations instead of editing existing ones. Quickstart instructions can be found in the Documentation section. The online demo has also been updated to match this release.

June 04 2008

Rails Conf Debriefingby railsdog

Rails Conf was extremely busy (sessions and BOF’s ran well into the evening) so I didn’t make nearly as much progress on Spree as I would have liked. I did learn quite a bit of interesting things at the conference that I hope to apply to Spree. Specifically, I learned a lot of new testing techniques that should make it easier to write tests. I’ve come to the conclusion that we’re really going to need a lot more automated tests for Spree going forward from here. So look for a lot more tests to be added in the coming weeks.