Introduction
Assume your current solution is based on Hybris B2C accelerator. However some level of B2B incorporation can be necessary for following reasons.
- Adjustments are needed for an eventual upcoming B2B releases
- Customer model needs to realign with SAP foundational structure, and ideally use
- B2Bunit for customer accounts
- B2B customer type for B2B contacts
- Address type for shipto and billto partner functions
- Further details on how customer data is mapped between SAP ERP and hybris
- Many relevant services for B2B should be leveraged
- Related to B2B types
- or simply Related to B2B commerce functionality (see B2B features)
Technical Strategy
- Since 5.7 B2B is now just an addon for the accelerator storefront so from a code standpoint there shouldn’t be an issue
- b2c_b2b_acc recipe that allows for both accelerators setup / https://help.hybris.com/6.0.0/hcd/f09d46cf4a2546b586ed7021655e4715.html
- Current decision (first try at east) is to go with an addon approach (ant addoninstall).
- See Installing all the B2B Accelerator AddOns
- Examples (tested locally)
- ant addonuninstall -Daddonnames=”b2bacceleratoraddon” -DaddonStorefront.yacceleratorstorefront=“whrstorefront”
- ant addoninstall -Daddonnames=”commerceorgaddon” -DaddonStorefront.yacceleratorstorefront=”whrstorefront”
- Examples (tested locally)
- Scalability – think about separate storefront extensions if needed to separate b2c and b2b addon installations
- See Installing all the B2B Accelerator AddOns
- To ensure the new module is working, initialize the system and start the hybris server.
Impact Considerations
-
- Lot of the services for B2B revolve around B2BCustomer and their user rights.
- Four main groups for customer rights
- B2BAdminGroup
- B2BManagerGroup
- B2BApproverGroup
- B2BCustomerGroup
-
For the B2C and B2B configurations, there is the case of not wanting a user to access the B2B web application while using the B2C site. To handle this, the spring-filter-content.xml file of yacceleratorstorefront defines a new acceleratorSiteChannels that only support B2C. This is then injected into CmsSiteFilter, which throws a 500 Error if the user attempts to access the wrong site. The b2bacceleratoraddonAddOn then overrides this acceleratorSiteChannels in its b2bacceleratoraddon-web-spring.xml to only support B2B. Since running the two sites on the same server requires an ext-gen, these are two separate web applications and these configurations will not clash with each other.
Steps to install the B2B extensions and addons
Note: the SAP hybris version used for this was 6.0, and 6.2 (specifically steps 5 and 6 for 6.2).
- Copy the b2bacceleratoraddon from hybris/bin/ext-addon to extensions folder
- Add below to the localextensions.xml
<extension name=
"b2bacceleratorfacades"
/>
<extension name=
"acceleratorstorefrontcommons"
/>
<extension name=
"powertoolsstore"
/>
<extension dir=
"${HYBRIS_BIN_DIR}/../../extensions/b2bacceleratoraddon"
/>
- Change the <ref bean=”SiteChannel.B2C”/> in the b2bacceleratoraddon-web-spring.xml, see below.
<alias name=
"b2bAcceleratorSiteChannels"
alias=
"acceleratorSiteChannels"
/> <util:set id=
"b2bAcceleratorSiteChannels"
value-type=
"de.hybris.platform.commerceservices.enums.SiteChannel"
>
<ref bean=
"SiteChannel.B2B"
/>
<ref bean=
"SiteChannel.B2C"
/>
</util:set>
- Do the change in the b2bacceleratoraddon-spring-security-config.xmlChange below
<security:authentication-manager alias=
"authenticationManager"
>
<security:authentication-provider ref=
"B2BAcceleratorAuthenticationProvider"
/>
</security:authentication-manager>
to
<security:authentication-manager alias=
"authenticationManager"
>
<security:authentication-provider ref=
"acceleratorAuthenticationProvider"
/>
</security:authentication-manager>
- Delete SummaryCheckoutStepController.java from b2bacceleratoraddon\acceleratoraddon\web\src\de\hybris\platform\b2bacceleratoraddon\controllers\pages\checkout\steps folder.
- Remove from b2bacceleratoraddon\resources\b2bacceleratoraddon\web\spring\b2bacceleratoraddon-web-spring.xml
<bean name=
"summaryCheckoutStepController"
class
=
"de.hybris.platform.b2bacceleratoraddon.controllers.pages.checkout
.steps.SummaryCheckoutStepController"
/>
- Run the command to install the b2bacceleratoraddon
ant addoninstall -Daddonnames=
"b2bacceleratoraddon"
-DaddonStorefront.yacceleratorstorefront=
"(custom)storefront"