Adding attributes to the Variant and Product models is now supported via the additional_fields class method in the Variant model. The additional_fields method exposes an array of hash objects that contain the configuration for all fields that have been added from all extensions (including core extensions). Each field added to this array automatically gets presented on the relevant add / edit admin interfaces, and this feature should help prevent the need to override these views.
From your extension class you can add to the variant and / or product models by adding a hash for each value, like:
Variant.additional_fields += [
{:name => 'Weight',
nly => [:variant], :format => "%.2f"},
{:name => 'Height',
nly => [:product], :format => "%.2f"},
{:name => 'Width',
nly => [:product, :variant], :format => "%.2f", :populate => [:line_items]}
]
For more information on this new feature please visit the wiki