Configuring the Magento 2 extension

STEP 1: Connecting to Salesforce

For an introduction to the Salesforce integration, see Introduction.

Before you begin

Connect to Salesforce

In the Magento Admin panel, navigate to Salesforce (tab) > Configuration > General Configuration.

Expand Salesforce API (section) and you will see:

  1. Change Integration Mode to "Magento Salesforce (only)" or "Bi-directional".
  2. Enter your API Username and API Password (your Username and Password for Salesforce account).
  3. Enter your Security Token (In some cases token is not required, please check with your Salesforce Administrator for more information). To reset your Security Token use the following instruction: https://help.salesforce.com/articleView?id=user_security_token.htm&type=5
  4. Enter the path to your WSDL file, but we are hoping you've already saved the file. Related article: Magento 2 & Salesforce: Installation Instructions
  5. Verify your connection configuration by clicking the "Test Connection & Apply Changes" button.
  6. If the connection was successful, click Save Config at the top right of the page.

STEP 2: Select the Type of Synchronization

Expand Advanced section and select synchronization mode from Message Queue drop-down list

  • Standard - Message Queue work with CRON
  • RabbitMQ - send Message Queue via RabbitMQ

To use the Message Queue you need to configure Cron jobs and consumers: Magento 2 CRON & MQ Setup 

STEP 3: Synchronize Magento Websites

In Magento Admin panel, navigate to Stores (tab) > Settings > All Stores.

Step 3.1: assign pricebook for every website

  • Default Pricebook - A website-specific Salesforce custom pricebook to be used to hold Magento catalog prices.


Step 3.2: run the sync process on the grid page:


Before you can synchronize any customers and/or orders, you must synchronize all Magento websites with Salesforce. You can do this by clicking on Sync Websites with Salesforce button or simply opening any Magento website in this list and clicking the Save button on the edit screen.

STEP 4: State and Country Picklists

In the Magento Admin panel, navigate to Salesforce (tab) > Configuration > General Configuration.

Expand the Advanced (section) section. 

Set "Developer Mode" to "Yes"

Enable this feature only if your Salesforce organization leverages State and Country picklists for addresses. 

For success synchronization data from Magento to Salesforce (orders, customer address, etc) when "State and Country picklists" option is enabled, countries and states from Magento should match with countries and states in Salesforce. But some countries in Magento by default does not contain states

In this case, you could install our Country State module. This module will help you to insert all newly created countries' states from Salesforce to Magento. Customer will see new states in the Country drop-down list

For more information refer to next article Country State

  • Developer Mode - simply adds some extra advanced configuration settings. You should only be using these after you consult with PowerSync.

STEP 5: Debugging and Logging

Expand the Debug and Logging section. When developer mode is enabled, you can configure the settings required for audit and debugging purposes.

  • Enable Log - allows Powersync integration to log all its transactions to the server.
  • Database Logging - allows PowerSync integration to store partial transaction data and allows you to access that data via Magneto Admin panel
  • Database Log Limit - The maximum number of records to be stored in the database.

Do NOT enable Database Logging if your store is heavily loaded 


STEP 6: Customers Configuration

Customer configuration consists of several sections. Complete all tasks discussed in the sections that follow.

Get started configuring customers

In Magento Admin panel, navigate to Salesforce (tab) > Configuration > Customers.

OptionDescription
Automated Synchronization
  • Set to Yes (default) to cause the system to automatically capture changes (creation or editing events) in Magento and trigger the Salesforce synchronization process.
  • Set to No to manually trigger the Salesforce synchronization process. In the Magento Admin Panel, go to Customers > All Customers, select one or more customers, and click Sync with Salesforce from the Action menu.
Sync All Groups
  • Set to Yes (default) to automatically synchronize all Magento customer groups with Salesforce.
  • Set to No to limit which Magento customer groups should synchronize with Salesforce.

Default Owner

Specifies the user as which a new Salesforce account is assigned. The default owner is a Salesforce user that will be assigned as an owner for any new account Magento has to create in Salesforce.

Contact Assignee

Similar to Default Owner, specifies the record owner for a new Contact record in Salesforce. A contact assignee is typically assigned to one customer.

