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:
@@ -59,6 +59,11 @@ class UpdateProductRelations implements ShouldQueue
|
||||
'product_custom_value' => in_array($attribute->type, ['text', 'number']) ? $this->properties[$attribute->slug] : null,
|
||||
]);
|
||||
});
|
||||
|
||||
// sync properties json
|
||||
if (method_exists($this->model, 'syncPropertiesJson')) {
|
||||
$this->model->syncPropertiesJson();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user