You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was using the wix eCommerce API. In particular, I was using the currentCart API. However, I found out there are missing type definitions in currentCart.Cart .
The below is the API response upon calling currentCart.Cart.
You can see, there is a field called subtotal. However, there seems to be no type definitions for the field subtotal in the CurrentCart.Cart present inside ecom-v1-cart-current-cart.public of node modules.
As a temporary fix, I did the below
import{currentCart}from"@wix/ecom";import{WixClient}from"@/context/wixContext";// structure of the subtotal fieldtypeSubtotal={amount?: string;convertedAmount?: string;formattedAmount?: string;formattedConvertedAmount?: string;};// extend currentCart.Cart to include the subtotal fieldtypeExtendedCart=currentCart.Cart&{subtotal?: Subtotal;};typeCartState={cart: ExtendedCart;isLoading: boolean;counter: number;getCart: (wixClient: WixClient)=>void;addItem: (wixClient: WixClient,productId: string,variantId: string,quantity: number,)=>void;removeItem: (wixClient: WixClient,itemId: string)=>void;};
Raising this issue to get the type definitions of the { currentCart } from "@wix/ecom"fixed.
The text was updated successfully, but these errors were encountered:
I was using the wix eCommerce API. In particular, I was using the
currentCart
API. However, I found out there are missing type definitions incurrentCart.Cart
.The below is the API response upon calling
currentCart.Cart
.You can see, there is a field called
subtotal
. However, there seems to be no type definitions for the field subtotal in theCurrentCart.Cart
present insideecom-v1-cart-current-cart.public
of node modules.As a temporary fix, I did the below
Raising this issue to get the type definitions of the
{ currentCart } from "@wix/ecom"
fixed.The text was updated successfully, but these errors were encountered: