Sha256: ab9a067540d8c532047d1145b8b756043ee8175a3afa9e724456dcf3a1086ff4
Contents?: true
Size: 762 Bytes
Versions: 29
Compression:
Stored size: 762 Bytes
Contents
module Spree module V2 module Storefront class EstimatedShippingRateSerializer < BaseSerializer set_type :shipping_rate cache_options store: nil attributes :name, :selected, :cost, :tax_amount, :shipping_method_id attribute :final_price do |shipping_rate| shipping_rate.cost end attributes :display_cost, :display_final_price do |object, params| Spree::Money.new(object.cost, currency: params[:currency]).to_s end attribute :display_tax_amount do |object, params| Spree::Money.new(object.tax_amount, currency: params[:currency]).to_s end attribute :free do |object| object.cost.zero? end end end end end
Version data entries
29 entries across 29 versions & 3 rubygems