Force into a single Account

  • Set to Yes to use one Salesforce account for all Magento customers. (This is a good option if you are not a fan of Salesforce Person Account feature.)
  • Set to No to choose a Salesforce account for Magento customers.
Guest Address
  • Set to Capture to capture guest addresses at checkout at the contact level.
  • Set to Skip to capture guest addresses at the order level.
Contact de-duplication
  • Set to Automatically to automatically de-duplicate contact data. We base this on:
    • Global customers (same login for every Magento website): The Magento customer's email address.
    • Separate customer accounts per website: The customer's email and website.
  • Set to Leave Duplicates to allow duplicates to remain in your Salesforce contact data.
Account de-duplication
  • Set to Automatically to automatically de-duplicate account data. We base this on an exact account name match (for example, "Microsoft" and "Microsoft Inc." would be considered two different accounts).
  • Set to Leave Duplicates to allow duplicates to remain in your Salesforce account data.

B2B & B2C Account Configuration

OptionDescription
Default B2B Account TypeRecord type to be used for the account record when creating new accounts from Magento. You can choose Default or an existing account type.

B2C Account

  • Click Not Used if your organization does not use Salesforce Person Accounts.
  • Click Enabled to configure Salesforce Person Accounts natively. From the Default B2C Account Type list, click an Account Record Types from Salesforce. This record type will be used for Magento customers if Magento were to create a new customer in Salesforce.
Business Process

Click one of the following:

  • Only use B2B Accounts: When you create new Magento customers, Magento always creates a B2B account and contact if no match is found in Salesforce.
  • Only use B2C Accounts: When you create new Magento customers, Magento always creates a B2C Account if not match is found in Salesforce.
  • Use both B2B and B2C: When you create new Magento customers, Magento automatically do the following based on whether or not the customer provided a company name during registration or checkout:
    • B2C account if a company name was specified.
    • B2B account and contact if no company name was specified.

Leads Integration

OptionDescription
Leverage Salesforce Leads
  • Set to Yes to Implement Salesforce best practices. PowerSync treats all customers in Magneto without an order as a lead in Salesforce. When a lead places an order in Magento, the lead becomes a B2B or B2C record in Salesforce.
  • Set to No to treat every Magento customer is treated as a B2C or B2B record(s) in Salesforce by default.

Converted Lead Status

Default lead status for the integration to use when converting leads in Salesforce.
Lead Assignment RuleTriggers the execution of the Lead Assignment Rule in Salesforce when managing Leads
Default OwnerIf a new Salesforce lead needs to be created in Salesforce, the Powersync Magento + Salesforce Integration assigns the specified Salesforce user as a record owner for the newly created lead.
Lead SourceA lead source to be used in Salesforce to segment leads coming from the Magento website.
Include into lookup
  • Set to Yes to apply additional filtering logic for the lead lookup to leverage segmentation or use a more global approach to find existing leads in the system regardless of a channel from which the lead came.
  • Set to No to not apply additional filtering.
Lead de-duplication

Automation built to ensure your Lead data in Salesforce remains clean. We base this on:

  • Global customers (same login for every Magento website): The Magento customer's email address.
  • Separate customer accounts per website: The Magento customer's email and website.

From Salesforce

These settings are meaningful only if Salesforce is configured to push data to Magento. Refer to Salesforce to Magento 2 sync setup for more information.

OptionDescription
Create New Customers
  • Set to Yes to enable Salesforce to create new Magento customers.
  • Set to No to prevent Salesforce from creating new Magento customers.
Email New Customers
  • Set to Send welcome email for Magento to send a standard email to newly created Magento customers (when those customers are created by Powersync integration from Salesforce). This email can, for example, instruct customers to create a password for their Magento account.
  • Set to Do not send any emails for Magento to not send emails to new customers.
Default Customer Group

Specify a group to which to add a customer

Default Customer Website

Specify a website to which to add a customer  when a new customer is created from Salesforce without specifying a website.

STEP 7: Products Configuration

