B2Bsellers Suite
API Referenceswww.b2b-sellers.comPublic demoshopRoadmap
v2.X.X+v3.X.X (Shopware 6.5/6.6)
v2.X.X+v3.X.X (Shopware 6.5/6.6)
  • Home
  • Product Tour
    • Plans & Plugin Concept
    • Public Demoshops
    • Get a personal B2B demo store?
    • Changes Made to Customers - What Are Companies, Employees and Sales Representatives
  • User Guide
    • Installation, Setup & Upgrade
      • Installation
      • Upgrade
      • Requirements
      • Easy activate all Addons and Features
      • Use Test-Customers
      • License Settings
      • Common Installation and Upgrade Errors
    • User Documentation (Alpha)
    • Configuration
      • Shop Admin Configurations
      • License, purchaseable Addons and Features configuration
      • E-Mail Templates
      • B2B Flow/Business Events
      • Registration process
      • PDP variant list
    • Configuration of purchasable Addons
      • E-Procurement (OCI-Punchout)
      • E-Procurement (cXML Purchase Order / Ariba)
      • Register Requests (wip)
      • Order Lists
      • URL Authentication
    • Performance
    • FAQs
    • Support Lifecycle & Release Strategy
    • Customer Support
  • Using HTTP Cache for Logged-In Users
  • Developer Guides
    • First Steps
      • Getting Started
      • Concept of Extensions
      • Dockware Setup (Docker)
      • How to start the b2b-platform vue.js watcher
      • How to build the b2b-platform (vue.js)
      • How to extend the B2B Platform (Storefront Vue.js)
      • Protection of the Store-API
      • How to develop your first extensions
      • CLI-Commands
        • Migration of existing Shopware Customers
      • Frosh Shopware-CLI Admin-Watcher
      • Cronjobs
      • Development Helpers
      • Example Plugins
    • Smart developer helpers
      • B2bPlatformContext
      • B2bContextTrait
      • EmployeePermissionTrait
      • B2B Body Classes
      • UseCustomer URL Parameter
      • Useful Vue.js Components for the B2B Platform
      • Useful Storefront Shopping World Elements
      • How to import external orders and offers?
    • How to's
      • Using B2Bsellers Suite with Shopware frontends
      • Add or remove subscription intervals
      • Add additional data to the order confirmation mail
    • Guides for ERP-Interface
      • Overview - Full integrated ERP-Systems
      • Integration of ERP orders to Shopware 6
      • Integration Customers and Employees from ERP
    • Tips for Deployment / Continuous Integration
    • Typical errors
  • API-References
    • Database Schema
    • Entities
      • Custom Fields for existing Shopware Entities
      • Budget
      • BudgetEmployee
      • CollectionAccount
      • CustomerPrice
      • Employee
        • EmployeeCustomer
        • EmployeePermission
        • EmployeeRole
      • CustomerActivity
        • CustomerActivityType
      • Offer
        • OfferAddress
        • OfferCustomer
        • OfferItem
        • OfferStatus
      • ProductSubscription
      • ProductSubscriptionOrder
      • PasswordlessLogin
      • PaymentCondition
      • ProductExplodedView
      • B2bProductList
        • B2bProductListItem
        • B2bProductListType
      • RegisterRequest
        • RegisterRequestStatus
        • RegisterRequestActivity
      • SalesRepresentativeCustomer
    • Store API
    • Store-API
      • Account Request
      • Customer Activity
      • Customer Activity Type
      • Customer Last Orders
      • Customer List
      • Customer Price
      • Customer Sales Ranking
      • Customer Search
      • Delivery Interval
      • Delete Product Subscription
      • Document
      • Employee
      • Employee Permission
      • Employee Role
      • Employee Order
      • Login Target List
      • Offer Document
      • Offer
      • Offer Mail
      • Offer Order
      • Offer Status
      • Ordered Products
      • Platform Cms
      • Product List
      • Product Table Listing
      • Product Subscription
      • Product Subscription List
      • Sales Statistic
      • Snippet
    • Admin API
      • General Admin-API Info
      • Order Extension
  • Release Notes
    • B2BsellersCore
      • Version v3.x.x
        • Version v3.3.2
        • Version v3.3.1
        • Version v3.3.0
        • Version v3.2.2
        • Version v3.2.1
        • Version v3.2.0
        • Version v3.1.6
        • Version v3.1.5
        • Version v3.1.4
        • Version v3.1.3
        • Version v3.1.2
        • Version v3.1.1
        • Version v3.1.0
        • Version v3.0.3
        • Version v3.0.2
        • Version v3.0.1
        • Version v3.0.0
      • Version v2.x.x
        • Version v2.4.2
        • Version v2.4.1
        • Version v2.4.0
        • Version v2.3.6
        • Version v2.3.5
        • Version v2.3.4
        • Version v2.3.3
        • Version v2.3.2
        • Version v2.3.1
        • Version v2.3.0
        • Version v2.2.6
        • Version v2.2.5
        • Version v2.2.4
        • Version v2.2.3
        • Version v2.2.2
        • Version v2.2.1
        • Version v2.2.0
        • Version v2.1.2
        • Version v2.1.1
        • Version v2.1.0
        • Version v2.0.2
        • Version v2.0.1
        • Version v2.0.0
      • Version v1.x.x
        • Version v1.1.8
        • Version v1.1.7
        • Version v1.1.6
        • Version v1.1.5
        • Version v1.1.4 - security update
        • Version v1.1.3
        • Version v1.1.2
        • Version v1.1.1
        • Version v1.1.0
        • Version v1.0.4
        • Version v1.0.3
        • Version v1.0.2
        • Version v1.0.1 - Hotfix
        • Version v1.0.0
      • Version v0.x.x (beta)
        • Version v0.9.6
        • Version v0.9.5
        • Version v0.9.4
        • Version v0.9.3
        • Version v0.9.2
        • Version v0.9.1
  • Help
    • Core Settings
      • Permanent Shopping Cart Settings Changes April 2024
