Sha256: 6375c67f6f1ea74ae0737057d7ba0f74a7124e284c50193138b9a520f40167fe

Contents?: true

Size: 439 Bytes

Versions: 3

Compression:

Stored size: 439 Bytes

Contents

module Workarea
  module Storefront
    module ProductGridContent
      def product_position_offset
        page_number = options[:page].present? ? options[:page].to_i - 1 : 0

        page_number * Workarea.config.per_page
      end

      def product_grid_content_for(position)
        product_grid_content_blocks.select do |block|
          block.position == (position + product_position_offset)
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
workarea-product_grid_content-1.4.0 app/view_models/workarea/storefront/product_grid_content.rb
workarea-product_grid_content-1.3.1 app/view_models/workarea/storefront/product_grid_content.rb
workarea-product_grid_content-1.3.0 app/view_models/workarea/storefront/product_grid_content.rb