From 4af1815c5ba760e97d666674e6f5844f8909154a Mon Sep 17 00:00:00 2001 From: Shahed Nasser Date: Mon, 15 Sep 2025 19:18:20 +0300 Subject: [PATCH] chore: add a link to the storefront docs for cart item totals type (#13514) --- packages/core/types/src/http/cart/common.ts | 54 ++++++++++++++++++--- 1 file changed, 46 insertions(+), 8 deletions(-) diff --git a/packages/core/types/src/http/cart/common.ts b/packages/core/types/src/http/cart/common.ts index 8609f24230..dbc81f157f 100644 --- a/packages/core/types/src/http/cart/common.ts +++ b/packages/core/types/src/http/cart/common.ts @@ -353,43 +353,59 @@ export interface BaseCartShippingMethod { /** * The original total of the cart shipping method. + * This field is only available if you expand the `shipping_methods.*` relation. Learn more in the + * [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-shipping-method-totals) guide. */ - original_total: number + original_total?: number /** * The original subtotal of the cart shipping method. + * This field is only available if you expand the `shipping_methods.*` relation. Learn more in the + * [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-shipping-method-totals) guide. */ - original_subtotal: number + original_subtotal?: number /** * The original tax total of the cart shipping method. + * This field is only available if you expand the `shipping_methods.*` relation. Learn more in the + * [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-shipping-method-totals) guide. */ - original_tax_total: number + original_tax_total?: number /** * The total of the cart shipping method. + * This field is only available if you expand the `shipping_methods.*` relation. Learn more in the + * [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-shipping-method-totals) guide. */ - total: number + total?: number /** * The subtotal of the cart shipping method. + * This field is only available if you expand the `shipping_methods.*` relation. Learn more in the + * [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-shipping-method-totals) guide. */ - subtotal: number + subtotal?: number /** * The tax total of the cart shipping method. + * This field is only available if you expand the `shipping_methods.*` relation. Learn more in the + * [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-shipping-method-totals) guide. */ - tax_total: number + tax_total?: number /** * The discount total of the cart shipping method. + * This field is only available if you expand the `shipping_methods.*` relation. Learn more in the + * [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-shipping-method-totals) guide. */ - discount_total: number + discount_total?: number /** * The discount tax total of the cart shipping method. + * This field is only available if you expand the `shipping_methods.*` relation. Learn more in the + * [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-shipping-method-totals) guide. */ - discount_tax_total: number + discount_tax_total?: number } /** @@ -573,56 +589,78 @@ export interface BaseCartLineItem extends BaseCartLineItemTotals { export interface BaseCartLineItemTotals { /** * The original total of the cart line item. + * This field is only available if you expand the `items.*` relation. Learn more in the + * [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-cart-item-totals) guide. */ original_total?: number /** * The original subtotal of the cart line item. + * This field is only available if you expand the `items.*` relation. Learn more in the + * [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-cart-item-totals) guide. */ original_subtotal?: number /** * The original tax total of the cart line item. + * This field is only available if you expand the `items.*` relation. Learn more in the + * [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-cart-item-totals) guide. */ original_tax_total?: number /** * The item total of the cart line item. + * This field is only available if you expand the `items.*` relation. Learn more in the + * [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-cart-item-totals) guide. */ item_total?: number /** * The item subtotal of the cart line item. + * This field is only available if you expand the `items.*` relation. Learn more in the + * [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-cart-item-totals) guide. */ item_subtotal?: number /** * The item tax total of the cart line item. + * This field is only available if you expand the `items.*` relation. Learn more in the + * [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-cart-item-totals) guide. */ item_tax_total?: number /** * The total of the cart line item. + * This field is only available if you expand the `items.*` relation. Learn more in the + * [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-cart-item-totals) guide. */ total?: number /** * The subtotal of the cart line item. + * This field is only available if you expand the `items.*` relation. Learn more in the + * [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-cart-item-totals) guide. */ subtotal?: number /** * The tax total of the cart line item. + * This field is only available if you expand the `items.*` relation. Learn more in the + * [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-cart-item-totals) guide. */ tax_total?: number /** * The discount total of the cart line item. + * This field is only available if you expand the `items.*` relation. Learn more in the + * [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-cart-item-totals) guide. */ discount_total?: number /** * The discount tax total of the cart line item. + * This field is only available if you expand the `items.*` relation. Learn more in the + * [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-cart-item-totals) guide. */ discount_tax_total?: number }