34 private $configurableColumns = [
50 ->addAttributeToFilter(
'type_id', [
'eq' => ConfigurableProductType::TYPE_CODE]);
53 $productAttributesOptions =
$product->getTypeInstance()->getConfigurableOptions(
$product);
54 $this->configurableData[
$product->getId()] = [];
56 $variationsLabels = [];
58 foreach ($productAttributesOptions as $productAttributeOption) {
59 foreach ($productAttributeOption as $optValues) {
60 $variations[$optValues[
'sku']][] = $optValues[
'attribute_code'] .
'=' . $optValues[
'option_title'];
62 if (!empty($optValues[
'super_attribute_label'])) {
63 $variationsLabels[$optValues[
'attribute_code']] = $optValues[
'attribute_code'] .
'=' 64 . $optValues[
'super_attribute_label'];
69 foreach ($variations as $sku =>
$values) {
74 $this->configurableData[
$product->getId()] = [
75 self::CONFIGURABLE_VARIATIONS_COLUMN => implode(
76 ImportProduct::PSEUDO_MULTI_LINE_SEPARATOR,
79 self::CONFIGURABLE_VARIATIONS_LABELS_COLUMN => implode(
95 return array_merge(
$columns, $this->configurableColumns);
107 if (!empty($this->configurableData[
$productId])) {
108 $dataRow = array_merge($dataRow, $this->configurableData[
$productId]);
122 if (!empty($this->configurableData[
$productId])) {
123 $additionalRowsCount = max($additionalRowsCount, count($this->configurableData[
$productId]));
125 return $additionalRowsCount;
const CONFIGURABLE_VARIATIONS_LABELS_COLUMN
const DEFAULT_GLOBAL_MULTI_VALUE_SEPARATOR
prepareData($collection, $productIds)
const CONFIGURABLE_VARIATIONS_COLUMN
addHeaderColumns($columns)
addData($dataRow, $productId)
getAdditionalRowsCount($additionalRowsCount, $productId)