In the Magento Admin panel, navigate to Salesforce (tab) > Configuration > Products.

  • Automated Synchronization
    • Set to Yes to enable the Powersync system to automatically capture creation or editing events in Magento and trigger the Salesforce synchronization process.
    • Set to No to synchronize manually using the Magento Admin Panel at Catalog > Products. Select one or more products and click Sync with Salesforce from the Action menu.
  • Sync with all Pricebooks
    • Set to Yes - Magento will send to SF information about product prices from all websites where those products are assigned including inactive websites for the product at the moment.
    • Set to No - product will be synchronized to assigned website pricebooks except inactive for the product at the moment.
  • Price Accuracy - Specify the number of decimal places when synchronizing product prices with Salesforce.
  • Cause Product sync by scheduled update
    • Set to Yes - If you have a scheduled product update in Magento (Enterprise only feature), scheduled changes will be synced to Salesforce once the scheduled changes take effect.
    • Set to No - Scheduled product changes will not update Salesforce.

STEP 8: Order Configuration

In Magento Admin panel, navigate to Salesforce (tab) > Configuration > Orders. Complete all of the following sections in the order presented.

Order Configuration

ItemDescription
Automated Synchronization
  • Set to Yes to automatically capture changes (creation or editing events) in Magento and trigger Salesforce synchronization process.
  • Set to No to manually synchronize order data using the Magento Admin panel at Sales > Orders. Select one or more orders and click Sync with Salesforce from the Action menu.

Zero Grand Total

  • Set to Synchronize to synchronize orders with a zero grand total to Salesforce.
  • Set to Do not synchronize to not synchronize orders with a zero grand total to Salesforce.
Synchronize Order Notes
  • Set to Yes to synchronize Magento order notes with Salesforce.
  • Set to No to not synchronize Magento order notes with Salesforce.
Update Order Info
  • Set to Yes to allow Magento to push additional order information to Salesforce on every order status change. This helps resolve issues caused by, for example, a typo in a shipping address. This option allows the system to update both the order status and the shipping address at the same time.
  • Set to No to prevent Magento from pushing additional order information to Salesforce on every order status change.
Default StatusSpecify a default order status to be used when making changes to the order (marks an incomplete order or changes being made).

Sync all orders

  • Set to Yes to synchronize all orders from Magento to Salesforce.
  • Set to No to synchronize only some the order types you select from Magento to Salesforce.

Advanced

ItemDescription
Create Order

Specifies when the PowerSync integration should create a Salesforce order:

  • For paid order: Creates a Salesforce order only when the Magento order is Paid.
  • For every order: Creates a Salesforce order for every Magento order.
Create Opportunity

Specifies when the PowerSync integration should create a Salesforce Opportunity to capture potential sales in Magento:

  • For every order: When a customer clicks Proceed to Checkout, a Salesforce Opportunity is created. A Salesforce Order is created when an order in Magento is Paid.
  • No - A Salesforce Order is created only when a Magento order is Paid.

Examples:

  • Create Opportunity set to No, Create Order set to For every paid order. No opportunity is created but when the order is paid, Powersync creates an  order in Salesforce.
  • Create Order set to For paid order, Create Opportunity set to For every order. The Salesforce opportunity is created when the customer places the order. When the order is placed, the opportunity status is updated. When the order is paid, the opportunity status is changed to Closed Won. Powersync creates the order in Salesforce and links the order to the opportunity to show where the order originated from. 

Enable Contact Roles

  • Set to Yes to cause the Powersync integration to assign a Salesforce Contact to the Opportunity (linking the customer and a potential order).
  • Set to No to prevent the Powersync integration from assigning a contact.
Opportunity Customer RoleChoose the Magento customer role for the created Salesforce Opportunity. Decision Maker is the typical role for e-commerce use cases.
Abandoned Cart StatusOpportunity Stage Name when checkout process begins 
Default Opportunity Draft StatusOrder's Opportunities will be placed in this Draft status when Magento needs to make updates
Sales Cycle Length

Enter the number of days for the Salesforce Opportunity close date.

Convert Opportunity

  • Set to Yes - Update Opportunity Stage name if the order is paid in Magento and set the Stage name to match the value set in Converted Opportunity Status.
  • Set to No - Keep Opportunity Stage name as defined on Opportunity Status mapping page
Converted Opportunity StatusOpportunity status used to identify a Closed Won Opportunity.

