Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Commit

Permalink
Document the selectors for the wc/store/checkout data store (#7085)
Browse files Browse the repository at this point in the history
  • Loading branch information
nielslange authored and alexflorisca committed Sep 28, 2022
1 parent ac7a934 commit 6446933
Show file tree
Hide file tree
Showing 2 changed files with 122 additions and 0 deletions.
15 changes: 15 additions & 0 deletions docs/third-party-developers/extensibility/data-store/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Data Store

## Table of Contents

- [wc/store/checkout](checkout.md)

<!-- FEEDBACK -->

---

[We're hiring!](https://woocommerce.com/careers/) Come work with us!

🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-blocks/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./docs/third-party-developers/extensibility/checkout-payment-methods/checkout-flow-and-events.md)

<!-- /FEEDBACK -->
107 changes: 107 additions & 0 deletions docs/third-party-developers/extensibility/data-store/checkout.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
# wc/store/checkout

## Table of Contents

- [Selectors](#selectors)
- [getCustomerId](#getcustomerid)
- [getOrderNotes](#getordernotes)
- [hasError](#haserror)
- [hasOrder](#hasorder)
- [isAfterProcessing](#isafterprocessing)
- [isBeforeProcessing](#isbeforeprocessing)
- [isCalculating](#iscalculating)
- [isComplete](#iscomplete)
- [isIdle](#isidle)
- [isProcessing](#isprocessing)

## Selectors

### getCustomerId

Returns the WordPress user ID of the customer whose order is currently processed by the Checkout block.

#### _Returns_

- `number`: WordPress user ID of the customer.

### getOrderNotes

Returns the order notes.

#### _Returns_

- `string`: Order notes.

### hasError

Returns true if an error occurred, and false otherwise.

#### _Returns_

- `boolean`: Whether an error occurred.

### hasOrder

Returns true if a draft order had been created, and false otherwise.

#### _Returns_

- `boolean`: Whether a draft order had been created.

### isAfterProcessing

Returns true if an order had just been processed, and false otherwise.

#### _Returns_

- `boolean`: Whether an order had just been processed.

### isBeforeProcessing

Returns true if an order is about to be processed, and false otherwise.

#### _Returns_

- `boolean`: Whether an order is about to be processed.

### isCalculating

Returns true if there is an in-flight request to update any values, and false otherwise.

#### _Returns_

- `boolean`: Whether there is an in-flight request to update any values.

### isComplete

Returns true if the order is complete, and false otherwise.

#### _Returns_

- `boolean`: Whether the order is complete.

### isIdle

Returns true if the checkout has had some activity, but is currently waiting for user input, and false otherwise.

#### _Returns_

- `boolean`: Whether the checkout has had some activity, but is currently waiting for user input.

### isProcessing

Returns true if the checkout is processing, and false otherwise.

#### _Returns_

- `boolean`: Whether the checkout is processing.

<!-- FEEDBACK -->

---

[We're hiring!](https://woocommerce.com/careers/) Come work with us!

🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-blocks/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./docs/third-party-developers/extensibility/checkout-payment-methods/checkout-flow-and-events.md)

<!-- /FEEDBACK -->

0 comments on commit 6446933

Please sign in to comment.