Sha256: d375df4303df50b8283e8d61396420a4c6ccc5be8afeefdf8cbb1ea09f9cf137

Contents?: true

Size: 582 Bytes

Versions: 2

Compression:

Stored size: 582 Bytes

Contents

# get Notifications
Spree::BaseHelper.class_eval do
  def get_notification
    notifications = []
    session['show_notification'] = true if session['show_notification'].nil?
    if session['show_notification']
      session['show_notification'] = true
      current_time = Time.zone.now.getutc
      notifications =
        Spree::Notification.where('start_date <= :start_date_cond AND
                                  end_date >= :end_date_cond',
                                  {start_date_cond: current_time, end_date_cond: current_time})
    end
    notifications
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
spree_custom_notifications-0.2 app/helpers/base_helper_decorator.rb
spree_custom_notifications-0.1 app/helpers/base_helper_decorator.rb