Skip to content


This is an overview of all the utility functions bound to the shopware global object. Utility functions provide many useful shortcuts for common tasks, see how to use them in your plugin here. Or see the code that registers them here

General functions

createIdReturns a uuid string in hex format. Generated with uuidlink
throttleCreates a throttled function that only invokes func at most once per every wait
debounceCreates a debounced function that delays invoking func until after wait milliseconds have elapsed since the last time the debounced function was
flowCreates a function that returns the result of invoking the given functions with the this binding of the created function, where each successive invocation is supplied the return value of the
getGets the value at path of objectlink


deepCopyObjectDeep copy an object
hasOwnPropertyShorthand method for Object.prototype.hasOwnProperty
getObjectDiffGets a simple recursive diff of two objects. Does not consider an entity schema or entity related logic.
getArrayChangesCheck if the compared array has changes.
cloneDeepCreates recursively a clone of
mergeThis method is like _.assign except that it recursively merges own and inherited enumerable string keyed properties of source objects into the destination
mergeWithThis method is like _.merge except that it accepts customizer which is invoked to produce the merged values of the destination and source
deepMergeObjectDeep merge two objects
getGets the value at path of objectlink
setSets the value at path of objectlink
pickCreates an object composed of the picked object


warnGeneral logging function which provides a unified style of log messages for developers. Please keep the log in mind. Messages will be displayed in the developer console when they're running the application in development mode.
debugThe same as warn but instead of console.warn it uses console.error.


currencyConverts a number to a formatted currency. Especially helpful for template filters.
dateFormats a Date object to a localized string with the native Intl.DateTimeFormat method
fileSizeFormats a number of bytes to a string with a unit
md5Generates a md5 hash with md5-es of a given value.


getScrollbarHeightReturns the scrollbar height of an HTML element.
getScrollbarWidthReturns the scrollbar width of an HTML element.
copyToClipboardUses the browser's copy function to copy a string


capitalizeStringConverts the first character of string to upper case and the remaining to lower
camelCaseConverts string to camel
kebabCaseConverts string to kebab
snakeCaseConverts string to snake
md5Generates a md5 hash with md5-es of a given value.
isEmptyOrSpacesGets if the content of the string is really empty. This does also removes any whitespaces that might exist in the text.
isUrlChecks if the provided value is a URL
isValidIpChecks if the provided value is an IP with this Regex


isObjectChecks if value is the language type of Object. (e.g. arrays, functions, objects, regexes, new Number(0), and new String(''))link
isPlainObjectChecks if value is a plain object, that is, an object created by the Object constructor or one with a [[Prototype]] of
isEmptyChecks if value is an empty object, collection, map, or
isRegExpChecks if value is classified as a RegExp
isArrayChecks if value is classified as an Array
isFunctionChecks if value is classified as a Function
isDateChecks if value is classified as a Date
isStringChecks if value is classified as a String primitive or
isBooleanChecks if value is classified as a boolean primitive or
isEqualPerforms a deep comparison between two values to determine if they are
isNumberChecks if value is classified as a Number primitive or
isUndefinedChecks if value is


readAsArrayBufferReads a file as an ArrayBufferlink
readAsDataURLReads a file as a Data-URLlink
readAsTextReads a file as textlink
getNameAndExtensionFromFileGets the name and extension from a file
getNameAndExtensionFromUrlGets the name and extension from a URL


afterSortSorts the elements by their after id property chain


flattenDeepRecursively flattens
removeRemoves all elements from array that predicate returns truthy for and returns an array of the removed elementslink
sliceCreates a slice of array from start up to, but not including,
uniqByThis method is like _.uniq except that it accepts iteratee which is invoked for each element in array to generate the criterion by which uniqueness is