This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# frozen_string_literal: true | |
# app/decorators/my_app/spree/order_decorator.rb | |
module MyApp | |
module Spree | |
module OrderDecorator | |
def self.prepended(base) | |
# base.remove_checkout_step :address | |
# base.remove_checkout_step :delivery | |
# base.remove_checkout_step :payment |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2020-09-23 18:02:16 UTC Sean Denny https://github.com/seand7565/solidus-store | |
2020-09-23 18:03:13 UTC Sean Denny https://www.youtube.com/watch?v=WbWmFtP2bDs | |
2020-09-23 18:09:49 UTC Sean Denny gem 'react-rails' | |
2020-09-23 18:10:33 UTC Sean Denny rails webpacker:install | |
2020-09-23 18:11:06 UTC Sean Denny rails webpacker:install:react | |
2020-09-23 18:11:37 UTC Sean Denny rails generate react:install | |
2020-09-23 18:14:19 UTC Sean Denny https://github.com/solidusio/solidus/tree/master/frontend/app/views/spree/products | |
2020-09-23 18:15:30 UTC Sean Denny <%= javascript_pack_tag 'application' %> | |
2020-09-23 18:17:55 UTC Sean Denny https://gist.github.com/seand7565/8bfbcebc82472af7bd993ac71715166a | |
2020-09-23 18:19:44 UTC Sean Denny <%= react_component("Products/Show") %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# frozen_string_literal: true | |
# This rake task will gather a list of countries that need to have their states regenerated. | |
# It will then ask you if you want to destroy all current states of that country and regenerate | |
# them based off of the current conventions for subregions. If you select yes, all existing states | |
# that country will be destroyed (and replaced) which could lead to some addresses no longer having | |
# state references. Proceed with caution! | |
def get_carmen_states(iso) | |
carmen_country = Carmen::Country.coded(iso) | |
return false unless carmen_country&.subregions? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
class Show extends React.Component { | |
constructor() { | |
super(); | |
this.state = { | |
name: "Sean" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=== Spree::Product === | |
slugs | |
option_types | |
properties | |
variant_property_rule_values | |
variant_property_rule_conditions | |
taxons | |
promotion_rules | |
tax_category | |
prices |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=== Spree::Base === | |
=== Spree::Product === | |
slugs => | |
product_option_types => product | |
option_types => | |
product_properties => product | |
properties => | |
variant_property_rules => product | |
variant_property_rule_values => | |
variant_property_rule_conditions => |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
v.sku, | |
sum(s.quantity) AS quantity_sold | |
FROM | |
spree_variants v INNER JOIN | |
spree_line_items s ON s.variant_id = v.id INNER JOIN | |
spree_orders o ON s.order_id = o.id INNER JOIN | |
WHERE | |
o.completed_at > (CURRENT_DATE - 90) AND | |
o.state = 'complete' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#----------------------------------------- | |
# Benchmark Orders | |
# | |
# Runs numbers on orders with | |
# different line_item amounts | |
# | |
#----------------------------------------- | |
task :benchmark_orders => :environment do |t, args| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Setting the position... | |
[354] pry(main)> Spree::Classification.where(:taxon_id => 140).each.with_index(1) do |t, i| t.set_list_position(i) end | |
=> [#<Spree::Classification id: 2030, created_at: "2014-01-24 22:50:59", updated_at: "2017-03-02 20:29:08", product_id: 637, taxon_id: 140, position: 1>, | |
#<Spree::Classification id: 2033, created_at: "2014-01-24 22:50:59", updated_at: "2017-03-02 20:29:08", product_id: 2626, taxon_id: 140, position: 2>, | |
#<Spree::Classification id: 2032, created_at: "2014-01-24 22:50:59", updated_at: "2017-03-02 20:29:08", product_id: 2625, taxon_id: 140, position: 3>, | |
#<Spree::Classification id: 2035, created_at: "2014-01-24 22:50:59", updated_at: "2017-03-02 20:29:08", product_id: 2628, taxon_id: 140, position: 4>, | |
#<Spree::Classification id: 2027, created_at: "2014-01-24 22:50:59", updated_at: "2017-03-02 20:29:08", product_id: 546, taxon_id: 140, position: 5>, | |
#<Spree::Classification id: 6590, created_at: "2014-04-14 19:32:26", updated_at: "2017-03-02 20:29:08", product_id: 4 |