Use Invoice date as close date

  • Set to Yes to allow Powersync to update the Close Date on the Opportunity when the order is paid to make sure the Close Date matches the date on the invoice.
  • Set to No to cause Powersync to update the Close Date when the order is placed.

Currency Configuration

Make updates to Currency Configuration only if both Magento and Salesforce are configured to handle more than one currency.

  • Mult-Currency - Set to Yes if your Salesforce system is configured to handle more than one currency.
  • Which currency should be used - Advanced setting allowing Powersync to choose if a base store currency and price should be used during synchronization or the currency the customer has selected to use during the checkout process.

Shopping Cart

OptionDescription
Bundled Products
  • Set to Sync Bundled product including all products from the bundle to synchronize with Salesforce all bundled items, and the bundle itself, with Salesforce.
  • Set to Sync Bundled product only to synchronize with Salesforce the bundled product only.
  • Set to Sync child product only to synchronize with Salesforce the child product only
Configurable Products
  • Set to Child Product to synchronize only the simple (child) product with Salesforce for all orders.
  • Set to Parent Product to synchronize only the configurable product with Salesforce for all orders.
Create deleted products in Salesforce
  • Set to Yes to synchronize all products, including deleted products, with Salesforce.
  • Set to No to synchronize only existing products with Salesforce.

From Salesforce

  • Default Payment Method - This default payment method will be used when new orders are coming from Salesforce without a payment method provided.
  • Default Shipping Method - This default payment method will be used when new orders are coming from Salesforce without a shipping method provided.

STEP 9: Invoices Integration Setup

In Magento Admin panel, navigate to Salesforce (tab) > Configuration > Invoices.

This integration is only available for customers who also use our Fulfilment package add-on that comes with this Magento + Salesforce integration.


  • Enable Invoice Synchronization:
    • Set to Yes to enable Powersync to automatically capture changes (creation or editing events) in Magento and trigger a Salesforce synchronization process.
    • Set to No to manually synchronize invoice data using the Magento Admin panel.

STEP 10: Shipments Integration Setup

In Magento Admin panel, navigate to Salesforce (tab) > Configuration > Shipments.

This integration is available only for customers who also use our Fulfilment package add-on that comes with the Magento + Salesforce integration.

  • Enable Invoice Synchronization:
    • Set to Yes to if enable Powersync to automatically capture changes (creation or editing events) in Magento and trigger the Salesforce synchronization process.
    • Set to No to manually synchronize using the Magento Admin panel.
  • Delete tracking numbers in Salesforce:
    • Set to Yes to allow Powersync to delete tracking numbers in Salesforce if they are removed in Magento.
    • Set to No to preserve tracking numbers in Salesforce.
  • Delete tracking numbers in Magento:
    • Set to Yes to allow Powersync to delete tracking numbers in Magento if they are removed in Salesforce.
    • Set to No to preserve tracking numbers.

STEP 11: Mapping Order Statuses

Order and Opportunity Status mapping pages can be found by navigating to Salesforce (tab) > Field Mappings > Order Status or Salesforce (tab) > Field Mappings > Opportunity Status.

Each status mapping gives you granular control and the ability to set the system of record at each mapping level.

  • Website - Click the website to which to apply these mappings.
  • Magento Attribute - displays a searchable list of all available Order Statuses in Magento
  • Salesforce Attribute - displays a list of all available Salesforce Order statues or Opportunity Stage Names
  • Default Value - Allows you to specify the default status to be used
  • Magento > Salesforce Settings & Salesforce > Magento Settings - allow you to control when the status can and will be updated from one system to another.


STEP 12: Object Field Mappings

Just like Order and Opportunity Status mapping pages, you are able to access other mapping pages for all integrated objects. You can get to each mapping page by navigating to Salesforce (tab) > Field Mappings (section).

Below is an example of a product mapping page

Each mapping gives you the most granular control and the ability to set the system of record at each mapping level.

  • Magento Attribute - displays a searchable list of all available fields in Magento
  • Salesforce Attribute - displays a list of all available fields in Salesforce
  • Default Value - Allows you to specify the default value to be used if the value in Magento OR Salesforce is blank.
  • Magento > Salesforce Settings & Salesforce > Magento Settings - allow you to control when the status can and will be updated from one system to another.