e39a27bd74
* Dummy commit to open a PR * Revert the last change * Ensure Checkout block supports the theme-level global styles for `Colors » Buttons` (https://github.com/woocommerce/woocommerce-blocks/pull/8844) * Add GS support for button colors in Checkout block * Sync button hover effect with GB * Fix link margin/padding (https://github.com/woocommerce/woocommerce-blocks/pull/8908) * Replace <AddToCartButton /> with <ProductButton /> (https://github.com/woocommerce/woocommerce-blocks/pull/8914) * Add GS support for button typography in Checkout block (https://github.com/woocommerce/woocommerce-blocks/pull/8918) * Ensure Checkout block supports the theme-level global styles for Typography » Buttons (https://github.com/woocommerce/woocommerce-blocks/pull/8892) * Remove classname from cart image to avoid conflicts (https://github.com/woocommerce/woocommerce-blocks/pull/8898) Co-authored-by: Niels Lange <info@nielslange.de> * Use consistent and semantically correct HTML elements in the Cart and Checkout blocks (https://github.com/woocommerce/woocommerce-blocks/pull/9065) * Allow button height to adjust * Ensure to display full width heading background * Inherit font style and font weight for headings * Inherit font style and font weight for textarea * Inherit font family and font weight for buttons --------- Co-authored-by: Niels Lange <info@nielslange.de> Co-authored-by: Mike Jolley <mike.jolley@me.com> |
||
---|---|---|
.. | ||
blocks-registry | ||
components | ||
filter-registry | ||
slot | ||
utils | ||
README.md | ||
index.js | ||
style.scss |
README.md
Checkout
Table of Contents
Components and utilities making it possible to integrate with the WooCommerce Mini Cart, Cart and Checkout Blocks.
Installation
This package is available as an external when the WooCommerce Blocks Feature Plugin is installed and activated.
Usage
Package components can be accessed via the wc
global:
const { ... } = wc.blocksCheckout;
Aliased imports
Alternatively, you can map this to externals (or aliases) using the WooCommerce Dependency Extraction Webpack Plugin. Just add the above Webpack plugin to your package.json:
npm install @woocommerce/dependency-extraction-webpack-plugin --save-dev
Now, you can include this plugin in your Webpack configuration:
// webpack.config.js
const WooCommerceDependencyExtractionWebpackPlugin = require( '@woocommerce/dependency-extraction-webpack-plugin' );
module.exports = {
// …snip
plugins: [ new WooCommerceDependencyExtractionWebpackPlugin() ],
};
Folder Structure Overview
This package contains the following directories. Navigate to a directory for more in depth documentation about each module.
Directory | Contents |
---|---|
blocks-registry/ |
Used to register new Inner Blocks that can be inserted either automatically or optionally within the Checkout Block. Example use case: Creating a newsletter subscription block on the Checkout. |
components/ |
Components available for use by Checkout Blocks. |
filter-registry/ |
Used to manipulate content where filters are available. Example use case: Changing how prices are displayed. (Documentation) |
slot/ |
Slot and Fill are a pair of components which enable developers to render in a React element tree. In this context, they are used to insert content within Blocks where slot fills are available. Example use case: Adding a custom component after the shipping options. (Documentation) |
utils/ |
Miscellaneous utility functions for dealing with checkout functionality. |
We're hiring! Come work with us!
🐞 Found a mistake, or have a suggestion? Leave feedback about this document here.