Powered by GitBook
On this page
  • Advantages of Shopware Frontends
  • The API-Driven and Headless Approach
  • Integration of B2Bsellers Suite into Shopware frontends
  • A few useful hints and tasks for you:

Was this helpful?

  1. Developer Guides
  2. How to's

Using B2Bsellers Suite with Shopware frontends

In this article, you'll learn how to integrate B2Bsellers Suite with Shopware frontends to create a fully customizable e-commerce platform. The combination of these tools allows you to take advantage

Was this helpful?

Advantages of Shopware Frontends

Before we dive into the details, let's take a look at the reasons why Shopware frontends might be interesting for your project:

  • Platform agnostic customization: Shopware Frontends provides a toolkit to develop customized storefronts regardless of the platform.

  • Flexibility and customizability: This solution allows you to design the look and functionality of your online store according to your needs.

The API-Driven and Headless Approach

Both and are API-Driven and can be run headless. Use the B2Bsellers to add custom functionality to your Shopware Frontends Project, whether in the product listing page, product detail page, or checkout.

Integration of B2Bsellers Suite into Shopware frontends

These instructions also apply to other PWA applications or frameworks, because the procedure is the same.

It is so simple ...

// b2b-platform/[...all].vue

<script lang="ts">
export default {
  name: "B2bPlatformPage",
};
</script>


<script setup lang="ts">
const { isLoggedIn } = useUser();
const { apiInstance } = useShopwareContext();
const url = useRequestURL()
const { languageIdChain } = useSessionContext();

if (process.client && !isLoggedIn.value) {
  // redirect to account page if user is logged in
  navigateTo({ path: "/account" });
}

const { t } = useI18n();

