Package DE_EPAGES::Product::API::CSV::ProductImportHandler
This module implements a handler to import products
Base |
DE_EPAGES::ShopCSVExportImport::API::CSV::ShopObjectImportHandler |
Example |
use DE_EPAGES::Product::API::CSV::ProductImportHandler; DE_EPAGES::Product::API::CSV::ProductImportHandler->importCSV($FileName, $hFileFormat, $Shop); |
Functions
- analyzeAttributeLine
- baseAttributeClassAlias
- importSpecialData
- modifyUsedAttributes
- processMediaGalleryImage
analyzeAttributeLine
Analyzes the current line in the CSV file and fills the object data hash with information for the actual import. Uses $self->topID('Item') as input, which contains the list of values in the current line.
Syntax |
my $hAttributeValues = $self->analyzeAttributeLine(); |
Example |
hAttributeValues='HASH 'DirectAttributes' =>'HASH' 'Alias' =>'js_3200705005' 'AvailabilityDate' => undef 'Class' =>'DE_EPAGES::Product::API::Object::ProductType=HASH' 'ImageLarge' =>'js_3200705005.jpg' 'ImageMedium' =>'js_3200705005_m.jpg' 'ImageSmall' =>'js_3200705005_s.jpg' 'IsAvailable' =>'1' 'IsBundleProduct' =>'0' 'IsDailyPrice' =>'0' 'IsDefault' =>'0' 'IsNew' =>'0' 'IsVisible' =>'1' 'Length' => undef 'Manufacturer' =>'Tatonka' 'ManufacturerSKU' => undef 'MinOrder' =>'1' 'OrderUnit' =>'DE_EPAGES::Object::API::Object::UnitOfMeasurement=HASH' 'Parent' =>'DE_EPAGES::Product::API::Object::ProductFolder=HASH' 'PriceQuantity' =>'1' .... 'DoNotImport' =>'0' 'LocalizedAttributes' =>'HASH' '1' =>'HASH' 'Description' =>'Wanderrucksack mit effektiver R?el?' 'Name' =>'Tatonka Vento' '2' =>'HASH' 'Description' =>'Hiking Backpack with effective back ventilation' 'Name' =>'Tatonka Vento' 'Object' =>'DE_EPAGES::Product::API::Object::Product=HASH' 'PriceAttributes' =>'HASH' 'EUR/1' =>'HASH' 'CurrencyID' =>'EUR' 'Price' =>'69.95' 'TaxModel' =>'1' 'USD/1' =>'HASH' 'CurrencyID' =>'USD' 'Price' =>'69.95' 'TaxModel' =>'1' 'VariationValueIDs' =>'ARRAY' [0] => '3407' [1] => '3403' |
Return |
|
baseAttributeClassAlias
return Base AttributeClass Alias, here : 'ProductClass'
Syntax |
$self->baseAttributeClassAlias(); |
Return |
|
importSpecialData
possibility to import special object data, called by importObject saves Product Prices and super product SelectedVariations
Syntax |
$self->importSpecialData($Object, $hAttributeValues); |
Input |
|
modifyUsedAttributes
add keys: $hUsedAttributes->{$ColumnIndex}{'IsSuperProductAliasColumn'} = $hUsedAttributes->{$ColumnIndex}{'Alias'} eq 'SuperProduct' ? 1 : 0; $hUsedAttributes->{'SuperProductAliasColumn'} with value=$ColumnIndex if $hUsedAttributes->{$ColumnIndex}{'IsSuperProductAliasColumn'};
Syntax |
$self->modifyUsedAttributes($hUsedAttributes, $ColumnIndex); |
Input |
|
processMediaGalleryImage
Copies the product image from the given source and generates its scaled variations. Updates the given attribute hash with the image names.
Syntax |
$hNewAttributes = $self->processMediaGalleryImage( $hDirectAttributes, $SourceFileName, $TargetFileName ); |
Example |
$hDirectAttributes = $self->processMediaGalleryImage( $hDirectAttributes, $MGNewImageLargeAbs, $Product->get('PublicPath') . '/' . $NewImageLargeFileName.$NewImageLargeExtension ); |
Input |
|