Add WooCommerce-style featured image and product gallery flow.
Deploy Ladill Woo Manager / deploy (push) Successful in 24s
Deploy Ladill Woo Manager / deploy (push) Successful in 24s
Sync full image sets through the plugin, with upload/URL support in the product editor and thumbnails in the list. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -20,12 +20,14 @@ class ProductIngestService
|
||||
$sale = $this->priceMinor($payload['sale_price'] ?? null);
|
||||
|
||||
$images = collect((array) ($payload['images'] ?? []))
|
||||
->map(fn (array $image) => [
|
||||
->map(fn (array $image, int $index) => [
|
||||
'id' => (int) ($image['id'] ?? 0),
|
||||
'src' => (string) ($image['src'] ?? ''),
|
||||
'alt' => (string) ($image['alt'] ?? ''),
|
||||
'position' => (int) ($image['position'] ?? $index),
|
||||
])
|
||||
->filter(fn (array $image) => $image['src'] !== '')
|
||||
->filter(fn (array $image) => $image['src'] !== '' || $image['id'] > 0)
|
||||
->sortBy('position')
|
||||
->values()
|
||||
->all();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user