solidify 0.0.1.alpha
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +10 -0
- data/.rspec +2 -0
- data/.rubocop.yml +40 -0
- data/.travis.yml +10 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +3 -0
- data/Guardfile +51 -0
- data/LICENSE.txt +21 -0
- data/README.md +75 -0
- data/Rakefile +42 -0
- data/app/controllers/concerns/solidify/liquid.rb +26 -0
- data/app/controllers/solidify/addresses_controller.rb +15 -0
- data/app/controllers/solidify/carts_controller.rb +15 -0
- data/app/controllers/solidify/collections_controller.rb +26 -0
- data/app/controllers/solidify/customers_controller.rb +16 -0
- data/app/controllers/solidify/home_controller.rb +15 -0
- data/app/controllers/solidify/liquid_controller.rb +25 -0
- data/app/controllers/solidify/orders_controller.rb +19 -0
- data/app/controllers/solidify/pages_controller.rb +22 -0
- data/app/controllers/solidify/products_controller.rb +34 -0
- data/app/controllers/solidify/registrations_controller.rb +25 -0
- data/app/controllers/solidify/responders/solidify/liquid_responder.rb +29 -0
- data/app/controllers/solidify/search_controller.rb +41 -0
- data/app/controllers/solidify/sessions_controller.rb +15 -0
- data/app/drops/rails_settings/scoped_settings_drop.rb +11 -0
- data/app/drops/solidify/errors_drop.rb +14 -0
- data/app/drops/solidify/link_drop.rb +15 -0
- data/app/drops/solidify/link_list_drop.rb +7 -0
- data/app/drops/solidify/nil_drop.rb +7 -0
- data/app/drops/solidify/page_drop.rb +7 -0
- data/app/drops/solidify/search_drop.rb +7 -0
- data/app/drops/spree/address_drop.rb +28 -0
- data/app/drops/spree/image_drop.rb +32 -0
- data/app/drops/spree/line_item_drop.rb +98 -0
- data/app/drops/spree/option_type_drop.rb +4 -0
- data/app/drops/spree/order_drop.rb +64 -0
- data/app/drops/spree/product_drop.rb +97 -0
- data/app/drops/spree/taxon_drop.rb +53 -0
- data/app/drops/spree/user_drop.rb +54 -0
- data/app/drops/spree/variant_drop.rb +111 -0
- data/app/fields/spree/address_fields.rb +18 -0
- data/app/fields/spree/image_fields.rb +12 -0
- data/app/fields/spree/line_item_fields.rb +21 -0
- data/app/fields/spree/order_fields.rb +22 -0
- data/app/fields/spree/product_fields.rb +22 -0
- data/app/fields/spree/taxon_fields.rb +18 -0
- data/app/fields/spree/user_fields.rb +14 -0
- data/app/fields/spree/variant_fields.rb +19 -0
- data/app/filters/solidify/additional_filters.rb +22 -0
- data/app/filters/solidify/html_filters.rb +16 -0
- data/app/filters/solidify/money_filters.rb +39 -0
- data/app/filters/solidify/string_filters.rb +47 -0
- data/app/filters/solidify/url_filters.rb +59 -0
- data/app/helpers/solidify/liquid_helper.rb +111 -0
- data/app/helpers/solidify/shop_helper.rb +7 -0
- data/app/models/concerns/solidify/address.rb +15 -0
- data/app/models/concerns/solidify/full_name.rb +11 -0
- data/app/models/concerns/solidify/handle.rb +25 -0
- data/app/models/concerns/solidify/inventory_policy.rb +7 -0
- data/app/models/concerns/solidify/validation_cancel.rb +33 -0
- data/app/models/concerns/spree/order_state.rb +19 -0
- data/app/models/solidify/asset.rb +12 -0
- data/app/models/solidify/link.rb +10 -0
- data/app/models/solidify/link_list.rb +7 -0
- data/app/models/solidify/page.rb +5 -0
- data/app/models/solidify/setting.rb +8 -0
- data/app/models/solidify/theme.rb +19 -0
- data/app/models/spree/address_decorator.rb +13 -0
- data/app/models/spree/image_decorator.rb +7 -0
- data/app/models/spree/line_item_decorator.rb +7 -0
- data/app/models/spree/order_decorator.rb +10 -0
- data/app/models/spree/product_decorator.rb +8 -0
- data/app/models/spree/taxon_decorator.rb +20 -0
- data/app/models/spree/user_decorator.rb +9 -0
- data/app/models/spree/variant_decorator.rb +11 -0
- data/app/poro/solidify/search.rb +14 -0
- data/app/services/solidify/app_specific_string_io.rb +15 -0
- data/app/services/solidify/asset_compiler.rb +11 -0
- data/app/services/solidify/asset_postprocessor.rb +53 -0
- data/app/services/solidify/collections_all_builder.rb +12 -0
- data/app/services/solidify/link_list_seeder.rb +26 -0
- data/app/services/solidify/liquid_asset_compiler.rb +19 -0
- data/app/services/solidify/scss_asset_compiler.rb +15 -0
- data/app/services/solidify/shop_settings_seeder.rb +26 -0
- data/app/services/solidify/theme_mechanic.rb +30 -0
- data/app/uploaders/solidify/asset_uploader.rb +10 -0
- data/app/views/solidify/global/content_for_header.html.erb +0 -0
- data/app/views/solidify/themes/skeleton-theme/README.md +54 -0
- data/app/views/solidify/themes/skeleton-theme/assets/arrow-down.svg.liquid +3 -0
- data/app/views/solidify/themes/skeleton-theme/assets/cart.svg.liquid +4 -0
- data/app/views/solidify/themes/skeleton-theme/assets/shop.js.liquid +75 -0
- data/app/views/solidify/themes/skeleton-theme/assets/shopify_common.js +14 -0
- data/app/views/solidify/themes/skeleton-theme/assets/style.scss.liquid +768 -0
- data/app/views/solidify/themes/skeleton-theme/config/settings.html +217 -0
- data/app/views/solidify/themes/skeleton-theme/config/settings_data.json +26 -0
- data/app/views/solidify/themes/skeleton-theme/layout/theme.liquid +181 -0
- data/app/views/solidify/themes/skeleton-theme/snippets/article-grid-item.liquid +73 -0
- data/app/views/solidify/themes/skeleton-theme/snippets/collection-grid-item.liquid +46 -0
- data/app/views/solidify/themes/skeleton-theme/snippets/collection-listing.liquid +46 -0
- data/app/views/solidify/themes/skeleton-theme/snippets/open-graph-tags.liquid +35 -0
- data/app/views/solidify/themes/skeleton-theme/snippets/product-grid-item.liquid +70 -0
- data/app/views/solidify/themes/skeleton-theme/snippets/site-nav.liquid +57 -0
- data/app/views/solidify/themes/skeleton-theme/snippets/social-links.liquid +42 -0
- data/app/views/solidify/themes/skeleton-theme/snippets/twitter-card.liquid +41 -0
- data/app/views/solidify/themes/skeleton-theme/templates/404.liquid +2 -0
- data/app/views/solidify/themes/skeleton-theme/templates/article.liquid +160 -0
- data/app/views/solidify/themes/skeleton-theme/templates/blog.grid.liquid +30 -0
- data/app/views/solidify/themes/skeleton-theme/templates/blog.liquid +92 -0
- data/app/views/solidify/themes/skeleton-theme/templates/cart.liquid +123 -0
- data/app/views/solidify/themes/skeleton-theme/templates/collection.liquid +102 -0
- data/app/views/solidify/themes/skeleton-theme/templates/customers/account.liquid +57 -0
- data/app/views/solidify/themes/skeleton-theme/templates/customers/activate_account.liquid +26 -0
- data/app/views/solidify/themes/skeleton-theme/templates/customers/addresses.liquid +173 -0
- data/app/views/solidify/themes/skeleton-theme/templates/customers/login.liquid +90 -0
- data/app/views/solidify/themes/skeleton-theme/templates/customers/order.liquid +103 -0
- data/app/views/solidify/themes/skeleton-theme/templates/customers/register.liquid +32 -0
- data/app/views/solidify/themes/skeleton-theme/templates/customers/reset_password.liquid +27 -0
- data/app/views/solidify/themes/skeleton-theme/templates/index.liquid +39 -0
- data/app/views/solidify/themes/skeleton-theme/templates/list-collections.liquid +19 -0
- data/app/views/solidify/themes/skeleton-theme/templates/page.liquid +16 -0
- data/app/views/solidify/themes/skeleton-theme/templates/product.liquid +202 -0
- data/app/views/solidify/themes/skeleton-theme/templates/search.liquid +72 -0
- data/bin/rails +12 -0
- data/config/app.yml +0 -0
- data/config/initializers/carrierwave.rb +25 -0
- data/config/initializers/devise.rb +286 -0
- data/config/initializers/form_tag.rb +43 -0
- data/config/initializers/liquid.rb +213 -0
- data/config/initializers/sass.rb +15 -0
- data/config/initializers/spree.rb +7 -0
- data/config/initializers/theme_settings.rb +29 -0
- data/config/routes.rb +52 -0
- data/config/spring.rb +2 -0
- data/db/migrate/20170223064316_create_solidify_assets.solidify.rb +14 -0
- data/db/migrate/20170223064317_create_solidify_themes.solidify.rb +10 -0
- data/db/migrate/20170223064318_create_solidify_link_lists.solidify.rb +12 -0
- data/db/migrate/20170223064319_create_solidify_links.solidify.rb +13 -0
- data/db/migrate/20170223064320_create_solidify_settings.solidify.rb +22 -0
- data/db/migrate/20170223064321_create_solidify_pages.solidify.rb +16 -0
- data/db/migrate/20170223064322_add_attributes_to_spree_users.solidify.rb +7 -0
- data/db/migrate/20170223064323_add_handle_to_spree_taxons.solidify.rb +7 -0
- data/db/migrate/20170228115149_add_state_and_country_fields_to_spree_addresses.solidify.rb +7 -0
- data/lib/generators/solidify/install/install_generator.rb +23 -0
- data/lib/solidify.rb +11 -0
- data/lib/solidify/configuration.rb +21 -0
- data/lib/solidify/engine.rb +24 -0
- data/lib/solidify/testing_support/factories.rb +5 -0
- data/lib/solidify/testing_support/factories/assets.rb +75 -0
- data/lib/solidify/testing_support/factories/solidify_pages.rb +10 -0
- data/lib/solidify/testing_support/factories/spree_addresses.rb +9 -0
- data/lib/solidify/testing_support/factories/spree_line_items.rb +10 -0
- data/lib/solidify/testing_support/factories/spree_orders.rb +9 -0
- data/lib/solidify/testing_support/factories/spree_products.rb +8 -0
- data/lib/solidify/testing_support/factories/spree_taxons.rb +7 -0
- data/lib/solidify/testing_support/factories/spree_variants.rb +7 -0
- data/lib/solidify/testing_support/factories/themes.rb +7 -0
- data/lib/solidify/version.rb +3 -0
- data/lib/tasks/download_theme.rake +18 -0
- data/lib/tasks/seed_default_theme.rake +8 -0
- data/lib/tasks/seed_everything.rake +12 -0
- data/lib/tasks/seed_link_list.rake +8 -0
- data/lib/tasks/seed_shop_settings.rake +8 -0
- data/solidify.gemspec +61 -0
- metadata +668 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
module Solidify
|
|
2
|
+
class HomeController < LiquidController
|
|
3
|
+
def index
|
|
4
|
+
render controller_action_to_liquid_file_path
|
|
5
|
+
end
|
|
6
|
+
|
|
7
|
+
def set_liquid_assigns
|
|
8
|
+
@liquid_assigns = {
|
|
9
|
+
'canonical_url' => request.base_url.to_s,
|
|
10
|
+
'page_title' => '',
|
|
11
|
+
'template' => 'page'
|
|
12
|
+
}
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
module Solidify
|
|
2
|
+
class LiquidController < ApplicationController
|
|
3
|
+
include ::Spree::Core::ControllerHelpers::Auth
|
|
4
|
+
include ::Spree::Core::ControllerHelpers::Order
|
|
5
|
+
include ::Spree::Core::ControllerHelpers::Pricing
|
|
6
|
+
include ::Spree::Core::ControllerHelpers::Store
|
|
7
|
+
|
|
8
|
+
# rescue_from ActiveRecord::RecordNotFound, with: :render_404_page
|
|
9
|
+
|
|
10
|
+
include Solidify::Liquid
|
|
11
|
+
|
|
12
|
+
def set_liquid_assigns
|
|
13
|
+
raise 'Need to call this from subclass'
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def render_404_page(_exception = nil)
|
|
17
|
+
render(
|
|
18
|
+
status: :not_found,
|
|
19
|
+
template: controller_action_to_liquid_file_path(nil, 'home#missing'),
|
|
20
|
+
formats: [:html],
|
|
21
|
+
layout: theme_layout_file
|
|
22
|
+
)
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
module Solidify
|
|
2
|
+
class OrdersController < LiquidController
|
|
3
|
+
# Adds a new item to the order (creating a new order if none already exists)
|
|
4
|
+
def populate
|
|
5
|
+
order = current_order(create_order_if_necessary: true)
|
|
6
|
+
variant = Spree::Variant.find(params[:id])
|
|
7
|
+
quantity = params[:quantity].try(:to_i).try(:positive?)
|
|
8
|
+
quantity ||= 1
|
|
9
|
+
|
|
10
|
+
order.contents.add(variant, quantity)
|
|
11
|
+
|
|
12
|
+
redirect_to cart_path
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def set_liquid_assigns
|
|
16
|
+
@liquid_assigns = {}
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
module Solidify
|
|
2
|
+
class PagesController < LiquidController
|
|
3
|
+
def show
|
|
4
|
+
render controller_action_to_liquid_file_path(page)
|
|
5
|
+
end
|
|
6
|
+
|
|
7
|
+
def set_liquid_assigns
|
|
8
|
+
@liquid_assigns = {
|
|
9
|
+
'canonical_url' => "#{request.base_url}#{page.url}",
|
|
10
|
+
'page' => page,
|
|
11
|
+
'page_title' => page.title,
|
|
12
|
+
'template' => 'page'
|
|
13
|
+
}
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
private
|
|
17
|
+
|
|
18
|
+
def page
|
|
19
|
+
@page ||= Page.find(params[:id])
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
module Solidify
|
|
2
|
+
class ProductsController < LiquidController
|
|
3
|
+
def show
|
|
4
|
+
render controller_action_to_liquid_file_path(product)
|
|
5
|
+
end
|
|
6
|
+
|
|
7
|
+
# rubocop:disable Metrics/AbcSize
|
|
8
|
+
def set_liquid_assigns
|
|
9
|
+
if params[:variant_id].present?
|
|
10
|
+
product.selected_variant = ::Spree::Variant.find(params[:variant_id])
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
@liquid_assigns = {
|
|
14
|
+
'canonical_url' => "#{request.base_url}#{product.url}",
|
|
15
|
+
'collection' => collection,
|
|
16
|
+
'page_title' => product.title,
|
|
17
|
+
'product' => product,
|
|
18
|
+
'template' => 'product'
|
|
19
|
+
}
|
|
20
|
+
end
|
|
21
|
+
# rubocop:enable Metrics/AbcSize
|
|
22
|
+
|
|
23
|
+
private
|
|
24
|
+
|
|
25
|
+
def product
|
|
26
|
+
@product ||= ::Spree::Product.available.find(params[:id])
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def collection
|
|
30
|
+
return if params[:collection_id].blank?
|
|
31
|
+
@collection ||= ::Spree::Taxon.where(handle: params[:collection_id]).first
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
module Solidify
|
|
2
|
+
class RegistrationsController < ::Devise::RegistrationsController
|
|
3
|
+
include Solidify::Liquid
|
|
4
|
+
|
|
5
|
+
self.responder = Solidify::LiquidResponder
|
|
6
|
+
|
|
7
|
+
# rubocop:disable Metrics/LineLength
|
|
8
|
+
def set_liquid_assigns
|
|
9
|
+
@liquid_assigns = {
|
|
10
|
+
'canonical_url' => "#{request.base_url}#{new_customer_registration_path}",
|
|
11
|
+
'page_title' => 'Create Account',
|
|
12
|
+
'template' => 'page'
|
|
13
|
+
}
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
before_action :configure_sign_up_params, only: [:create]
|
|
17
|
+
|
|
18
|
+
protected
|
|
19
|
+
|
|
20
|
+
def configure_sign_up_params
|
|
21
|
+
devise_parameter_sanitizer.permit(:sign_up,
|
|
22
|
+
keys: %i(first_name last_name))
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
module Solidify
|
|
2
|
+
class LiquidResponder < ::ActionController::Responder
|
|
3
|
+
DEFAULT_ACTIONS_FOR_VERBS = {
|
|
4
|
+
post: :new, patch: :edit, put: :edit, get: :new
|
|
5
|
+
}.freeze
|
|
6
|
+
|
|
7
|
+
include LiquidHelper
|
|
8
|
+
|
|
9
|
+
def to_html
|
|
10
|
+
liquid_assigns = controller.instance_variable_get(:@liquid_assigns)
|
|
11
|
+
liquid_assigns['form'] = resource
|
|
12
|
+
|
|
13
|
+
if options[:location].present?
|
|
14
|
+
redirect_to(options[:location])
|
|
15
|
+
else
|
|
16
|
+
render_liquid_from_controller_action
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
private
|
|
21
|
+
|
|
22
|
+
def render_liquid_from_controller_action
|
|
23
|
+
controller_name = controller.controller_name
|
|
24
|
+
action_name = DEFAULT_ACTIONS_FOR_VERBS[request.request_method_symbol]
|
|
25
|
+
controller_action = "#{controller_name}##{action_name}"
|
|
26
|
+
render controller_action_to_liquid_file_path(resource, controller_action)
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
module Solidify
|
|
2
|
+
class SearchController < LiquidController
|
|
3
|
+
def index
|
|
4
|
+
render controller_action_to_liquid_file_path
|
|
5
|
+
end
|
|
6
|
+
|
|
7
|
+
def set_liquid_assigns
|
|
8
|
+
@liquid_assigns = {
|
|
9
|
+
'canonical_url' => "#{request.base_url}#{search_path}",
|
|
10
|
+
'page_title' => '',
|
|
11
|
+
'search' => search,
|
|
12
|
+
'template' => 'page'
|
|
13
|
+
}
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
private
|
|
17
|
+
|
|
18
|
+
def search
|
|
19
|
+
return @search if @search.present?
|
|
20
|
+
|
|
21
|
+
@search = if params[:q].blank?
|
|
22
|
+
Search.new
|
|
23
|
+
else
|
|
24
|
+
perform_search
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def perform_search
|
|
29
|
+
product_scope = Spree::Product.accessible_by(
|
|
30
|
+
Spree::Ability.new(current_spree_user), :read
|
|
31
|
+
)
|
|
32
|
+
search_result = product_scope.ransack(params[:q]).result
|
|
33
|
+
Search.new(
|
|
34
|
+
performed: true,
|
|
35
|
+
results: search_result,
|
|
36
|
+
results_count: search_result.count,
|
|
37
|
+
terms: params[:q]
|
|
38
|
+
)
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
module Solidify
|
|
2
|
+
class SessionsController < ::Devise::SessionsController
|
|
3
|
+
include Solidify::Liquid
|
|
4
|
+
|
|
5
|
+
self.responder = Solidify::LiquidResponder
|
|
6
|
+
|
|
7
|
+
def set_liquid_assigns
|
|
8
|
+
@liquid_assigns = {
|
|
9
|
+
'canonical_url' => "#{request.base_url}#{new_customer_session_path}",
|
|
10
|
+
'page_title' => 'Log in',
|
|
11
|
+
'template' => 'page'
|
|
12
|
+
}
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
module Spree
|
|
2
|
+
class AddressDrop < ::Liquid::Rails::Drop
|
|
3
|
+
include ::Solidify::Address
|
|
4
|
+
include ::Solidify::FullName
|
|
5
|
+
|
|
6
|
+
attributes(*AddressFields::JSON)
|
|
7
|
+
|
|
8
|
+
def default
|
|
9
|
+
@object.user_addresses.first.try(:default)
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def latitude; end
|
|
13
|
+
|
|
14
|
+
def longitude; end
|
|
15
|
+
|
|
16
|
+
def province
|
|
17
|
+
@object.state_name
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def province_code
|
|
21
|
+
@object.state_code
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def zip
|
|
25
|
+
@object.zipcode
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
module Spree
|
|
2
|
+
class ImageDrop < ::Liquid::Rails::Drop
|
|
3
|
+
attributes :id, :alt, :attached_to_variant?, :attachment, :position,
|
|
4
|
+
:product_id, :src, :variants
|
|
5
|
+
|
|
6
|
+
has_many :variants
|
|
7
|
+
|
|
8
|
+
def attached_to_variant?
|
|
9
|
+
@object.viewable.present? && !@object.viewable.is_master?
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def product_id
|
|
13
|
+
@object.viewable.try(:product_id)
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def src
|
|
17
|
+
@object.try(:attachment).try(:url)
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def variants
|
|
21
|
+
if @object.viewable.present?
|
|
22
|
+
[Spree::VariantDrop.new(@object.viewable)]
|
|
23
|
+
else
|
|
24
|
+
[]
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def as_json
|
|
29
|
+
@object.try(:attachment).try(:url).try(:as_json)
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
module Spree
|
|
2
|
+
class LineItemDrop < ::Liquid::Rails::Drop
|
|
3
|
+
attributes(*LineItemFields::JSON)
|
|
4
|
+
|
|
5
|
+
def discounts
|
|
6
|
+
[]
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
alias key id
|
|
10
|
+
|
|
11
|
+
def gift_card
|
|
12
|
+
false
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def grams
|
|
16
|
+
@object.variant.weight
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def handle
|
|
20
|
+
@object.product.handle
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def image
|
|
24
|
+
@object.variant.display_image
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def line_price
|
|
28
|
+
price * quantity
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
alias original_line_price line_price
|
|
32
|
+
|
|
33
|
+
def price
|
|
34
|
+
Spree::VariantDrop.new(@object.variant).price
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
alias discounted_price price
|
|
38
|
+
alias original_price price
|
|
39
|
+
|
|
40
|
+
def product_description
|
|
41
|
+
@object.product.description
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
def product
|
|
45
|
+
@object.product
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
def product_id
|
|
49
|
+
@object.product.id
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
alias product_title product_description
|
|
53
|
+
|
|
54
|
+
def product_type
|
|
55
|
+
Spree::ProductDrop.new(@object.product).type
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
def properties
|
|
59
|
+
nil
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
def requires_shipping
|
|
63
|
+
true
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
def title
|
|
67
|
+
Spree::VariantDrop.new(@object.variant).name
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
def total_discount
|
|
71
|
+
0
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
def url
|
|
75
|
+
Spree::VariantDrop.new(@object.variant).url
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
def variant
|
|
79
|
+
@object.variant
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
def variant_id
|
|
83
|
+
@object.variant.id
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
def variant_options
|
|
87
|
+
Spree::VariantDrop.new(@object.variant).options
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
def variant_title
|
|
91
|
+
Spree::VariantDrop.new(@object.variant).title
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
def vendor
|
|
95
|
+
Spree::ProductDrop.new(@object.product).vendor
|
|
96
|
+
end
|
|
97
|
+
end
|
|
98
|
+
end
|