Skip to content

Instantly share code, notes, and snippets.

@BDQ
Created December 5, 2008 18:14
Show Gist options
  • Save BDQ/32434 to your computer and use it in GitHub Desktop.
Save BDQ/32434 to your computer and use it in GitHub Desktop.
# Uncomment this if you reference any of your controllers in activate
# require_dependency 'application'
module CameraFields
def add_camera_fields
@additional_product_fields += [
{:name => 'Cline Price'},
{:name => 'Cost'},
{:name => 'Manufacturers SKU'},
{:name => 'Code'}
]
end
end
class CameraExtension < Spree::Extension
version "1.0"
description "Describe your extension here"
url "http://yourwebsite.com/camera"
def activate
Admin::ProductsController.class_eval do
include CameraFields
before_filter :add_camera_fields
end
Admin::VariantsController.class_eval do
include CameraFields
before_filter :add_camera_fields
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment