Home > @shopware-pwa/shopware-6-client

# shopware-6-client package

# Functions

Function Description
addCartItemQuantity(itemId, quantity, contextInstance) (BETA) Increases the current quantity in specific cart line item by given quantity.Example: If current quantity is 3 and you pass 2 as quantity parameter, you will get a new cart's state with quantity 5.
addProductToCart(productId, quantity, contextInstance) (BETA) Adds specific quantity of the product to the cart by productId. It creates a new cart line item.Warning: This method does not change the state of the cart in any way if productId already exists in a cart. For changing the quantity use addQuantityToCartLineItem() or changeCartLineItemQuantity() methods.
changeCartItemQuantity(itemId, newQuantity, contextInstance) (BETA) Changes the current quantity in specific cart line item to given quantity.Example: If current quantity is 3 and you pass 2 as quantity parameter, you will get a new cart's state with quantity 2.
createInstance(initialConfig) (BETA)
getCart(contextInstance) (BETA) Gets the current cart for the sw-context-token.
getCustomer(contextInstance) (BETA) Get customer's object
getCustomerAddresses(contextInstance) (BETA) Get all customer's addresses
getCustomerOrders(contextInstance) (BETA) Get all customer's orders
getOrderPaymentUrl({ orderId, finishUrl, }, contextInstance) (BETA) Get payment address to redirect user after placing order.
getProductPage(path, searchCriteria, contextInstance) (BETA)
getResults(term, searchCriteria, contextInstance) (BETA)
getSearchResults(term, searchCriteria, contextInstance) (BETA)
getStoreNavigation({ requestActiveId, requestRootId, depth, buildTree, searchCriteria, }, contextInstance) (BETA)
invokeGet({ address }, contextInstance) (BETA) Invoke custom GET request to shopware API. Mostly for plugins usage. You can skip domain and pass only endpoint ex. /api/my/endpoint
invokePost({ address, payload, }, contextInstance) (BETA) Invoke custom POST request to shopware API. Mostly for plugins usage. You can skip domain and pass only endpoint ex. /api/my/endpoint
login({ username, password }, contextInstance) (BETA) Login user to shopware instance.
logout(contextInstance) (BETA) End up the user session.
newsletterSubscribe(params, contextInstance) (BETA)
newsletterUnsubscribe({ email, }, contextInstance) (BETA)
removeCartItem(itemId, contextInstance) (BETA) Deletes the cart line item by id.This method may be used for deleting "product" type item lines as well as "promotion" type item lines.
searchProducts(criteria, contextInstance) (BETA) Search for products based on criteria. From: Shopware 6.4
searchSuggestedProducts(criteria, contextInstance) (BETA) Search for suggested products based on criteria. From: Shopware 6.4
sendContactForm(params, contextInstance) (BETA)

# Interfaces

Interface Description
ClientSettings (BETA)
ConfigChangedArgs (BETA)
ContactFormData (BETA)
GetStoreNavigationParams (BETA) More about the navigation parameters: https://docs.shopware.com/en/shopware-platform-dev-en/store-api-guide/navigation?category=shopware-platform-dev-en/store-api-guide
NewsletterSubscribeData (BETA)
PageResolverProductResult (BETA)
PageResolverResult (BETA)
ShopwareApiInstance (BETA)

# Variables

Variable Description
config (BETA)
getCategoryProducts (BETA) Get default amount of products and listing configuration for given category
onConfigChange (BETA)
setup (BETA) Setup configuration. Merge default values with provided in param. This method will override existing config. For config update invoke **update** method.
update (BETA) Update current configuration. This will change only provided values.