Sha256: 76aa5d77c8af6c879f5d1ce804e4ad3a819abbc76d3a5a069d61766d665092d9

Contents?: true

Size: 604 Bytes

Versions: 1

Compression:

Stored size: 604 Bytes

Contents

module Workarea
  decorate Storefront::RecommendationsViewModel, with: :flow_io do
    # TODO base bug, product isn't passing options into product view models
    def products
      @products ||=
        begin
          results = Catalog::Product.active.purchasable.find_ordered(product_ids)

          if results.size < result_count
            results.push(
              *Catalog::Product.active.purchasable.find_ordered(popular_product_ids)
            )
          end

          Storefront::ProductViewModel.wrap(results.uniq, options.except(:sku)).take(result_count)
        end
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
workarea-flow_io-1.2.1 app/view_models/workarea/storefront/recommendations_view_model.decorator