- ExperimentalOrderMeta
- ExperimentalOrderShippingPackages
- ExperimentalOrderLocalPickupPackages
- ExperimentalDiscountsMeta
This document presents the list of available Slots that you can use for adding your custom content (Fill).
If you want to add a new SlotFill component, check the Checkout - Slot Fill document. To read more about Slot and Fill, check the Slot and Fill document.
Note About Naming: Slots that are prefixed with Experimental
are experimental and subject to change or remove. Once they graduate from the experimental stage, the naming would change and the Experimental
prefix would be dropped. Check the Feature Gating document from more information.
This Slot renders below the Checkout summary section and above the "Proceed to Checkout" button in the Cart.
/**
* External dependencies
*/
import { __ } from '@wordpress/i18n';
import { registerPlugin } from '@wordpress/plugins';
import { ExperimentalOrderMeta } from '@woocommerce/blocks-checkout';
const render = () => {
return (
<ExperimentalOrderMeta>
<div class="wc-block-components-totals-wrapper">
{
__( 'Yearly recurring total ...', 'YOUR-TEXTDOMAIN' )
}
</div>
</ExperimentalOrderMeta>
);
};
registerPlugin( 'slot-and-fill-examples', {
render,
scope: 'woocommerce-checkout',
} );
Cart:
Checkout:
cart
:wc/store/cart
data but incamelCase
instead ofsnake_case
. Object breakdown.extensions
: external data registered by third-party developers usingExtendSchema
. If you usedExtendSchema
onwc/store/cart
you would find your data under your namespace here.context
, equal to the name of the Block in which the fill is rendered:woocommerce/cart
orwoocommerce/checkout
This slot renders inside the shipping step of Checkout and inside the shipping options in Cart.
/**
* External dependencies
*/
import { __ } from '@wordpress/i18n';
import { registerPlugin } from '@wordpress/plugins';
import { ExperimentalOrderShippingPackages } from '@woocommerce/blocks-checkout';
const render = () => {
return (
<ExperimentalOrderShippingPackages>
<div>
{
__( 'Express Shipping', 'YOUR-TEXTDOMAIN' )
}
</div>
</ExperimentalOrderShippingPackages>
);
};
registerPlugin( 'slot-and-fill-examples', {
render,
scope: 'woocommerce-checkout',
} );
Cart:
Checkout:
collapsible
:Boolean|undefined
If a shipping package panel should be collapsible or not, this is false in Checkout and undefined in Cart.collapse
:Boolean
If a panel should be collapsed by default, this is true if if panels are collapsible.showItems
:Boolean|undefined
If we should show the content of each package, this is undefined in Cart and Checkout and is left to the actual package logic to decide.noResultsMessage
: A React element that you can render if there are no shipping options.renderOption
: a render function that takes a rate object and returns a render option.cart
:wc/store/cart
data but incamelCase
instead ofsnake_case
. Object breakdown.extensions
: external data registered by third-party developers usingExtendSchema
, if you usedExtendSchema
onwc/store/cart
you would find your data under your namespace here.components
: an object containing components you can use to render your own shipping rates, it containsShippingRatesControlPackage
.context
, equal to the name of the Block in which the fill is rendered:woocommerce/cart
orwoocommerce/checkout
This slot renders inside the Checkout Pickup Options block in the Checkout block. It does not render in the Cart block.
/**
* External dependencies
*/
import { __ } from '@wordpress/i18n';
import { registerPlugin } from '@wordpress/plugins';
import { ExperimentalOrderLocalPickupPackages } from '@woocommerce/blocks-checkout';
const render = () => {
return (
<ExperimentalOrderLocalPickupPackages>
<div>
{
__( 'By using our convenient local pickup option, you can come to our store and pick up your order. We will send you and email when your order is ready for pickup.', 'YOUR-TEXTDOMAIN' )
}
</div>
</ExperimentalOrderLocalPickupPackages>
);
};
registerPlugin( 'slot-and-fill-examples', {
render,
scope: 'woocommerce-checkout',
} );
Checkout:
renderPickupLocation
: a render function that renders the address details of a local pickup option.cart
:wc/store/cart
data but incamelCase
instead ofsnake_case
. Object breakdown.extensions
: external data registered by third-party developers usingExtendSchema
, if you usedExtendSchema
onwc/store/cart
you would find your data under your namespace here.components
: an object containing components you can use to render your own pickup rates, it containsShippingRatesControlPackage
andRadioControl
.
This slot renders below the CouponCode
input.
/**
* External dependencies
*/
import { __ } from '@wordpress/i18n';
import { registerPlugin } from '@wordpress/plugins';
import { ExperimentalDiscountsMeta } from '@woocommerce/blocks-checkout';
const render = () => {
return (
<ExperimentalDiscountsMeta>
<div class="wc-block-components-totals-wrapper">
{
__( 'You have 98683 coins to spend ...', 'YOUR-TEXTDOMAIN' )
}
</div>
</ExperimentalDiscountsMeta>
);
};
registerPlugin( 'slot-and-fill-examples', {
render,
scope: 'woocommerce-checkout',
} );
Cart:
Checkout:
cart
:wc/store/cart
data but incamelCase
instead ofsnake_case
. Object breakdown.extensions
: external data registered by third-party developers usingExtendSchema
, if you usedExtendSchema
onwc/store/cart
you would find your data under your namespace here.context
, equal to the name of the Block in which the fill is rendered:woocommerce/cart
orwoocommerce/checkout
We're hiring! Come work with us!
🐞 Found a mistake, or have a suggestion? Leave feedback about this document here.