Class: Workarea::Admin::Discounts::ShippingViewModel
Instance Method Summary
collapse
#amount_type_options, #application_options, #code_list_options, #compatible_discounts, #excluded_categories, #excluded_products, #insights, #max_applications_options, #order_total_operator_options, #promo_code_options, #rules_summary, #selected_application_option, #selected_promo_code_option, #slug, #timeline, #workflow_params, wrap
#comment_count, #comments, #has_comments?, #new_comments_for?
Instance Method Details
#condition_options ⇒ Object
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
# File 'app/view_models/workarea/admin/discounts/shipping_view_model.rb', line 9
def condition_options
[
[
t('workarea.admin.pricing_discounts.options.for_everyone'),
nil
],
[
t('workarea.admin.pricing_discounts.options.when_order_total'),
'order_total'
],
[
t('workarea.admin.pricing_discounts.options.when_user_is_tagged'),
'user_tag'
]
]
end
|
#selected_condition_option ⇒ Object
26
27
28
29
30
31
32
|
# File 'app/view_models/workarea/admin/discounts/shipping_view_model.rb', line 26
def selected_condition_option
if order_total?
'order_total'
elsif user_tag?
'user_tag'
end
end
|
#shipping_service_options ⇒ Object
5
6
7
|
# File 'app/view_models/workarea/admin/discounts/shipping_view_model.rb', line 5
def shipping_service_options
@shipping_service_options ||= Shipping::Service.all.map { |m| [m.name] }
end
|