feat: refactor product variant handling to use product pricing and remove unnecessary fields
This commit is contained in:
@@ -14,11 +14,7 @@ return new class extends Migration
|
||||
Schema::create('productos_variantes', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->unsignedBigInteger('producto_id');
|
||||
$table->string('slug')->nullable();
|
||||
$table->string('nombre')->nullable();
|
||||
$table->unsignedInteger('stock')->default(0);
|
||||
$table->text('descripcion')->nullable();
|
||||
$table->decimal('precio', 10, 2);
|
||||
$table->timestamps();
|
||||
|
||||
$table->foreign('producto_id')
|
||||
|
||||
@@ -200,11 +200,7 @@ class ProductCatalogFromImagesSeeder extends Seeder
|
||||
];
|
||||
|
||||
$this->productService->createVariant($product, [
|
||||
'slug' => $metadata['product_slug'].'-'.Str::slug((string) $size),
|
||||
'nombre' => $metadata['product_name'].' - Talle '.$size,
|
||||
'stock' => $pricing['stock'],
|
||||
'descripcion' => $metadata['description'],
|
||||
'precio' => $pricing['price'],
|
||||
'definitions' => $definitions,
|
||||
'images' => $images,
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user