Add WooCommerce-style featured image and product gallery flow.
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:
isaacclad
2026-07-07 00:27:11 +00:00
co-authored by Cursor
parent e3ef23218f
commit 085645fd0f
10 changed files with 434 additions and 67 deletions
+25
View File
@@ -74,6 +74,31 @@ class WooProduct extends Model
return self::STATUSES[$this->status] ?? ucfirst((string) $this->status);
}
/** @return array{id?: int, src?: string, alt?: string, position?: int}|null */
public function featuredImage(): ?array
{
$images = (array) $this->images;
return $images[0] ?? null;
}
/** @return list<array{id?: int, src?: string, alt?: string, position?: int}> */
public function galleryImages(): array
{
$images = array_values((array) $this->images);
return array_slice($images, 1);
}
public function thumbnailUrl(): ?string
{
$featured = $this->featuredImage();
return is_array($featured) && ! empty($featured['src'])
? (string) $featured['src']
: null;
}
/** @return list<string> */
public function categoryNames(): array
{