Issue #855 fixed

This commit is contained in:
jitendra 2019-04-23 11:03:05 +05:30
parent c585186a88
commit e18fd4e5c4
1 changed files with 20 additions and 2 deletions

View File

@ -184,8 +184,8 @@ class ProductFlat
if (in_array($attribute->code, ['short_description', 'tax_category_id', 'meta_title', 'meta_keywords', 'meta_description', 'width', 'height']))
continue;
// if (! Schema::hasColumn('product_flat', $attribute->code))
// continue;
if (! Schema::hasColumn('product_flat', $attribute->code))
continue;
if ($attribute->value_per_channel) {
if ($attribute->value_per_locale) {
@ -217,6 +217,24 @@ class ProductFlat
$productFlat->{$attribute->code . '_label'} = $attributeOption->admin_name;
}
}
} elseif ($attribute->type == 'multiselect') {
$attributeOptionIds = explode(',', $product->{$attribute->code});
if (count($attributeOptionIds)) {
$attributeOptions = $this->attributeOptionRepository->findWhereIn('id', $attributeOptionIds);
$optionLabels = [];
foreach ($attributeOptions as $attributeOption) {
if ($attributeOptionTranslation = $attributeOption->translate($locale->code)) {
$optionLabels[] = $attributeOptionTranslation->label;
} else {
$optionLabels[] = $attributeOption->admin_name;
}
}
$productFlat->{$attribute->code . '_label'} = implode(', ', $optionLabels);
}
}
}