spree

Paperclip unable to change default path

我们两清 提交于 2019-12-23 22:33:33
问题 I'm having a similar problem to this issue, except I'm unable to modify the path at all. I'm using Spree 2.2 which uses paperclip 3.4.2 I'm trying to modify the paperclip defaults to change the image path. All of the other configuration is working. Myapp::Application.configure do config.paperclip_defaults = { :storage => :s3, :s3_protocol => 'https', :s3_host_name => "s3-eu-west-1.amazonaws.com", :path => ":rails_root/public/:attachment/:id/:style/:basename.:extension", :url => "/:attachment/

How do I symlink my product images in production on a Capistrano deploy?

假装没事ソ 提交于 2019-12-23 21:30:18
问题 Here I received a solution to my problem that every time when I deploy my Spree Commerce app with Capistrano my images are removed (they are still there, but the folder names are wrong) and I have to add them again via admin. Both on this Google group and in the answer to the question it is said that symlinking is solution. You need to make sure that your RAILS_ROOT/public/spree directory is being symlinked in from the Capistrano shared directory and not recreated every time you deploy. If

Where is the CheckoutController#edit in spree?

旧巷老猫 提交于 2019-12-23 16:30:02
问题 I need to play with edit action of the CheckoutController, and I see it in server logs, I see it in documentation but I can't find it in gem's code. Where's the magic? Spree version is 1.2.2 回答1: You can find it inside the spree_core gem in spree_core-1.3.0/app/controllers/spree/checkout_controller.rb You might find useful to use tools such as ack to search files. I found it by running ack-grep CheckoutController inside the gems directory. Note that ack-grep is just an alias for ack to avoid

Spree remove billing address

烂漫一生 提交于 2019-12-23 12:48:08
问题 How would I remove billing (or shipping) address in Spree checkout routine? I'm using spree 1.3 回答1: You can remove the shipping address by removing the delivery step from your checkout_flow definition by putting this code inside your application at app/models/spree/order_decorator.rb : Spree::Order.class_eval do checkout_flow do go_to_state :address go_to_state :payment, :if => lambda { |order| order.payment_required? } go_to_state :confirm, :if => lambda { |order| order.confirmation

Is Spree extensible enough to support multiple vendors in one app just like Amazon.com?

孤街醉人 提交于 2019-12-23 04:36:15
问题 In short, is it possible to build an Amazon clone without substantial modification to Spree? 回答1: it is indeed possible. If you do, don't use spree as an engine, just use the whole sourcecode as itself. If you use it as an engine, you'll end up overriding so much features of spree that you will be lost totally! Also use and extend the tests that come with spree. You will however loose the ability to update spree, because you will have to change a lot of stuff in the core. 来源: https:/

Adding multiple products to spree cart with single click

偶尔善良 提交于 2019-12-23 00:51:21
问题 I'm using spree 3.0 with ROR 4, and in our ecommerce site we want to be able to make recommendations to our customers for pairing of items. like shirt pants combinations. so the customer will answer a couple of questions and then we show them a list of product combinations (taxons i would assume), but then when they click on the choice, its takes them to a page with BOTH items where they can choose the size of each item individually, but add them both to the cart with ONE click 'add to cart'.

Facebook OAuth is not returning email in user info

谁都会走 提交于 2019-12-22 07:03:07
问题 I'm doing a spree 3.0 installation (ROR) and trying to use facebook oauth for authentication, but the fields sent back after a successful oauth, do NOT contain the email, which is critical to our application. here is the return from the facebook successful authentication. #<OmniAuth::AuthHash credentials=#<OmniAuth::AuthHash expires=true expires_at=1442435073 token=

How to override product_url in Spree 2.x / Rails 4 to make more SEO friendly?

时光怂恿深爱的人放手 提交于 2019-12-21 17:52:30
问题 I would like my product urls to look like: /product-name-here/p instead of: /product/product-name-here How can I achieve this? 回答1: After a lot of research I figured it out. There are two steps in this process. The first is to create a route that matches the new product route. So go into your routes.rb and in this section: mount Spree::Core::Engine, :at => '/' # Spree Specific routes here end Add this line: get ':id/p' => 'spree/products#show' So now it looks like this: mount Spree::Core:

Assign a rendered partial to an instance variable

早过忘川 提交于 2019-12-21 11:34:07
问题 In rails 4, I want to render a partial (say the footer) on anywhere of a page. In home_controller.rb, I have this within a class: def spree_application @test = render :partial => 'spree/shared/footer' end When I go to the index page and added: <%= @test %> Nothing happens. I know I can render within the index page but Im asking if there is a way to assign the rendered link to a variable. Thanks! Edit: I have made a mistake with this question. I have defined: spree_application 回答1: Controller

Spree Dropdown boxes for variant option values

核能气质少年 提交于 2019-12-21 05:06:49
问题 I'm learning Spree 3.0 and I have a setup a test shop that sells shorts. Shorts has multiple option types: Size, Color, Length I wanted to change the way it displays the variant options on the frontend from a radio checkbox to a drop down box. Currently, Spree displays the option types as radio buttons: I want to change this to use drop down menus for each option type, like this: I've tried the following: <%= select_tag "variant_id", options_for_select(@product.variants_and_option_values