Skip to content

Instantly share code, notes, and snippets.

module Spree::DropdownVariantsByOption::OrdersController
JS_ESCAPE_MAP = { '\\' => '\\\\', '</' => '<\/', "\r\n" => '\n', "\n" => '\n', "\r" => '\n', '"' => '\\"', "'" => "\\'" }
def self.included(target)
target.class_eval do
create.before << :add_variants_from_option_values
create.rescues ActiveRecord::RecordNotFound
create.wants.js
create.failure.wants.js { render :js => "alert('#{format_js_error}')" }
module Spree::Site::OrdersController
def self.included(target)
target.class_eval do
create.wants.js
create.failure.wants.js { render :js => "alert('#{format_js_error}')" }
end
end
end
<% flash[:notice] = nil %>
$("li.cart-indicator").html('<%= link_to_cart %>');
alert('<%= t("item_added_to_cart") %>');
mysqldump -u $DB_USER -p$DB_PASS --compact --compatible=ansi --default-character-set=binary $DB_NAME | \
grep -v ' KEY "' | \
grep -v ' UNIQUE KEY "' | \
grep -v ' PRIMARY KEY ' | \
grep -ve '^SET ' | \
sed 's/ UNSIGNED / /g' | \
sed 's/ auto_increment/ primary key autoincrement/g' | \
sed 's/ smallint([0-9]*) / integer /g' | \
sed 's/ tinyint([0-9]*) / integer /g' | \
sed 's/ int([0-9]*) / integer /g' | \
sbeam@pris ~/Sites/risepoker]$ ./script/console
Loading development environment (Rails 2.3.8)
ruby-1.8.7-p302 > user = User.find_by_email('[email protected]')
=> #<User id: 1, email: "[email protected]", crypted_password: "1f0777c516b7443484cdc4f0b11928e346ec31031fcb83b0712...", salt: "PreTkwuZsGGfCr7pXprw", remember_token: nil, remember_token_expires_at: nil, created_at: "2010-09-23 19:59:47", updated_at: "2010-09-27 20:48:27", persistence_token: "d0a60168b42533b95ae97935badca4a9626e9be500be5e283df...", single_access_token: "MCFb894ZaLlAsl3RPALZ", perishable_token: "hDp6RM24MI9YDPYbJY8K", login_count: 5, failed_login_count: 0, last_request_at: "2010-09-27 20:48:27", current_login_at: "2010-09-27 20:48:09", last_login_at: "2010-09-27 20:44:03", current_login_ip: "76.118.157.124", last_login_ip: "76.118.157.124", login: "[email protected]", ship_address_id: nil, bill_address_id: nil, openid_identifier: nil, api_key: nil>
ruby-1.8.7-p302 > user.password = user.password_confirmation = 'risepoker'
=> "r
require_dependency 'application_controller'
class MailChimpExtension < Spree::Extension
version "1.0"
description "Mail Chimp API integration with your Spree Store, using the hominid gem"
url "http://github.com/sbeam/spree-mail-chimp.git"
def self.require_gems(config)
config.gem 'hominid', '>= 2.2.0'
<%- collection ||= @menu_pages
# In order to match items that aren't shown in menu and highlight their associations.
# This can be supplied if the logic different in your case.
unless defined?(selected_item)
selected_item = collection.detect{|page| selected_page?(page)}
selected_item = @page if selected_item.nil?
end
if defined?(selected_item) %>
Processing CheckoutsController#update (for 71.168.112.22 at 2010-11-24 04:59:59) [PUT]
Parameters: {"step"=>"address", "order_id"=>"R257486814", "action"=>"update", "_method"=>"put", "authenticity_token"=>"dX4pj58PjCHGKMvQFasLjFurQeeaGgdt/P5cfUtyVCM=", "controller"=>"checkouts", "checkout"=>{"bill_address_attributes"=>{"address1"=>"123 Test Rd", "city"=>"Newark", "address2"=>"Suite G-1", "zipcode"=>"NY\#@", "country_id"=>"214", "lastname"=>"Customero", "id"=>"67", "firstname"=>"Test", "phone"=>"", "state_id"=>"769938586"}, "ship_address_attributes"=>{"id"=>"68", "state_id"=>"721598219"}, "use_billing"=>"1"}}
Cache hit: Spree::Config ({})
.....
Cache hit: Spree::ActiveShipping::Config ({})
***** Debugger requested, but was not available: Start server with --debugger to enable *****
Cache write: UPS-R257486814-US-IN-Newark-NY#@-266_1
commit 1a448022d42dd91021b042ecb7d31f60170352e5
Author: Sam Beam <[email protected]>
Date: Mon Dec 6 21:08:43 2010 -0500
return a nil from Calculator::ActiveShipping::compute when the method is not found in the API response, and pass it through so the customer is not presented with a free shipping option
diff --git a/app/controllers/checkouts_controller.rb b/app/controllers/checkouts_controller.rb
index 1b94dc2..7c56f8d 100644
--- a/app/controllers/checkouts_controller.rb
+++ b/app/controllers/checkouts_controller.rb