feat: enhance variant attribute handling across components for improved selection and display
This commit is contained in:
@@ -14,6 +14,7 @@ import {
|
||||
InventoryPolicy,
|
||||
ProductAttribute,
|
||||
ProductAttributeOption,
|
||||
VariantAttributeValue,
|
||||
} from '../../../../core/services/catalog/catalog.interface';
|
||||
|
||||
@Component({
|
||||
@@ -198,7 +199,7 @@ export class ProductAttributeSelectorComponent {
|
||||
|
||||
private getVariantAttributeValues(
|
||||
attribute: ProductAttribute,
|
||||
variantAttributes: Record<string, string | string[]>,
|
||||
variantAttributes: Record<string, VariantAttributeValue>,
|
||||
): string[] {
|
||||
const normalizedCodigo = this.normalizeText(attribute.codigo);
|
||||
const normalizedNombre = this.normalizeText(attribute.nombre);
|
||||
@@ -207,7 +208,9 @@ export class ProductAttributeSelectorComponent {
|
||||
const normalizedKey = this.normalizeText(key);
|
||||
|
||||
if (normalizedKey === normalizedCodigo || normalizedKey === normalizedNombre) {
|
||||
return (Array.isArray(value) ? value : [value]).map((item) => this.normalizeText(item));
|
||||
return (Array.isArray(value) ? value : [value]).map((item) =>
|
||||
this.normalizeText(typeof item === 'string' ? item : item.value),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user