spree

Does Spree shop support multiple vendors to buy from?

妖精的绣舞 提交于 2019-12-04 13:23:00
问题 Hi i need a shop software where i can offer products from different vendors. e.g. one could buy a watch from 3 different vendors for different prices. Amazon does this too. (see http://www.amazon.de/gp/offer-listing/B0031SZRZG/ref=dp_olp_new?ie=UTF8&condition=new) Are there any plugins for that in Spree? 回答1: Yep spree has plugin for spree multi vendor ,spree multi store as well spree multi tenant spree multistore https://github.com/bullrico/spree-multistore spree multi tenant https://github

Rails 4 - strong parameters concept involvement in spree-2.1

核能气质少年 提交于 2019-12-04 12:09:20
问题 How to add new fields for spree::user in Spree-2.1 + Rails4 ? Like my old customization: ========================== Spree::User.class_eval do attr_accessible :f_name, :l_name :gender validates :f_name, :presence => true, :length => {:maximum => 25} validates :l_name, :presence => true, :length => {:maximum => 20} end new work with strong parameters: ================================ module Spree UserRegistrationsController.class_eval do private def spree_user_params params.require(:spree_user)

Spree overriding helper method

你说的曾经没有我的故事 提交于 2019-12-04 10:10:33
问题 I'm trying to overriding a helper method of base_helper.rb by using this: module Spree module BaseHelper.class_eval do def taxons_tree(root_taxon, current_taxon, max_level = 1) ..... end end end It's not working for me. Anyone know what I am missing here? Thank you! Fixed: I should use: Spree::BaseHelper.module_eval do def taxons_tree(root_taxon, current_taxon, max_level = 1) ... end end instead. 回答1: Re-opening the module will work just as well: module Spree module BaseHelper def taxons_tree

How to access Spree's link_to_cart function from main rails app

和自甴很熟 提交于 2019-12-04 09:49:52
I am building a spree shop into an exiting Rails application, and I need to access link_to_cart from outside of the Spree engine. link_to_cart can be found here: spree/core/app/helpers/spree/base_helper.rb Since I have modified the styling in link_to_cart , I also created: #helpers/spree/base_helper_decorator.rb module Spree module BaseHelper def link_to_cart(text = nil) text = text ? h(text) : Spree.t('cart') css_class = nil if simple_current_order.nil? or simple_current_order.item_count.zero? text = "#{text}: (#{Spree.t('empty')})" css_class = 'empty' else text = "<i class='fa fa-shopping

Extending the Spree::Product model/class

馋奶兔 提交于 2019-12-04 08:16:47
I'm using Spree in a Rails 3.2 app of mine and I want to extend Spree's Product class to better suit my needs as for example to establish a relationship with another model in my app. What's the best way to do this? I could not find anything about it in the project documentation And what if I want to add new attributes/fields to the Product resource? I can't find it's migration either :/ Thanks in advance :) Martin Lang The best thing to do here is to create a product_decorator.rb in your app. This will look like the following: Spree::Product.class_eval do end In there, you can feel free to

Spree Mail Method is not working?

旧街凉风 提交于 2019-12-04 05:29:01
问题 In spree admin panel under configuration menu, I configured mail smtp, port and etc., after creating new mail method I press test mail button, I got following alert message "Testmail sent successfully" and even terminal window also display email send successfully message but the mail is not delivered to the corresponding address Console log after sending test mail Sent mail to abc@xyz.com (5ms) Date: Wed, 12 Jun 2013 03:11:43 -0700 From: test@spree.com To: abc@xyz.com Message-ID: <***********

Assign a rendered partial to an instance variable

时光总嘲笑我的痴心妄想 提交于 2019-12-04 04:55:56
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 Controller's render method is different than view's one. You want to execute it in a view context: @test = view_context

How to access Rails Engines methods from main application?

谁都会走 提交于 2019-12-04 04:00:53
问题 I'm trying to use the current_order method defined in the Spree::Core engine: https://github.com/spree/spree/blob/master/core/lib/spree/core/current_order.rb In my view, I've tried Spree::Core::CurrentOrder.current_order Using just "current_order" in development works fine though, but not in production. So then I've tried to require it in my views file like this: require 'spree/core/current_order' I've also tried permutations of these other solutions: How to incorporate Rails Engine

Spree Dropdown boxes for variant option values

我怕爱的太早我们不能终老 提交于 2019-12-03 14:23:28
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(current_currency).collect{ |v| ["#{variant_options(v)} #{variant_price(v)}", v.id] })%> But it simply

Spree Custom Roles Permissions

為{幸葍}努か 提交于 2019-12-03 09:54:35
I am trying to give some custom roles within spree specific permissions. Cant find this answer anywhere role_ability.rb class RoleAbility include CanCan::Ability def initialize(user) user || User.new # for guest if user.has_role? "admin" can :manage, :all elsif user.has_role? "retailer" can :manage, Product else can :read, :all end end end I thought this might be a popular idea, of letting a user with role 'manager' manage only products and other certain Models... if I change elsif user.has_role? "retailer" can :manage, Product to elsif user.has_role? "retailer" can :manage, :all It works as