ePages 7.27.0 - DE_EPAGES/Customer/API/CSV/CustomerImportHandler.pm

Package DE_EPAGES::Customer::API::CSV::CustomerImportHandler

This module implements a handler to export customer data to a CVS file. See DE_EPAGES::Customer::API::CSV::CustomerExportImport for usage examples.

Base
DE_EPAGES::ShopCSVExportImport::API::CSV::ShopObjectImportHandler

Functions

addCountryIDToBillingAddress
baseAttributeClassAlias
deactivateEmails
getCountryIDFromCSV
getCountryIDFromDatabase
getDefaultShopCountryID
getUsedAttribute
importSpecialData
new
saveBillingAddress

addCountryIDToBillingAddress

adds the coutry id to the billing address data hash

Syntax
$self->addCountryIDToBillingAddress($Customer, \%BillingAddressData);
Input
$Customer (object)
customer which should be imported
$hBillingAddressData (ref.hash)
attribute values
Return
$hBillingAddressData (ref.hash)
attribute values

baseAttributeClassAlias

return Base AttributeClass Alias, here : 'CustomerClass'

Syntax
$self->baseAttributeClassAlias();
Return
$BaseAttributeClassAlias (string)
attribute class alias of normal attributes

deactivateEmails

Setter and getter for the option to deativate emails when creating a customer

Syntax
$self->deactivateEmails();
Input
$deactivateEmails (boolean)
deactivate the password email or not
Return
$hAttributeValues (boolean)
0 - send an email, 1 - send no email

getCountryIDFromCSV

gets the country id from the csv value

Syntax
$self->getCountryIDFromCSV($Customer, $CountryCodeFromCSV);
Input
$Customer (object)
customer which should be imported
$CountryCodeFromCSV (scalar)
csv vlaue of the field country
Return
$CoutryID (scalar)
country id

getCountryIDFromDatabase

gets the country id from the database

Syntax
$self->getCountryIDFromDatabase($Customer);
Input
$Customer (object)
customer which should be imported
Return
$CoutryID (scalar)
country id

getDefaultShopCountryID

gets the default shop country id

Syntax
$self->getDefaultShopCountryID(ahShopCountries);
Input
$ahShopCountries (ref.array)
all shop countries
Return
$CoutryID (scalar)
country id

getUsedAttribute

return attribute info, called by analyzeHeaderLine for Unity we ignore UNKNOWN_ATTR error and use the $self->SUPER::getUsedAttribute function for handling UNKNOWN_ATTR errors (we simply ignore unknown attributes) otherwise throws Error 'UNKNOWN_ATTR' if $hHeader->{'AliasString'} isn't a key of $self->attributes call function testHeaderColumn before return $hAttribute

Syntax
$self->getUsedAttribute($HeaderString, $ColumnIndex);
Input
$HeaderString (string)
header string
$ColumnIndex (integer)
index of current column
Return
$hAttribute (ref.hash)
properties of column of CSV file with following keys
  • Attribute | attribute object | object
  • Alias | alias of the attribute | string
  • AliasString | alias string of the column e.g Shoe/ShoeWeight/en | string
  • ClassAlias | alias of the attribute class e.g. Shoe | string
  • HeaderString | header string of the column e.g 'Schuh/Gewicht/English [Shoe/ShoeWeight/en]' | string
  • IsBaseClassAttribute | 0 or 1, set to 1 if attribute is from base class | boolean
  • IsObject | 0 or 1, set to 1 if Attribute IsObject | boolean
  • Type | Attribute type, e.g. LocalizedString | String
  • LanguageID | only set if Type =~ /Localized/ | Integer
  • CurrencyID | only set if Type eq 'Price' | String
  • TaxModel | 0 (==net) or 1, only set if Type eq 'Price' | Integer

importSpecialData

possibility to import special object data, called by importObject

Syntax
$self->importSpecialData($Object, $hAttributeValues);
Input
$Object (object)
object which is imported
$hAttributeValues (ref.hash)
attribute values

new

create a new csv import handler

Syntax
$Handler = DE_EPAGES::Customer::API::CSV::CustomerImportHandler->new(%options);
Input
%options (hash)
importer options
Return
$Handler (object)
importer

saveBillingAddress

saves the billing address data on the customer

Syntax
$self->saveBillingAddress($Customer, \%BillingAddressData);
Input
$Customer (object)
customer which should be imported
$hBillingAddressData (ref.hash)
attribute values
Return
$Customer (object)
altered customer