Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Comments for Rails Ecommerce with Spree: Customizing with Hooks Tutorial #252

Open
phinjensen opened this issue Nov 11, 2017 · 12 comments

Comments

Projects
None yet
1 participant
@phinjensen
Copy link
Contributor

commented Nov 11, 2017

Comments for https://www.endpoint.com/blog/2010/01/12/rails-ecommerce-spree-hooks-tutorial

To enter a comment:

  1. Log in to GitHub
  2. Leave a comment on this issue.
@phinjensen

This comment has been minimized.

Copy link
Contributor Author

commented Nov 11, 2017

original author: Anonymous
date: 2010-01-17T18:04:17-05:00

Thanks for the tutorial.

On the first step you wrote you put the hooks in the stephs_photos_hooks.rb.

How did you created the file???

Thanks

M.

@phinjensen

This comment has been minimized.

Copy link
Contributor Author

commented Nov 11, 2017

original author: Steph Powell
date: 2010-01-17T22:54:43-05:00

Hi,

The extension_name_hooks.rb file is created when you create the extension with the 'script/generate extension ExtensionName' command. This file is only created in Spree Version 0.9.5. If you are running Spree from a gem, I'm not sure if the 0.9.5 gem is available yet.

~Steph

@phinjensen

This comment has been minimized.

Copy link
Contributor Author

commented Nov 11, 2017

original author: xonic
date: 2010-05-03T04:19:50-04:00

hi there,

i just noticed that the folowing lines didn't work for me:
*

RAILS_ROOT/vendor/extensions/stephs_photos/stephs_photos_extension.rb

def activate
AppConfiguration.class_eval do
preference :logo, :string, :default => 'images/stephs_photos.png'
end
end
*
had to change the path 'images/stephs_photos.png' to 'stephs_photos.png'. not sure if i've mistaken something or if it's a little typo in the tutorial.

thx
xonic

@phinjensen

This comment has been minimized.

Copy link
Contributor Author

commented Nov 11, 2017

original author: Steph Powell
date: 2010-05-03T19:04:09-04:00

Thanks xonic. It looks like the '/images/' location is added when the logo is included in the template with an image_tag.

@phinjensen

This comment has been minimized.

Copy link
Contributor Author

commented Nov 11, 2017

original author: Todd M Baur
date: 2010-05-31T23:49:22-04:00

Just wanted to say I spent about 3 hours trying to figure out how to make a sidebar, and I'm sure I hacked it in. Basically I created shared/_taxonomies.erb and put in my html there. Most of my time was spent thinking that I could call my sidebar 'sidebar.erb' and then in the hook do replace :sidebar, 'shared/sidebar' but nope.

@phinjensen

This comment has been minimized.

Copy link
Contributor Author

commented Nov 11, 2017

original author: Steph Powell
date: 2010-06-01T11:16:36-04:00

Todd, the way to override / replace views before hooks were introduced was by placing files of the same name in the extension that would automatically override the core views. This should have worked as expected. You should also be able to replace / override the sidebar via hooks. Perhaps you should explain the details to the spree-user google group and you'll get more advice?

@phinjensen

This comment has been minimized.

Copy link
Contributor Author

commented Nov 11, 2017

original author: bob<3sDogsInCostumes
date: 2010-11-23T11:15:33-05:00

This tutorial doesn't quite apply to the extension system used in Spree 0.30.0. However, I'd really like to work through it. If there is any way you could update it, or add a few notes for adapting to spree 0.30.0, I would really appreciate it. Thanks.

@phinjensen

This comment has been minimized.

Copy link
Contributor Author

commented Nov 11, 2017

original author: bob
date: 2010-11-23T12:25:16-05:00

Well I see that you already took care of explaining Spree 0.30 extensions here

One quick note about something I had to fix to handle missing .gitignore

Thanks

@phinjensen

This comment has been minimized.

Copy link
Contributor Author

commented Nov 11, 2017

original author: Anonymous
date: 2011-03-25T20:58:14-04:00

Thanks for the nice tutorial!

Is there a way to add CSS style to a custom logo?

Thx!

@phinjensen

This comment has been minimized.

Copy link
Contributor Author

commented Nov 11, 2017

original author: David
date: 2011-06-02T01:05:55-04:00

This is a great tutorial.
What about an update?

@phinjensen

This comment has been minimized.

Copy link
Contributor Author

commented Nov 11, 2017

original author: Anonymous
date: 2011-08-06T23:59:28-04:00

Is there any way you can upload your code to GITHUB?

@phinjensen

This comment has been minimized.

Copy link
Contributor Author

commented Nov 11, 2017

original author: Steph Skardal
date: 2011-08-08T09:48:48-04:00

Hi David, and Anonymous:

There have been several updates on Spree since I wrote this article a year and a half ago. I haven't had time to update this to work on the latest version of Spree, which has pretty significant changes in the way it approaches theming. For now, I'd recommend looking through the Spree docs for Spree theming advice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.