docs
  1. Look And Feel
  2. Dynamic Slots
  3. Integrating Slots

Integrating Slots

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 can not be 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 for use in the storefront. These methods can be leveraged in slot implementations that require logic, such as immediately returning the current state.

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

Showing all available slot names on the page

Injecting static HTML into the top of the basket

Injecting 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 code snippet above executes the addVoucher method using the voucher code "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() .