app/helpers/spree/recently_viewed_products_helper.rb
module Spree
module RecentlyViewedProductsHelper
def cached_recently_viewed_products_ids
(cookies['recently_viewed_products'] || '').split(', ')
end
def cached_recently_viewed_products
Spree::Product.find_by_array_of_ids(cached_recently_viewed_products_ids)
end
end
end