Well, I've been trying to change the default theme of spree by following this tutorial
http://blog.endpoint.com/2010/01/rails-ecommerce-spree-hooks-tutorial.html
But the homepage doesn't change at all, well since the tutorial is meant for rails 2, I'm just wondering what do I need to change from the tutorial to make it work with rails 3?
Simpler solution than using hooks is welcomed. Also while I'm at it, is there a way to undo the command you run in rails like maybe uninstalling an extension.
rails g spree:extention site
then I've look at my gems path and just opened the whole spree-core gem in another editor project and copied over the app/views/layouts/spree_application.html.erb
. If your html is not that different (mine is quite different at http://daugpigiau.lt) from default spree shop you might be able to only use hooks and override some of the parts. Still the only way I've found to know hook names was to look inside those spree core gems and templates that were interesting for me. After you know what hooks are of interest to you you can do something like:
class PigiauHooks < Spree::ThemeSupport::HookListener
# custom hooks go here
insert_after :admin_inside_head, 'shared/admin/ckeditor_include'
insert_before :admin_product_form_meta, 'shared/admin/product_editor'
insert_before :admin_product_form_additional_fields, 'shared/admin/unavailable_on'
end
These are just my own partials for the places I wanted to change.
rails destroy spree:extension your_extension_name
and it will revert all the operation that were performed during it's generationI've strugled with the overriding part at first cause documentation on this one has a bit too much blank spaces for the first time user to grasp.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With