Sha256: 7e833723a3b9fbbf70e5ada581ff754c29fbdce5a523e63947043976143c22ef

Contents?: true

Size: 480 Bytes

Versions: 1

Compression:

Stored size: 480 Bytes

Contents

module Spree

  Order.class_eval do

    def mixpanel_track_order
      MixpanelOrdersWorker.perform_async(self.id)
    end

    def mixpanel_fields
      {
        'Number' => number,
        'Total' => total,
        'State' => state,
        'User email' => email,
        'Payment state' => payment_state
      }
    end

    def mixpanel_personal_fields
      {}
    end

    def mixpanel_event_message
      new_record? ? "Order created" : "Order updated"
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
spree_mixpanel-2.1.8 app/models/spree/order_decorator.rb