docs
  1. Customization
  2. Dynamic Slots
  3. Integrating Slots

Integrating Slots

  1. Available slot names
    1. Authentication Step
    2. Shipping Step
    3. Payment Step
    4. Basket
  2. Styling
  3. Events
  4. Methods
  5. Types
  6. Examples
    1. Show all available slot names on the page
    2. Injecting static HTML into the top of the basket
    3. Injected a web component within a slot element
    4. Mutating the state
    5. Sorting and filtering
    6. Listen for change in the order state

Available slot names

A comprehensive list of all slot names where content can be added.

  • slot_dynamic_area_guest
  • slot_dynamic_area_register
  • slot_option_sign_in
  • slot_option_register
  • slot_option_guest
  • slot_option_selected_sign_in
  • slot_option_selected_register
  • slot_option_selected_guest

Styling

The content injected into the slot should come with its own styles as these are not inherited from the parent.

Events

Since slots can be clickable, if content is injected into one of the non-selected option slots, the slotContent will require an onclick attribute to dispatch an event that propagates the option click/switch on the checkout side. Make sure the event name matches with the slot name.

Methods

Within the window.scayleCheckoutFunctions.mutations object, we expose native checkout methods to be used within the storefront within slots implementation that requires logic such as immediately returning the current state.

The full types are listed below within the types section

Types

CheckoutState
AddressSuggestion
GiftCard
ConfirmOrderResponse
BasketItem
SignInPayload
RegisterPayload
SetPasswordForCustomerNumberPayload
SetBasketItemQuantityPayload
SetBasketItemQuantityContext
RemoveBasketItemPayload
RemoveBasketItemContext
SetCarrierAndShippingOptionPayload
SetCollectionPointPayload
AddressForSubmissionPayload
SetDynamicFieldsPayload
SetPaymentOptionPayload
UpdatePaymentOptionPayload
RemoveGiftCardPayload
AddGiftCardPayload
AddDiscountPayload
RemoveDiscountPayload
RemoveRecurringPaymentMethodPayload
LoyaltyProgramPayload
LoyaltyPromotionPayload
RedeemLoyaltyProgramPointsPayload
ConfirmOrderPayload

Examples

Show all available slot names on the page

Injecting static HTML into the top of the basket

Injected a web component within a slot element

Please contact your SCAYLE Account Manager for access to internally developed add-ons such as Ingrid.

Mutating the state

Native checkout functions are exposed via the window object and can be interacted with from the storefront. Above you find the entire list of exposed checkout mutations.

The above snippet of code will execute the addVoucher method with a code of "TEST123"

Listening for a change in the order state

Sorting Payment Options

Filtering Payment Options

The above filtering and sorting works after the next /state update call. When the checkout mounts, we automatically make this call which would filter the payment options and apply the filters on every subsequent /state update.

If it is needed to manually get the latest state immediately, this can be done by calling window.scayleCheckoutFunctions.mutations.getState()