Sha256: aa3dd61ada4002ddd299989c386a2776552fe1363db726839d8888cb20d8977f

Contents?: true

Size: 1.15 KB

Versions: 28

Compression:

Stored size: 1.15 KB

Contents

module Workarea
  module Admin
    module Discounts
      class CategoryViewModel < DiscountViewModel
        include Categories

        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_item_quantity'),
              'item_quantity'
            ],
            [
              t('workarea.admin.pricing_discounts.options.when_user_is_tagged'),
              'user_tag'
            ],
            [
              t('workarea.admin.pricing_discounts.options.when_in_segment'),
              'segments'
            ]
          ]
        end

        def selected_condition_option
          if order_total?
            'order_total'
          elsif item_quantity?
            'item_quantity'
          elsif user_tag?
            'user_tag'
          elsif active_segment_ids.present?
            'segments'
          end
        end
      end
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
workarea-admin-3.5.27 app/view_models/workarea/admin/discounts/category_view_model.rb
workarea-admin-3.5.26 app/view_models/workarea/admin/discounts/category_view_model.rb
workarea-admin-3.5.25 app/view_models/workarea/admin/discounts/category_view_model.rb
workarea-admin-3.5.23 app/view_models/workarea/admin/discounts/category_view_model.rb
workarea-admin-3.5.22 app/view_models/workarea/admin/discounts/category_view_model.rb
workarea-admin-3.5.21 app/view_models/workarea/admin/discounts/category_view_model.rb
workarea-admin-3.5.20 app/view_models/workarea/admin/discounts/category_view_model.rb
workarea-admin-3.5.19 app/view_models/workarea/admin/discounts/category_view_model.rb
workarea-admin-3.5.18 app/view_models/workarea/admin/discounts/category_view_model.rb
workarea-admin-3.5.17 app/view_models/workarea/admin/discounts/category_view_model.rb
workarea-admin-3.5.16 app/view_models/workarea/admin/discounts/category_view_model.rb
workarea-admin-3.5.15 app/view_models/workarea/admin/discounts/category_view_model.rb
workarea-admin-3.5.14 app/view_models/workarea/admin/discounts/category_view_model.rb
workarea-admin-3.5.13 app/view_models/workarea/admin/discounts/category_view_model.rb
workarea-admin-3.5.12 app/view_models/workarea/admin/discounts/category_view_model.rb
workarea-admin-3.5.11 app/view_models/workarea/admin/discounts/category_view_model.rb
workarea-admin-3.5.10 app/view_models/workarea/admin/discounts/category_view_model.rb
workarea-admin-3.5.9 app/view_models/workarea/admin/discounts/category_view_model.rb
workarea-admin-3.5.8 app/view_models/workarea/admin/discounts/category_view_model.rb
workarea-admin-3.5.7 app/view_models/workarea/admin/discounts/category_view_model.rb