spree-contrib / spree_product_zoom

Lightbox zoom functionality to show original product image
http://guides.spreecommerce.org
BSD 3-Clause "New" or "Revised" License
31 stars 95 forks source link

Method to change default style #10

Closed jetsgit closed 12 years ago

jetsgit commented 12 years ago

In your README.md you state the way to change default style is:

To change:

 Spree::ProductZoom::Config.default_image_style = :image_style

The above generated an error for me.

Perhaps a more explicit comment would be:

To change default style from :original create a file config/initializers/spree_product_zoom.rb

with the following line:

Spree::ProductZoom::Config[:default_image_style] = :your-style

Thanks!

Jet

LBRapid commented 12 years ago

Done, thanks!

jetsgit commented 12 years ago

Apologize, but after further testing my solution for adding

 Spree::ProductZoom::Config[:default_image_style] = :your-style

in config/initializers/spree_product_zoom.rb

did not work.

So how do you set default to something else??

LBRapid commented 12 years ago

I am unsure why that isn't working. I know that you used to be able to do that with extensions in an initializer.

For now, you can try the following: https://gist.github.com/3948293 or set it via the rails console.

John Dyer http://twitter.com/lbrapid

On Wednesday, October 24, 2012 at 2:49 PM, Jerrold Thompson wrote:

Apologize, but after further testing my solution for adding Spree::ProductZoom::Config[:default_image_style] = :your-style
in config/initializers/spree_product_zoom.rb did not work. So how do you set default to something else??

— Reply to this email directly or view it on GitHub (https://github.com/spree/spree_product_zoom/issues/10#issuecomment-9751507).

jetsgit commented 12 years ago

I have stopped trying to get the jquery.fancybox.js v2.1.3 working correctly. Everything is perfect... except the supposed zoomed images are only showing up thumbnail size. It could be because I could not get the newer version of jquery-1.8.2 working with my existing scripts.

So, I have reverted to previous version of 1-1-stable, but using my customized section for changeIN, changeOut, and next, prev.

Also, did not hear back about how to correctly set default size, so I just set that in the model. All works great.

Thank you very much for a great extension!

Jet

LBRapid commented 12 years ago

https://gist.github.com/3948293 shows how to set config in initializer.