Sha256: caf53a3e1b859903720ad267ff48ab9e27e9fc4ef39d53fa5381de819842e971

Contents?: true

Size: 622 Bytes

Versions: 1

Compression:

Stored size: 622 Bytes

Contents

module Workarea
  decorate Search::Storefront::Product, with: :flow_io do
    def numeric
      super.merge(localized_selling_prices)
    end

    def sorts
      super.merge(localized_sort_prices)
    end

    private

      def localized_sort_prices
        pricing.localized_min_sell_prices.map do |experience_key, price|
          ["price_#{experience_key}".systemize, price]
        end.to_h
      end

      def localized_selling_prices
        pricing.localized_selling_prices.map do |experience_key, prices|
          ["price_#{experience_key}".systemize, prices.compact.uniq]
        end.to_h
      end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
workarea-flow_io-1.2.1 app/models/workarea/search/storefront/product.decorator