woocommerce/plugins/woocommerce-blocks/docs/extensibility/available-slot-fills.md

3.9 KiB

Available Slots

To see how to use a slotFill, check this document.

This is a list of available slots that you can use. If you want to add a new slotFill, check this document.

Note About Naming: Slots that are prefixed with Experminetal are, as they say, exprimental and not final, they're are subject to change or remove, once they graduate from expermintal, the naming would change so you should be aware of that. Check the Feature Gating document from more information.

ExperimentalOrderMeta

This Slot renders below the Checkout summary section and above the "Proceed to Checkout" button in the Cart.

image

Passed parameters

  • cart: wc/store/cart data but in camelCase instead of snake_case. Object breakdown.
  • extensions: external data registered by third-party developers using ExtendRestAPI. If you used ExtendRestAPI on wc/store/cart you would find your data under your namespace here.

ExperimentalOrderShippingPackages

This slot renders inside the shipping step of Checkout and inside the shipping options in Cart.

Cart:

image

Checkout:

image

Passed parameters

  • collapsible: Boolean If a shipping package panel should be collapsible or not, this is false in Checkout and true in Cart.
  • collapse: Boolean If a panel should be collapsed by default, this is true if there's more than 1 fill registered (Core Shipping options are registered as a fill and they're counted).
  • showItems: Boolean If we should show the content of each package, this is true if there's more than 1 fill registered (Core Shipping options are registered as a fill and they're counted).
  • 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 in camelCase instead of snake_case. Object breakdown.
  • extensions: external data registered by third-party developers using ExtendRestAPI, if you used ExtendRestAPI on wc/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 contains ShippingRatesControlPackage.

ExperimentalDiscountsMeta

This slot renders below the CouponCode input.

Cart: Cart showing ExperimentalDiscountsMeta location

Checkout: Checkout showing ExperimentalDiscountsMeta location

Passed paramters

  • cart: wc/store/cart data but in camelCase instead of snake_case. Object breakdown.
  • extensions: external data registered by third-party developers using ExtendRestAPI, if you used ExtendRestAPI on wc/store/cart you would find your data under your namespace here.