Enhance product handling and seeding logic

- Added a call to sync properties JSON in UpdateProductRelations job if the method exists.
- Updated ProductFieldsForDetail to provide a default value of '-' for missing property values.
- Simplified the insertion logic in ProductPropertyValuesSeeder by replacing 'tm' with 'tk' in the value field and removed commented-out code for clarity.
This commit is contained in:
Mekan1206
2026-02-09 23:15:56 +05:00
parent 8f49fe0124
commit 9fac84a882
3 changed files with 10 additions and 17 deletions

View File

@@ -134,8 +134,8 @@ class ProductFieldsForDetail
'name' => $property->attribute->slug,
'type' => $property->attribute->type,
'default' => $property->attribute->type === 'select'
? $property->values->first()->value?->id
: $property->values->first()->product_custom_value,
? $property->values->first()->value?->id ?? '-'
: $property->values->first()->product_custom_value ?? '-',
'options' => $property->attribute->values->map(fn ($value) => [
'label' => $value->value,
'value' => $value->id,