Customer

This section describes how the module maps customers and customer addresses to Shopware and what configuration options are available.

Subsections

The following subsections are involved in mapping customers and their addresses:

output
└───customer
    └───customer-build-cache
    └───customer-anomaly-delta-count
    └───customer-anomaly-check
    └───customer-validate
    └───customer-upsert
    └───customer-delete

Customer addresses are mapped as embedded entities, so there is no separate subsection necessary.

Configuration

The following configuration is used for customers:

{
  "subsections": {
    "customer": {
      "enabled": true,
      "deleteMode": "soft",
      "fallbacks": {
        "paymentMethodShopwareId": null,
        "languageShopwareId": null
      }
    }
  }
}

Default Payment Method

Shopware requires to set a default payment method to customers. If you do not have payment methods available in your data you can use the configuration key fallbacks.paymentMethodShopwareId to set the uuid of a payment method. That id will be assigned to a customer during the initial import, if none is present in the transfer data.

Default Language

Shopware requires to set a default language to customers. You can use the configuration fallbacks.languageShopwareId to set the uuid of a locale that will be assigned to a customer during the initial import, if none is present in your data.

Customer Mapping Table

Target: customer
Source: Elio\CommerceBundle\Document\Customer\Customer

Target Field Source Path
* groupId customerInformation.customerGroup
* defaultPaymentMethodId customerInformation.payment
* salesChannelId channels.[0].identifier
* languageId customerInformation.locale
* customerNumber identifier
* salutationId customerInformation.personalInformation.salutation.salutation
* firstName customerInformation.personalInformation.firstName
* lastName customerInformation.personalInformation.lastName
company customerInformation.companyInformation.name
* email customerInformation.email
title customerInformation.personalInformation.title
active active
legacyEncoder password.encoder
legacyPassword password.hash
* addresses addresses
* defaultBillingAddressId addresses.defaultBillingAddress - see "Default Billing Address"
defaultShippingAddressId addresses.defaultShippingAddress - see "Default Shipping Address"

Addresses

  • All addresses (Elio\CommerceBundle\Document\Customer\Addresses\RegularAddress) that are part of the Customer::addresses collection are mapped to Shopware.
  • It is currently not possible to delete addresses from Shopware.
  • Updates are possible since a RegularAddress is identifiable. Addresses without a valid identifier are not mapped to Shopware. Identifier of addresses must be unique across all Customers, otherwise the address is invalid.

Default Billing Address

It is required by Shopware to set a default billing address. You can do this by adding tags to your address:

$address->addTag(AddressTags::DEFAULT);  
$address->addTag(AddressTags::BILLING);

Default Shipping Address

If you want to map an address as default shipping address you have to add the corresponding tags to your address:

$address->addTag(AddressTags::DEFAULT);  
$address->addTag(AddressTags::SHIPPING);

Customer Address Mapping Table

Target: customer_address
Embedded in: Synqup\Modules\Shopware6Bundle\Core\Shopware\Checkout\Customer\CustomerEntity
Source: Elio\CommerceBundle\Document\Customer\Addresses\RegularAddress

Target Field Source Path
* customerId automatically determined by the module
* countryId country
* salutationId contact.personalInformation.salutation.salutation
* firstName contact.personalInformation.firstName
* lastName contact.personalInformation.lastName
* zipcode zipcode
* city city
company contact.companyInformation.name
department contact.companyInformation.department
* street street
phoneNumber contact.personalInformation.phone