LogoLogo
Partner Integrations
Salesforce Lightning B2B Commerce App 1.6
Salesforce Lightning B2B Commerce App 1.6
  • Salesforce Lightning B2B Commerce App 1.6
  • Introduction
    • How it works
    • What's new in version 1.6
  • Upgrading to version 1.6
  • 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: Integrating refunds
    • Step 16: Configure the From email address
    • Step 17 (alternative): Integrate the Digital River components into an asynchronous checkout flow
      • Custom components used in the checkout subflows
      • Subflow configuration
        • Configure the delivery method subflow
        • Configure the Checkout Summary subflow
        • Configure the Payment and Billing Address subflow
          • Edit the Payment Method screen
          • Edit the decision elements
          • Link screen components
        • Configure the shipping address subflow
          • Configure the shipping address screen
      • Configure the main checkout flow
    • Step 18 (alternative): Integrate the Digital River components into a synchronous checkout flow
      • Deploy flows using Salesforce Workbench
      • Update the flow nodes in the synchronous checkout flow
        • Create custom variables
        • Delete nodes
        • Connect nodes
        • Modify nodes
        • Add nodes
      • Configure screens for a customized synchronous flow
        • Add custom components to screens in the synchronous checkout flow
        • Configure the Shipping Options screen
        • Configure the Delivery Method Screen
        • Configure the Checkout Summary screen
        • Configure the Payment And Billing Address screen
        • Configure the Place Order Confirmation screen
    • Step 19: Add custom components to pages
      • Drag and drop (custom) components
    • Step 20: Test the Salesforce Lightning app integration
  • Extend the Salesforce Lightning app
    • Extend the Ship From address
    • Extend the webhook framework
    • Configure subscriptions
    • Shipping choice extension point
    • Customer credit
      • addCustomerCreditSourceToCheckout
      • deattachPaymentToCheckout
      • getAmountRemainingforCheckout
      • getCartDetailsById
      • Publishing connector events
    • Tax calculation
    • Overriding Digital River CSS
    • Customizing the Lightning web components
      • Designer attributes
      • Components
        • Buyer info component
        • Tax certificate component
        • DR util component
        • DR Terms component
        • Checkout summary component
        • Hide checkout summary component
        • Order Summary component
        • Place order component
        • Payments component
        • Payment details component
        • Tax identifier component
        • DR compliance component
        • Address details component
        • Offline refund component
  • User guide
    • Regulatory fees
    • Tax certificates
    • Tax identifiers
    • My wallet
    • Customer credit
    • Checkout and order creation
    • Fulfillment/cancellation flow
    • Refunds
    • Offline refunds
    • Invoices and credit memos
  • Support
  • Appendix
    • Custom fields and objects
    • Contact point address
    • Multi-currency support
Powered by GitBook
On this page
  • Order level Ship From Address extension:
  • Sample code for this class
  • Item level Ship From Address extension
  1. Extend the Salesforce Lightning app

Extend the Ship From address

Learn how to extend the Ship From Address.

PreviousExtend the Salesforce Lightning appNextExtend the webhook framework

Last updated 2 years ago

You can choose to override the Ship From Address at either the order level or the item level. If you override at the order level, there will be one ship from address for the entire order. If you override at the item level, each physical item in the cart will be assigned a ship from address. Digital items will not have a ship from address.

Order level Ship From Address extension:

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 two called the Ship From Address – Scope and Ship From Address - Provider Name. If the Ship From Address – Scope is the default, it is expected that the Ship From Address - Provider Name configuration is empty. In this case, the application uses the Ship From Address static configuration defined in other fields of the Digital River app.

To override the address at the order level, set the Ship From Address – Scope to “Order Level Scope”. An administrator can 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. This class should then be specified as the Ship From Address - Provider Name configuration.

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.

Item level Ship From Address extension

To override the address at the item level, set the Ship From Address – Scope to “Item Level Scope”. When the scope is set to item level, the connector specifies a shipFrom address for each physical CartItem in the WebCart.

To configure the Digital River app for Ship from Address at Item level, you must populate the following fields on the CartItem object for each physical item in the cart:

  • digitalriverv3_ShipFrom_City__c

  • digitalriverv3_ShipFrom_Country__c

  • digitalriverv3_ShipFrom_Postal_code__c

  • digitalriverv3_ShipFrom_State__c

  • digitalriverv3_ShipFrom_Street__c

You create a trigger, flow, or another mechanism to automate the population of shipfrom address based on the Item added to the Cart.

configurations