const platformScript = `B2bPlatform.Platform.initializePlatform({
  context: {
    app: {
      basePath: "${url.origin}",
      languageId: "${languageIdChain.value}",
      defaultLanguageId: "${languageIdChain.value}",
      plugins: {
        "B2bOffer":{
          "css":["${apiInstance.config.endpoint}\/bundles\/b2boffer\/\/storefront\/assets\/static\/css\/b2b-offer.css"],
          "js":["${apiInstance.config.endpoint}\/bundles\/b2boffer\/\/storefront\/assets\/static\/js\/b2b-offer.js"]
        },
        "B2bEmployeeBudgets":{
          "css":[],
          "js":["${apiInstance.config.endpoint}\/bundles\/b2bemployeebudgets\/\/storefront\/assets\/static\/js\/b2b-employee-budgets.js"]
        },
        "B2bCostCenter":{
          "css":[],
          "js":["${apiInstance.config.endpoint}\/bundles\/b2bcostcenter\/\/storefront\/assets\/static\/js\/b2b-cost-center.j"]
        },
        "B2bProductSubscription":{
          "css":["${apiInstance.config.endpoint}\/bundles\/b2bproductsubscription\/\/storefront\/assets\/static\/css\/b2b-product-subscription.css"],
          "js":["${apiInstance.config.endpoint}\/bundles\/b2bproductsubscription\/\/storefront\/assets\/static\/js\/b2b-product-subscription.js"]
        },
        "B2bSalesRepresentativeFastOrder":{
          "css":[],
          "js":["${apiInstance.config.endpoint}\/bundles\/b2bsalesrepresentativefastorder\/\/storefront\/assets\/static\/js\/b2b-sales-representative-fast-order.js"]
        },
        "B2bMobileSalesPortalApp":{
          "css":[],
          "js":["${apiInstance.config.endpoint}\/bundles\/b2bmobilesalesportalapp\/\/storefront\/assets\/static\/js\/b2b-mobile-sales-portal-app.js"]
        },
        "B2bEventManager":{
          "css":["${apiInstance.config.endpoint}\/bundles\/b2beventmanager\/\/storefront\/assets\/static\/css\/b2b-event-manager.css"],
          "js":["${apiInstance.config.endpoint}\/bundles\/b2beventmanager\/\/storefront\/assets\/static\/js\/b2b-event-manager.js"]
        }
      },
      taxState: "gross",
      activeFeatures: ["B2bBonusProgram","B2bProductRequest","B2bUrlAuthentication","B2bPdpVariantList","B2bProductLists"],
      restrictions: [{"extensions":[],"name":"salesRepresentativeLimit","value":5.0}],
    },
    api: {
      basePath: "${apiInstance.config.endpoint}/store-api/",
      accessKey: "${apiInstance.config.accessToken}"
    },
    customer: {
      storeApiToken: "${apiInstance.config.contextToken}"
    }
  }
});`;
</script>


<template>
  <div class="max-w-screen-xl mx-auto">
    <div id="app">
      <div class="b2b-platform-loader is--initial d-flex justify-content-center align-items-center">
        <div class="spinner-border text-primary" role="status">
          <span>Loading...</span>
        </div>
      </div>
    </div>

    <component is="script" type="application/javascript" src="/b2b-platform/js/runtime.js"></component>
    <component is="script" type="application/javascript" src="/b2b-platform/js/vendors-node.js"></component>
    <component is="script" type="application/javascript" src="/b2b-platform/js/commons.js"></component>
    <component is="script" type="application/javascript" src="/b2b-platform/js/app.js"></component>

   // Obviously, some libraries should be included as an NPM package.
    <component is="script" src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></component>
    <component is="script" src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-Fy6S3B9q64WdZWQUiU+q4/2Lc9npb8tCaSX9FK7E8HnRr0Jz8D6OP9dO5Vg3Q9ct" crossorigin="anonymous"></component>

    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/css/bootstrap.min.css" integrity="sha384-xOolHFLEh07PJGoPkLv1IbcEPTNtaed2xpHsD9ESMhqIYd0nLMwNLD69Npy4HI+N" crossorigin="anonymous">
    <link rel="stylesheet" href="/b2b-platform/css/vendors-node.css">
    <link rel="stylesheet" href="/b2b-platform/css/app.css">

    <client-only>
    <component is="script">
      {{platformScript}}
    </component>
    </client-only>
  </div>
</template>

Feel free to use this code snippet in your Shopware Composable Frontends project.... Feel free to share your experience with Shopware frontends...

A few useful hints and tasks for you:

  • You may need to make some customizations during the integration. Note that Bootstrap is required for the B2B platform, and you may need to make styling adjustments to accommodate the storefront styling.

  • Hash tag URLs: Make sure that hash tag URLs (e.g., "b2b_platform/offer#overview") work reliably, as they can occasionally cause reloads.

  • Initializing addons: load the "initializePlatform" addon manually, as this is also present in the normal Shopware storefront. However, you can copy it to avoid conflicts.

  • Further development via Watcher: It is advisable to find a solution to further develop the B2B platform with a Watcher tool. Alternatively, you can customize the B2Bsellers Suite Watch command accordingly.

  • Do not use classic IFrames: It is not recommended to develop the B2B platform using classic IFrames.

So that was our test with Shopware Composable Frontend. We are curious if you use Shopware Composable Frontends and how you can take your B2B business to the next level.

Shopware 6
B2Bsellers Suite
Store API routes
Tada, here is the screen of the B2B platform