spree

access rails url helper from deface

女生的网名这么多〃 提交于 2019-12-11 04:56:21
问题 I am including Spree to an existing site. I am changing the spree header with Deface to render my site's header instead. Therefore I use the following Deface DSL code <!-- replace_contents "header[data-hook]" --> <%= render :partial => "layouts/my_site_header.html.erb" %> And inside _my_site_header.html.erb I have something like this <ul> <li><%= link_to "Home", home_path %></li> <li><%= link_to "Game", game_path %></li> <li><%= link_to "Community", community_path %></li> </ul> Which gives me

Issue with Payment method selection when I add Braintree Drop-in UI in Spree Store

为君一笑 提交于 2019-12-11 04:33:23
问题 I'm trying to implement extension to accommodate drop-in UI of braintree when customer selects Braintree as a payment method. If I add braintree js code into _gateway.html.erb then all the other payment methods stop working. If I select any other method except braintree and click "Save and continue" then nothing happens. "Save and continue" button just gets disabled. I've overwritten spree/frontend/app/views/spree/checkout/_gateway.html.erb. <% if payment_method.name == "Braintree" %> <div id

Using Spree, how can I find product option values from an order in rails console?

孤街浪徒 提交于 2019-12-11 03:43:50
问题 I am able to get products from an order, but I still didn't find a way to get its option_values in order to produce it. This is how I found the product: p = Order.find_by_number("R326153622").products.first Then, I have its option_types through p.option_types which gives me: => [#<OptionType id: 935339118, name: "gender", ...>, #<OptionType id: 935339117, name: "size", ...>, #<OptionType id: 643188970, name: "color", ...>] Ok! Now my headache starts. I just can't realize where to find the

Adding name to Spree Devise registration

拜拜、爱过 提交于 2019-12-11 03:32:15
问题 I am trying to add name, surname and birthdate to devise registration with Spree. I have installed the gem gem 'spree_auth_devise', github: 'spree/spree_auth_devise', branch: '3-0-stable' Created the migration: class AddFieldsToSpreeUsers < ActiveRecord::Migration def change add_column :spree_users, :name, :string add_column :spree_users, :surname, :string add_column :spree_users, :birthdate, :time end end Created a new form to add the fields app/views/spree/shared/_user_form.html.erb Defined

Spree, Ruby on Rails - Add to cart multiple variants of the same product

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-11 01:16:07
问题 I want customers to be allowed to add multiple variants of the same product on the same page. Now i have a list of variants with a radio button, how to make them checkboxes ? Of course, changing "radio_button_tag" to "check_box_tag" not helping <% @product.variants_and_option_values(current_currency).each_with_index do |variant, index| %> <%= radio_button_tag "products[#{@product.id}]", variant.id, index == 0, 'data-price' => variant.price_in(current_currency).display_price %> <%= variant

Rails Spree Kaminari infinite scrolling for the products page

我的梦境 提交于 2019-12-10 19:49:31
问题 I've tried to use this tutorial Kaminari endless page and also watched Ryan Bates episode #114 Endless Page (revised) and tried to implement an infinite scrolling functionality to my online store. I don't know for sure how to apply the products rendering in my index.js.erb file because it's quite different implemented in the Spree. I've also forgot to mention that I'm quite new to the Spree platform. All I've been doing so far was changing these files: views/spree/products/index.html <%

Override Spree Commerce's Bootstrap Variables

吃可爱长大的小学妹 提交于 2019-12-10 17:35:51
问题 I'm having an issue with deploying a customized _variables.scss to my production server as a compiled asset. Everything is fine on my development environment, it's in production that my variables are being overwritten. I'm using Rails 4.2.1 with Spree 3.0 Stable branch. I have the following structure: Files created in vendor/assets/stylesheets/frontend _variables.scss (my custom app variables) all.css (generated by Spree) frontend_bootstrap.css.scss (override Spree) navbar.scss (my

Price gets multiplied by 100 when saving product in Spree (RoR)

梦想的初衷 提交于 2019-12-10 17:27:31
问题 I installed the online shopping framework Spree on top of Rails 3.1.3 and Ruby 1.9.3. I also use the Spree_i18n gem to localize the shop. Now, whenever I save a product, the price is multiplied by 100. For example, in the admin area, I type the price 3.20. That results in the value 320. If I save again, it changes to 32000 and so on. Here is my localized de_numbers.yml for reference: --- de: number: currency: format: format: "%u%n" unit: "€" precision: 2 separator: '.' delimiter: ',' I can

Spree 's latest version does this on remote - undefined method `set_preference' for nil:NilClass

邮差的信 提交于 2019-12-10 15:14:28
问题 Everything works perfect on my local. I installed everything appropriately on the server, and when I run rake db:bootstrap or rake db:migrate , I get this : rake aborted! undefined method `set_preference' for nil:NilClass /home/chrisisraw/webapps/rails/gems/gems/activesupport-3.0.5/lib/active_support/whiny_nil.rb:48:in `method_missing' /home/chrisisraw/webapps/rails/gems/bundler/gems/spree-17e74dd1e908/core/lib/spree/preference_access.rb:18:in `set' /home/chrisisraw/webapps/rails/gems/bundler

How to access a new spree model

五迷三道 提交于 2019-12-10 12:03:15
问题 I am new to spree, I have created a new spree model module Spree class VerificationDocument < ActiveRecord::Base end end When I am trying to access the model from console it's showing an error NameError: uninitialized constant Spree::VerificationDocument Not sure what I am missing. 来源: https://stackoverflow.com/questions/35466675/how-to-access-a-new-spree-model