@shopware/helpers
v1.6.0
Published
Shopware helpers for accessing API data
Downloads
5,007
Readme
shopware/frontends - helpers
Welcome to @shopware/helpers package.
For getting started documentation visit https://frontends.shopware.com/
Documentation specific for this package: helpers
Reusable classes
The helpersCssClasses variable, defined in the cms/layoutClasses.ts helper file, comprises an array of class names utilized within the CMS.
To enhance type support, a union type HelpersCssClasses is defined, which encompasses all class names present in the helpersCssClasses array.
const visibilityMap: Record<CmsVisibility, HelpersCssClasses> = {
mobile: "max-md:hidden",
tablet: "md:max-lg:hidden",
desktop: "lg:hidden",
};These classes can be integrated into a custom template, thereby ensuring consistency across different packages. For example as a safelist classes in unocss configuration file
import { helpersCssClasses } from "@shopware/helpers";
export default defineConfig({
safelist: helpersCssClasses,
});Changelog
Full changelog for stable version is available here
Latest changes: 1.6.0
Minor Changes
#1985
2cbda25Thanks @mkucmus! - Added methods to extract product info:isProductOnSaleisProductTopSellergetProductManufacturerName
#2176
c647bafThanks @mkucmus! - - AddgetProductListingFromCmsPagehelper to extract product listing from CMS page structure- Enable early access to listing data during SSR before component tree renders
Patch Changes
#2030
22ff62eThanks @mkucmus! - ExtendedListingFiltertype to support property options and manufacturer entities:- Added optional
optionsproperty for property group options - Added optional
entitiesproperty for manufacturer entities - Improved type safety by explicitly typing empty array return in
getListingFilters()
- Added optional
#2153
56cd178Thanks @mkucmus! - FixgetSrcSetForMediato properly encode special characters (spaces, commas, parentheses) in media URLs#2162
e1fae3eThanks @mkucmus! - Export encodeUrlPath helper function to properly handle special characters (spaces, commas) in image URLs
