Sha256: 8661fefa5d7405c7023fa99a11b42743c2a035b3dd480c11dad40fa56bef73c6

Contents?: true

Size: 679 Bytes

Versions: 1

Compression:

Stored size: 679 Bytes

Contents

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

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

      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
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
workarea-flow_io-1.2.1 app/helpers/workarea/storefront/flow_analytics_helper.rb