-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(composables): separate composable to manage cart item (#1834)
- Loading branch information
Showing
25 changed files
with
854 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
docs/landing/resources/api/composables.iusecart.broadcastupcomingerrors.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@shopware-pwa/composables](./composables.md) > [IUseCart](./composables.iusecart.md) > [broadcastUpcomingErrors](./composables.iusecart.broadcastupcomingerrors.md) | ||
|
||
## IUseCart.broadcastUpcomingErrors() method | ||
|
||
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. | ||
> | ||
<b>Signature:</b> | ||
|
||
```typescript | ||
broadcastUpcomingErrors(cart: Cart): void; | ||
``` | ||
|
||
## Parameters | ||
|
||
| Parameter | Type | Description | | ||
| --- | --- | --- | | ||
| cart | Cart | | | ||
|
||
<b>Returns:</b> | ||
|
||
void | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
docs/landing/resources/api/composables.iusecartitem.changeitemquantity.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@shopware-pwa/composables](./composables.md) > [IUseCartItem](./composables.iusecartitem.md) > [changeItemQuantity](./composables.iusecartitem.changeitemquantity.md) | ||
|
||
## IUseCartItem.changeItemQuantity property | ||
|
||
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. | ||
> | ||
<b>Signature:</b> | ||
|
||
```typescript | ||
changeItemQuantity: (quantity: number) => Promise<void>; | ||
``` |
18 changes: 18 additions & 0 deletions
18
docs/landing/resources/api/composables.iusecartitem.getproductitemseourldata.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@shopware-pwa/composables](./composables.md) > [IUseCartItem](./composables.iusecartitem.md) > [getProductItemSeoUrlData](./composables.iusecartitem.getproductitemseourldata.md) | ||
|
||
## IUseCartItem.getProductItemSeoUrlData() method | ||
|
||
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. | ||
> | ||
<b>Signature:</b> | ||
|
||
```typescript | ||
getProductItemSeoUrlData(): Promise<Partial<Product>>; | ||
``` | ||
<b>Returns:</b> | ||
|
||
Promise<Partial<Product>> | ||
|
14 changes: 14 additions & 0 deletions
14
docs/landing/resources/api/composables.iusecartitem.isproduct.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@shopware-pwa/composables](./composables.md) > [IUseCartItem](./composables.iusecartitem.md) > [isProduct](./composables.iusecartitem.isproduct.md) | ||
|
||
## IUseCartItem.isProduct property | ||
|
||
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. | ||
> | ||
<b>Signature:</b> | ||
|
||
```typescript | ||
isProduct: ComputedRef<boolean>; | ||
``` |
14 changes: 14 additions & 0 deletions
14
docs/landing/resources/api/composables.iusecartitem.ispromotion.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@shopware-pwa/composables](./composables.md) > [IUseCartItem](./composables.iusecartitem.md) > [isPromotion](./composables.iusecartitem.ispromotion.md) | ||
|
||
## IUseCartItem.isPromotion property | ||
|
||
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. | ||
> | ||
<b>Signature:</b> | ||
|
||
```typescript | ||
isPromotion: ComputedRef<boolean>; | ||
``` |
14 changes: 14 additions & 0 deletions
14
docs/landing/resources/api/composables.iusecartitem.itemimagethumbnailurl.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@shopware-pwa/composables](./composables.md) > [IUseCartItem](./composables.iusecartitem.md) > [itemImageThumbnailUrl](./composables.iusecartitem.itemimagethumbnailurl.md) | ||
|
||
## IUseCartItem.itemImageThumbnailUrl property | ||
|
||
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. | ||
> | ||
<b>Signature:</b> | ||
|
||
```typescript | ||
itemImageThumbnailUrl: ComputedRef<string>; | ||
``` |
14 changes: 14 additions & 0 deletions
14
docs/landing/resources/api/composables.iusecartitem.itemoptions.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@shopware-pwa/composables](./composables.md) > [IUseCartItem](./composables.iusecartitem.md) > [itemOptions](./composables.iusecartitem.itemoptions.md) | ||
|
||
## IUseCartItem.itemOptions property | ||
|
||
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. | ||
> | ||
<b>Signature:</b> | ||
|
||
```typescript | ||
itemOptions: ComputedRef<PropertyGroupOption[]>; | ||
``` |
14 changes: 14 additions & 0 deletions
14
docs/landing/resources/api/composables.iusecartitem.itemquantity.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@shopware-pwa/composables](./composables.md) > [IUseCartItem](./composables.iusecartitem.md) > [itemQuantity](./composables.iusecartitem.itemquantity.md) | ||
|
||
## IUseCartItem.itemQuantity property | ||
|
||
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. | ||
> | ||
<b>Signature:</b> | ||
|
||
```typescript | ||
itemQuantity: ComputedRef<number | undefined>; | ||
``` |
14 changes: 14 additions & 0 deletions
14
docs/landing/resources/api/composables.iusecartitem.itemregularprice.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@shopware-pwa/composables](./composables.md) > [IUseCartItem](./composables.iusecartitem.md) > [itemRegularPrice](./composables.iusecartitem.itemregularprice.md) | ||
|
||
## IUseCartItem.itemRegularPrice property | ||
|
||
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. | ||
> | ||
<b>Signature:</b> | ||
|
||
```typescript | ||
itemRegularPrice: ComputedRef<number | undefined>; | ||
``` |
14 changes: 14 additions & 0 deletions
14
docs/landing/resources/api/composables.iusecartitem.itemspecialprice.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@shopware-pwa/composables](./composables.md) > [IUseCartItem](./composables.iusecartitem.md) > [itemSpecialPrice](./composables.iusecartitem.itemspecialprice.md) | ||
|
||
## IUseCartItem.itemSpecialPrice property | ||
|
||
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. | ||
> | ||
<b>Signature:</b> | ||
|
||
```typescript | ||
itemSpecialPrice: ComputedRef<number | undefined>; | ||
``` |
14 changes: 14 additions & 0 deletions
14
docs/landing/resources/api/composables.iusecartitem.itemstock.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@shopware-pwa/composables](./composables.md) > [IUseCartItem](./composables.iusecartitem.md) > [itemStock](./composables.iusecartitem.itemstock.md) | ||
|
||
## IUseCartItem.itemStock property | ||
|
||
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. | ||
> | ||
<b>Signature:</b> | ||
|
||
```typescript | ||
itemStock: ComputedRef<number | undefined>; | ||
``` |
14 changes: 14 additions & 0 deletions
14
docs/landing/resources/api/composables.iusecartitem.itemtype.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@shopware-pwa/composables](./composables.md) > [IUseCartItem](./composables.iusecartitem.md) > [itemType](./composables.iusecartitem.itemtype.md) | ||
|
||
## IUseCartItem.itemType property | ||
|
||
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. | ||
> | ||
<b>Signature:</b> | ||
|
||
```typescript | ||
itemType: ComputedRef<LineItemType | undefined>; | ||
``` |
14 changes: 14 additions & 0 deletions
14
docs/landing/resources/api/composables.iusecartitem.lineitem.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@shopware-pwa/composables](./composables.md) > [IUseCartItem](./composables.iusecartitem.md) > [lineItem](./composables.iusecartitem.lineitem.md) | ||
|
||
## IUseCartItem.lineItem property | ||
|
||
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. | ||
> | ||
<b>Signature:</b> | ||
|
||
```typescript | ||
lineItem: ComputedRef<LineItem | undefined | null>; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@shopware-pwa/composables](./composables.md) > [IUseCartItem](./composables.iusecartitem.md) | ||
|
||
## IUseCartItem interface | ||
|
||
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. | ||
> | ||
interface for [useCartItem()](./composables.usecartitem.md) composable | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
export interface IUseCartItem | ||
``` | ||
|
||
## Properties | ||
|
||
| Property | Type | Description | | ||
| --- | --- | --- | | ||
| [changeItemQuantity](./composables.iusecartitem.changeitemquantity.md) | (quantity: number) => Promise<void> | <b><i>(BETA)</i></b> | | ||
| [isProduct](./composables.iusecartitem.isproduct.md) | ComputedRef<boolean> | <b><i>(BETA)</i></b> | | ||
| [isPromotion](./composables.iusecartitem.ispromotion.md) | ComputedRef<boolean> | <b><i>(BETA)</i></b> | | ||
| [itemImageThumbnailUrl](./composables.iusecartitem.itemimagethumbnailurl.md) | ComputedRef<string> | <b><i>(BETA)</i></b> | | ||
| [itemOptions](./composables.iusecartitem.itemoptions.md) | ComputedRef<PropertyGroupOption\[\]> | <b><i>(BETA)</i></b> | | ||
| [itemQuantity](./composables.iusecartitem.itemquantity.md) | ComputedRef<number \| undefined> | <b><i>(BETA)</i></b> | | ||
| [itemRegularPrice](./composables.iusecartitem.itemregularprice.md) | ComputedRef<number \| undefined> | <b><i>(BETA)</i></b> | | ||
| [itemSpecialPrice](./composables.iusecartitem.itemspecialprice.md) | ComputedRef<number \| undefined> | <b><i>(BETA)</i></b> | | ||
| [itemStock](./composables.iusecartitem.itemstock.md) | ComputedRef<number \| undefined> | <b><i>(BETA)</i></b> | | ||
| [itemType](./composables.iusecartitem.itemtype.md) | ComputedRef<LineItemType \| undefined> | <b><i>(BETA)</i></b> | | ||
| [lineItem](./composables.iusecartitem.lineitem.md) | ComputedRef<LineItem \| undefined \| null> | <b><i>(BETA)</i></b> | | ||
| [removeItem](./composables.iusecartitem.removeitem.md) | () => Promise<void> | <b><i>(BETA)</i></b> | | ||
|
||
## Methods | ||
|
||
| Method | Description | | ||
| --- | --- | | ||
| [getProductItemSeoUrlData()](./composables.iusecartitem.getproductitemseourldata.md) | <b><i>(BETA)</i></b> | | ||
|
14 changes: 14 additions & 0 deletions
14
docs/landing/resources/api/composables.iusecartitem.removeitem.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@shopware-pwa/composables](./composables.md) > [IUseCartItem](./composables.iusecartitem.md) > [removeItem](./composables.iusecartitem.removeitem.md) | ||
|
||
## IUseCartItem.removeItem property | ||
|
||
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. | ||
> | ||
<b>Signature:</b> | ||
|
||
```typescript | ||
removeItem: () => Promise<void>; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@shopware-pwa/composables](./composables.md) > [useCartItem](./composables.usecartitem.md) | ||
|
||
## useCartItem() function | ||
|
||
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. | ||
> | ||
Composable for cart item management. Options - [IUseCartItem](./composables.iusecartitem.md) | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
export declare function useCartItem({ cartItem }: { | ||
cartItem: LineItem; | ||
}): IUseCartItem; | ||
``` | ||
|
||
## Parameters | ||
|
||
| Parameter | Type | Description | | ||
| --- | --- | --- | | ||
| { cartItem } | { cartItem: LineItem; } | | | ||
|
||
<b>Returns:</b> | ||
|
||
[IUseCartItem](./composables.iusecartitem.md) | ||
|
Oops, something went wrong.
1128c69
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs: