Module: Workarea::Storefront::FlowAnalyticsHelper

Defined in:
app/helpers/workarea/storefront/flow_analytics_helper.rb

Instance Method Summary collapse

Instance Method Details

#order_analytics_data(order) ⇒ Object



14
15
16
17
18
19
20
# File 'app/helpers/workarea/storefront/flow_analytics_helper.rb', line 14

def order_analytics_data(order)
  super.merge(
    total_price_currency_code: order.total_price.currency.iso_code,
    shipping_total_currency_code: order.shipping_total.currency.iso_code,
    tax_total_currency_code: order.tax_total.currency.iso_code
  )
end

#order_item_analytics_data(item) ⇒ Object



10
11
12
# File 'app/helpers/workarea/storefront/flow_analytics_helper.rb', line 10

def order_item_analytics_data(item)
  super.merge(currency_code: item.current_unit_price.currency.iso_code)
end

#product_analytics_data(product) ⇒ Object



4
5
6
7
8
# File 'app/helpers/workarea/storefront/flow_analytics_helper.rb', line 4

def product_analytics_data(product)
  super.merge(
    currency_code: product.sell_min_price&.currency&.iso_code,
  ).compact
end