Home > @shopware-pwa/composables

# composables package

Vue's composables to be used in Shopware frontend application.

# Functions

Function Description
createListingComposable({ searchMethod, searchDefaults, listingKey, }) Factory to create your own listing. By default you can use useListing composable, which provides you predefined listings for category(cms) listing and product search listing. Using factory you can provide our own compatible search method and use it for example for creating listing of orders in my account.
createShopware(app, options) (BETA) Create ShopwarePlugin vue instance. Shpware PWA composables rely on this config.
getApplicationContext(params) (BETA) Get the current application context values. The context is either a scope or a component instance. This method checks if the context contains all the necessary data.This method will likely change in future in order to provide full Vue3 compability.
getDefaultApiParams() (BETA) Returns default system API params
useAddToCart(params) (BETA) Add product to cart. Options - IUseAddToCart
useBreadcrumbs(params) (BETA) Composable for displaying and setting breadcrumbs for page.
useCart() (BETA) Composable for cart management. Options - IUseCart
useCheckout() (BETA) Composable for Checkout management. Options - IUseCheckout
useCms(params) (BETA)
useCountries() (BETA)
useCountry(props) (BETA)
useCurrency() (BETA)
useCustomerAddresses() (BETA) Composable for user's addresses management. Options - IUseCustomerAddresses
useCustomerOrders() (BETA) Composable for listing customer orders. Options - IUseCustomerOrders
useCustomerPassword() (BETA) Composable for customer password management. Options - IUseCustomerPassword
useDefaults(params) (BETA) Returns default config depending on config key. It is used in composables, so defaultsKey is in most cases composable name (ex. useDefaults({ defaultsKey: "useCms" }))
useIntercept() Allows to broadcast and intercept events across application.
useListing(params) (BETA)
useNavigation(params) (BETA) Composable for navigation. Options - IUseNavigation
useNotifications() (BETA)
useOrderDetails(params) (BETA) Composable for managing an existing order.
useProduct(params) (BETA)
useProductAssociations(params) (BETA) Get product association entity. Options - IUseProductAssociations
useProductConfigurator(params) (BETA) Product options - IUseAddToCart
useProductQuickSearch() (BETA)
useSalutations() (BETA)
useSessionContext() (BETA) Composable for session management. Options - IUseSessionContext
useSharedState() Replacement for Vuex. Composable, which enables you to use shared state in your application. State is shared both on server and client side.
useUIState(params) (BETA) Simple state management for UI purposes.
useUser() (BETA) Composable for user management. Options - IUseUser
useWishlist(params) (BETA)

# Interfaces

Interface Description
IInterceptorCallbackFunction interface for the callback function of interceptors
IUseAddToCart (BETA) interface for useAddToCart() composable
IUseCart (BETA) interface for useCart() composable
IUseCheckout (BETA) interface for useCheckout() composable
IUseCountries (BETA)
IUseCountry (BETA)
IUseCurrency (BETA)
IUseCustomerAddresses (BETA) interface for useCustomerAddresses() composable
IUseCustomerOrders (BETA) interface for useCustomerOrders() composable
IUseCustomerPassword (BETA) interface for useCustomerPassword() composable
IUseListing Listing interface, can be used to display category products, search products or any other Shopware search interface (ex. orders with pagination)
IUseNavigation (BETA) interface for useNavigation() composableProvides state for navigation trees depending on navigation type.
IUseProduct (BETA)
IUseProductAssociations (BETA) interface for IUseProductAssociations composable
IUseProductConfigurator (BETA) interface for useProductConfigurator() composable
IUseProductQuickSearch (BETA)
IUseSalutations (BETA)
IUseSessionContext (BETA) interface for useSessionContext() composable
IUseUser (BETA) interface for useUser() composable
IUseWishlist (BETA) interface for useWishlist() composable
Notification_2 (BETA)
ShopwareDomain (BETA)

# Variables

Variable Description
INTERCEPTOR_KEYS (BETA) Keys used accross composables with the name of incommint parameters.
ShopwareVuePlugin (BETA)

# Type Aliases

Type Alias Description
ListingType (BETA)
Search (BETA)
SwInterceptor (BETA)
SwInterceptors (BETA)
SwRouting (BETA) Routing type for Shopware SEO path resolvers