Home > @shopware-pwa/helpers

# helpers package

# Functions

Function Description
debounce(fn, delay) Debouce helper to invoke a method with a delay
getCmsEntityByType(page)
getCmsLayoutConfiguration(content) (BETA)
getCmsLink(content) Gets the link of a cms slot
getCmsLinkTarget(content) Return the target attribute for the cms link
getCmsTechnicalPath(page)
getListingFilters(aggregations) (BETA)
getProductCalculatedListingPrice(product) (BETA) Get the calculated list price
getProductCalculatedPrice(product) (BETA) Get the calculated list price
getProductFreeShipping(product) Get product free shipping property
getProductFromPrice(product) (BETA)
getProductMainImageUrl(product) gets the cover image
getProductMediaGallery({ product, }) Get the media gallery of a product as ui-interfaces
getProductName({ product }) (BETA)
getProductNumber(product) Get product number propety
getProductOptions({ product, }) Get product options as ui-interfaces
getProductPriceDiscount(product) (BETA) Get value of price discount
getProductPriceDiscountPercentage(product) (BETA) Get the percentage value of discount
getProductProperties({ product, }) Get product properties as ui-interfaces
getProductQtySteps(product, availableStockParam, qtySteps) Get product qty steps
getProductRatingAverage(product) Get product rating average property
getProductRealPrice(product) (BETA)
getProductReviews({ product, }) Format product reviews to ui-interfaces
getProductThumbnailUrl(product) (BETA) get the thumbnail image URL with the smallest width
getProductTierPrices(product) (BETA) Get the prices depending on quantity added to cart. Tier prices can be set in Advanced pricing tab in Product view (admin panel)
getProductUrl(product) Get product url. The priority is SEO url and then technical url.
getProductVariantsFromPrice(product) (BETA)
getTranslatedProperty(element, property) Get translated property from the given object.
isProductSimple({ product, }) (BETA)
loadScript(src) (BETA) Helper for plugins to load external scripts for plugins
mapCountries(countries) Map available countries to (name: string | null, id: string) format
mapSalutations(salutations) Map available salutations to (name: string, id: string) format
toggleSearchFilter(currentFilters, filter) It creates new selected filters object based on the filter existence

# Interfaces

Interface Description
LayoutConfiguration (BETA)
ListingFilter
MappedSalutation
TierPrice (BETA)
UiMediaGalleryItem
UiMediaGalleryItemUrl
UiProductOption
UiProductProperty
UiProductReview

# Variables

Variable Description
getCategoryUrl (BETA) Get URL for category.
isLinkCategory (BETA)