LogoLogo
Connectors
Salesforce Lightning B2B Commerce App 1.0.1
Salesforce Lightning B2B Commerce App 1.0.1
  • Salesforce Lightning B2B Commerce App 1.0.1
  • Introduction
    • How it works
  • Integrate the Salesforce Lightning app
    • Step 1: Install the Digital River app
    • Step 2: Configure the Digital River app
    • Step 3: Register external services
    • Step 4: Configure DCM logs
    • Step 5: Add custom fields to the page layouts
    • Step 6: Enable email deliverability
    • Step 7: Import ECCN codes, tax groups, and tax types
    • Step 8: Configure and synchronize the products
    • Step 9: Schedule backend jobs
    • Step 10: Set up integration between Salesforce and Digital River
    • Step 11: Set up webhooks
    • Step 12: Configure landed cost
    • Step 13: Manage permission sets
    • Step 14: Configure shipping integration
    • Step 15: Integrate the Digital River components into the checkout flow
    • Step 16: Test the Salesforce Lightning app integration
  • Extend the Salesforce Lightning app
    • Extend the ship from address
    • Extend the webhook framework
    • Configure subscriptions
  • User guide
    • Regulatory fees
    • Tax certificates
    • Tax identifiers
    • My wallet
    • Checkout and order creation
    • Fulfillment/cancellation flow
    • Refunds
    • Invoices and credit memos
  • Support
  • Appendix
    • Custom fields and objects
    • Enable or disable US tax certificates
    • Contact point address
    • Multi-currency support
Powered by GitBook
On this page
  1. Extend the Salesforce Lightning app

Extend the ship from address

Learn how to extend the Ship From Address.

The current version of the Salesforce Lightning app provides an extension point for setting the Ship From Address (Warehouse location) based on the client’s business requirements. After implementation, this extension point will override the Ship From Address attributes specified in the Digital River App settings.

The Digital River app provides a configuration called the Ship From Address - Provider Name. If this configuration is empty (that is, the Default setting), the application uses the Ship From Address static configuration defined in other fields of the Digital River app.

An administrator has the ability to implement an Apex interface that the Digital River application delivers as part of the package, DRB2B_CheckoutFromAddressProvider.

The Apex class that implements this interface can be specified as a provider of Ship from Address information for the checkout flow.

An example of such a class is CustomCheckoutShipFromAddressProvider.

Sample code for this class

global class CustomCheckoutShipFromAddressProvider implements 
digitalriverv3.DRB2B_CheckoutFromAddressProvider {
    global digitalriverv3.DRB2B_Address 
    getAddress(digitalriverv3.DRB2B_CheckoutContext context) {
        digitalriverv3.DRB2B_Address address = new 
        digitalriverv3.DRB2B_Address ();
 
  Id cartId = context.cartId;

        // Add business logic
        address.country = 'US';
        address.state = 'NY';
        address.postalCode = '31232';
        address.city = 'New York';
        address. line1 = '123 Main St.';
 
        return address;
    }
}

The getAddress (context) method takes in a checkout context as input as shown above.

Currently, the CartId is passed in the Checkout context. The Cartid is obtained by using context.cartId.

The name of the class can be specified in the Ship from Address - Provider Name field of the Digital River App configuration.

PreviousExtend the Salesforce Lightning appNextExtend the webhook framework

Last updated 3 years ago