AfterbuyProductImporter
in package
implements
LoggerAwareInterface
Interfaces, Classes and Traits
- LoggerAwareInterface
Table of Contents
- $additionalFieldsHelper : AdditionalFieldsHelper
- $imageListFactory : ImageListFactory
- $imageListReadService : ImageListReadService
- $imageListWriteService : ImageListWriteService
- $languageHelper : LanguageHelperInterface
- $logger : LoggerInterface
- $mappingRepository : ProductsMappingRepository
- $moduleConfiguration : GambioAfterbuyConfigurationStorage
- $optionReadService : OptionReadService
- $optionWriteService : OptionWriteService
- $priceWriteService : ProductPriceWriteService
- $productOptionWriteService : ProductOptionWriteService
- $productReadService : ProductReadService
- $productVariantsReadService : ProductVariantsReadService
- $productVariantsWriteService : ProductVariantsWriteService
- $productWriteService : ProductWriteService
- $setOutOfStockProducts : bool
- __construct() : mixed
- findDeliveryTimeId() : int
- findOrMakeOption() : int
- Finds or creates an option (and its values) by name (German).
- findOrMakeOptionValue() : int
- For an option value with a given name (German) finds or creates the required data structures (db entries) and returns an OptionValue id.
- importImageFromUrl() : string
- importProduct() : int
- Imports a product from Afterbuy into the shop.
- importProductImageFromUrl() : string
- makeProductOptions() : void
- makeVariations() : void
- For Afterbuy products w/ BaseProductFlag == 1 this creates Options/Property Combinations to represent the variations.
- makeVariationSummary() : array<string|int, mixed>
- mapQuantityUnit() : string
- setLogger() : mixed
- addSpecialOfferByDiscount() : bool
- deleteImageFile() : void
- findQuantityUnitId() : IdType
- findSpecialOfferByProductId() : SpecialOffer|null
- findTaxClassId() : int|null
- findVpeId() : IdType|null
- getDiscountFactor() : float
- imageFileExists() : bool
- imageFilesAreIdentical() : bool
- importGraduatedAndGroupPrices() : void
- isHtml() : bool
- makeImageListForVariantProduct() : ImageList
- makeProductImageContainer() : ProductImageContainer
- Converts product images from Afterbuy to Gambio.
- removeSpecialOffers() : void
- updateVariations() : void
- Updates variations of a product.
Properties
$additionalFieldsHelper
private
AdditionalFieldsHelper
$additionalFieldsHelper
$imageListFactory
private
ImageListFactory
$imageListFactory
$imageListReadService
private
ImageListReadService
$imageListReadService
$imageListWriteService
private
ImageListWriteService
$imageListWriteService
$languageHelper
private
LanguageHelperInterface
$languageHelper
$logger
private
LoggerInterface
$logger
$mappingRepository
private
ProductsMappingRepository
$mappingRepository
$moduleConfiguration
private
GambioAfterbuyConfigurationStorage
$moduleConfiguration
$optionReadService
private
OptionReadService
$optionReadService
$optionWriteService
private
OptionWriteService
$optionWriteService
$priceWriteService
private
ProductPriceWriteService
$priceWriteService
$productOptionWriteService
private
ProductOptionWriteService
$productOptionWriteService
$productReadService
private
ProductReadService
$productReadService
$productVariantsReadService
private
ProductVariantsReadService
$productVariantsReadService
$productVariantsWriteService
private
ProductVariantsWriteService
$productVariantsWriteService
$productWriteService
private
ProductWriteService
$productWriteService
$setOutOfStockProducts
private
bool
$setOutOfStockProducts
Methods
__construct()
public
__construct(ProductsMappingRepository $mappingRepository, GambioAfterbuyConfigurationStorage $moduleConfiguration, ProductWriteService $productWriteService, ProductReadService $productReadService) : mixed
Parameters
- $mappingRepository : ProductsMappingRepository
- $moduleConfiguration : GambioAfterbuyConfigurationStorage
- $productWriteService : ProductWriteService
- $productReadService : ProductReadService
Return values
mixed —findDeliveryTimeId()
public
findDeliveryTimeId() : int
Return values
int —findOrMakeOption()
Finds or creates an option (and its values) by name (German).
public
findOrMakeOption(string $optionName, array<string|int, mixed> $optionValueNames) : int
Note: The $optionValueNames aren’t strictly necessary here but should be provided for the sake of efficiency.
Parameters
- $optionName : string
- $optionValueNames : array<string|int, mixed>
Tags
Return values
int —findOrMakeOptionValue()
For an option value with a given name (German) finds or creates the required data structures (db entries) and returns an OptionValue id.
public
findOrMakeOptionValue(int $optionId, string $optionValueName) : int
Parameters
- $optionId : int
- $optionValueName : string
Tags
Return values
int —importImageFromUrl()
public
importImageFromUrl(string $imageUrl[, string $subDirectory = '' ]) : string
Parameters
- $imageUrl : string
- $subDirectory : string = ''
Tags
Return values
string —importProduct()
Imports a product from Afterbuy into the shop.
public
importProduct(AfterbuyProduct $afterbuyProduct[, array<string|int, mixed> $categoryIds = [] ][, int $minimumInactiveLevel = 1000 ][, int|null $dealerGroupId = null ]) : int
Note: Only basic products and parents of variation sets are supported.
Parameters
- $afterbuyProduct : AfterbuyProduct
- $categoryIds : array<string|int, mixed> = []
- $minimumInactiveLevel : int = 1000
- $dealerGroupId : int|null = null
Tags
Return values
int —importProductImageFromUrl()
public
importProductImageFromUrl(string $imageUrl) : string
Parameters
- $imageUrl : string
Tags
Return values
string —makeProductOptions()
public
makeProductOptions(int $productId, AfterbuyProduct $afterbuyProduct) : void
Parameters
- $productId : int
- $afterbuyProduct : AfterbuyProduct
Return values
void —makeVariations()
For Afterbuy products w/ BaseProductFlag == 1 this creates Options/Property Combinations to represent the variations.
public
makeVariations(int $productId, AfterbuyProduct $afterbuyProduct) : void
Parameters
- $productId : int
- $afterbuyProduct : AfterbuyProduct
Tags
Return values
void —makeVariationSummary()
public
static makeVariationSummary(AfterbuyProduct $afterbuyProduct) : array<string|int, mixed>
Parameters
- $afterbuyProduct : AfterbuyProduct
Return values
array<string|int, mixed> —mapQuantityUnit()
public
static mapQuantityUnit(string $afterbuyUnit[, mixed $languageCode = 'de' ]) : string
Parameters
- $afterbuyUnit : string
- $languageCode : mixed = 'de'
Return values
string —setLogger()
public
setLogger(LoggerInterface $logger) : mixed
Parameters
- $logger : LoggerInterface
Return values
mixed —addSpecialOfferByDiscount()
private
addSpecialOfferByDiscount(int $productId, Discount $discount, AfterbuyProduct $afterbuyProduct[, int|null $specialOfferId = null ]) : bool
Parameters
- $productId : int
- $discount : Discount
- $afterbuyProduct : AfterbuyProduct
- $specialOfferId : int|null = null
Return values
bool —deleteImageFile()
private
deleteImageFile(string $imageFileName) : void
Parameters
- $imageFileName : string
Return values
void —findQuantityUnitId()
private
findQuantityUnitId(string $unitName) : IdType
Parameters
- $unitName : string
Return values
IdType —findSpecialOfferByProductId()
private
findSpecialOfferByProductId(int $productId) : SpecialOffer|null
Parameters
- $productId : int
Return values
SpecialOffer|null —findTaxClassId()
private
findTaxClassId(string $taxRate) : int|null
Parameters
- $taxRate : string
Return values
int|null —findVpeId()
private
findVpeId(string $unitName) : IdType|null
Parameters
- $unitName : string
Return values
IdType|null —getDiscountFactor()
private
getDiscountFactor(AfterbuyProduct $afterbuyProduct) : float
Parameters
- $afterbuyProduct : AfterbuyProduct
Return values
float —imageFileExists()
private
imageFileExists(string $fileName) : bool
Parameters
- $fileName : string
Return values
bool —imageFilesAreIdentical()
private
imageFilesAreIdentical(string $fileA, string $fileB) : bool
Parameters
- $fileA : string
- $fileB : string
Return values
bool —importGraduatedAndGroupPrices()
private
importGraduatedAndGroupPrices(int $productId, AfterbuyProduct $afterbuyProduct, float $productPrice, int $taxClassId[, int|null $dealerGroupId = null ]) : void
Parameters
- $productId : int
- $afterbuyProduct : AfterbuyProduct
- $productPrice : float
- $taxClassId : int
- $dealerGroupId : int|null = null
Return values
void —isHtml()
private
static isHtml(string $text) : bool
Parameters
- $text : string
Return values
bool —makeImageListForVariantProduct()
private
makeImageListForVariantProduct(AfterbuyProduct $variantProduct) : ImageList
Parameters
- $variantProduct : AfterbuyProduct
Return values
ImageList —makeProductImageContainer()
Converts product images from Afterbuy to Gambio.
private
makeProductImageContainer(GXEngineProduct $product, AfterbuyProduct $afterbuyProduct) : ProductImageContainer
Uses ImageLargeURL as primary, ProductPictures as additional images. Image files are retrieved and stored locally.
Parameters
- $product : GXEngineProduct
- $afterbuyProduct : AfterbuyProduct
Tags
Return values
ProductImageContainer —removeSpecialOffers()
private
removeSpecialOffers(int $productId) : void
Parameters
- $productId : int
Return values
void —updateVariations()
Updates variations of a product.
private
updateVariations(int $productId, AfterbuyProduct $afterbuyProduct) : void
Parameters
- $productId : int
- $afterbuyProduct : AfterbuyProduct