Commercial: B2B components cannot be disabled individually – unnecessary CSS/JS in the storefront
Many merchants use only a portion of the B2B components included in the Commercial plugin. Features such as quote management or employee and organization management are often not required at all—for instance, because the underlying processes take place outside of the online shop. Nevertheless, the storefront assets for these components are loaded for every visitor, even though they may never actually encounter these features. Depending on the setup, this can amount to well over 100 KB of additional CSS.
Current Status
- Commercial bundles can be selectively enabled via the SHOPWARE_COMMERCIAL_ENABLED_BUNDLES environment variable. Bundles outside of the B2B scope can be omitted individually.
- In contrast, B2B bundles can only be enabled or disabled as a complete set. If only a subset is included in the list, the application will fail to start and return an error message.
- While it is possible to hide B2B features in the storefront using customer-specific configuration options, the associated assets are still delivered to the browser.
- The developer documentation does not explicitly state that B2B bundles must function as a single, inseparable unit. This can easily lead to the misconception that individual B2B components can be disabled independently.
Impact
- Unnecessary CSS/JS is loaded on every page, affecting even pure B2C customers and guest users.
- Poorer performance metrics, including lower PageSpeed scores and suboptimal Core Web Vitals.
- Merchants who utilize only specific B2B features are still forced to bear the performance cost of the entire suite.
Desired Outcome / Potential Approaches
Decouple the B2B components so that those without direct dependencies—such as quote management—can be disabled individually.
Alternatively (or additionally): Ensure that the storefront assets for B2B components are loaded only where they are actually required. B. only on the relevant pages, or only for customers for whom the feature has been enabled
Short-term: Add a note to the documentation stating that B2B bundles can only be activated or deactivated together