diff --git a/api/app/serializers/spree/v2/storefront/cart_serializer.rb b/api/app/serializers/spree/v2/storefront/cart_serializer.rb index 51b11aa5b68..3c33f81ec09 100644 --- a/api/app/serializers/spree/v2/storefront/cart_serializer.rb +++ b/api/app/serializers/spree/v2/storefront/cart_serializer.rb @@ -9,7 +9,7 @@ class CartSerializer < BaseSerializer :display_included_tax_total, :tax_total, :currency, :state, :token, :email, :display_item_total, :display_ship_total, :display_adjustment_total, :display_tax_total, :promo_total, :display_promo_total, :item_count, :special_instructions, :display_total, - :pre_tax_item_amount, :display_pre_tax_item_amount + :pre_tax_item_amount, :display_pre_tax_item_amount, :pre_tax_total, :display_pre_tax_total has_many :line_items has_many :variants diff --git a/api/docs/v2/storefront/index.yaml b/api/docs/v2/storefront/index.yaml index 27343e75305..259a7b7aedd 100644 --- a/api/docs/v2/storefront/index.yaml +++ b/api/docs/v2/storefront/index.yaml @@ -1465,6 +1465,12 @@ components: display_pre_tax_item_amount: type: string example: '$17.00' + pre_tax_total: + type: string + example: '20.00' + display_pre_tax_total: + type: string + example: '$20.00' item_count: type: number example: 2 diff --git a/api/lib/spree/api/testing_support/v2/current_order.rb b/api/lib/spree/api/testing_support/v2/current_order.rb index 1f7adcba40a..94a79f6dc95 100644 --- a/api/lib/spree/api/testing_support/v2/current_order.rb +++ b/api/lib/spree/api/testing_support/v2/current_order.rb @@ -50,6 +50,8 @@ def ensure_order_totals expect(json_response['data']).to have_attribute(:display_total).with_value(order.display_total.to_s) expect(json_response['data']).to have_attribute(:pre_tax_item_amount).with_value(order.pre_tax_item_amount.to_s) expect(json_response['data']).to have_attribute(:display_pre_tax_item_amount).with_value(order.display_pre_tax_item_amount.to_s) + expect(json_response['data']).to have_attribute(:pre_tax_total).with_value(order.pre_tax_total.to_s) + expect(json_response['data']).to have_attribute(:display_pre_tax_total).with_value(order.display_pre_tax_total.to_s) expect(json_response['data']).to have_relationships(:user, :line_items, :variants, :billing_address, :shipping_address, :payments, :shipments, :promotions) end end