Cert++
Close

Dynamic buyer group assignment with the Buyer Group extension

Key Takeaway

To assign buyer groups at runtime, extend CommerceBuyGrp.BuyerGroupEvaluationService and override getBuyerGroupIds to return the appropriate buyer group IDs.

Buyer groups decide what a shopper sees in a B2B store, such as products, prices and promotions. The Buyer Group extension lets a developer write custom Apex that decides which buyer groups a shopper belongs to while they browse. Shoppers get personalized experiences without anyone assigning them by hand.

What the extension does and where it works

Out of the box, buyer group membership is limited to account-based, market-based or data segment-based buyer groups. The Buyer Group extension lets you add your own business rules, so you don't have to rely only on fixed membership.

Your custom Apex runs each time a shopper visits a page in the store and assigns them to buyer groups based on your criteria. Product visibility, pricing and promotions are then targeted to that shopper right away, with no manual intervention.

A parts store wants members of its loyalty program to see loyalty prices. A developer writes that rule in custom Apex. When Dana, a loyalty member, opens a product page, the Apex runs and assigns her to the loyalty buyer group. Dana sees the loyalty prices right away, and nobody had to assign her by hand.

The extension works for both guest and authenticated (logged-in) shoppers.

Store support is limited. The extension works for B2B stores and for D2C stores with custom checkout enabled. The extension is not available for stores using managed checkout, so a D2C store on managed checkout must move to custom checkout first.

Salesforce Accredited B2B Commerce Developer Professional Study Guide

Checklist progress

0/124Learned

Manage data intelligently with regard to relationships and integrations as needed to support getting a B2B Storefront established and running

0/29

Product bundles versus product sets

Learn this concept

Tiered and volume pricing data model

Learn this concept

WebCart and its related cart objects

Learn this concept

Prepare for the Exam

Play Today's Certle

Study Community

Ask questions and get the latest info from other Salesforce Accredited B2B Commerce Developer Professional studiers.