Skip to main content

Product Gallery

Overview​

The Gallery module replaces the WooCommerce product gallery with one that also holds video and 360-degree items, keeps its own ordering and alt text, and can be laid out per product. YouTube and Vimeo URLs are parsed into an embed and a thumbnail.

It is for stores whose product media is more than a row of stills — a demonstration video beside the photographs, a spin view, a different layout on one product than the rest.

Availability​

ItemValue
Module keygallery
TierPremium
Entitlement keygallery
Admin tabgallery, under Product Experience
Enabled optionaiowc_module_enabled_gallery (off until turned on)
REST namespaceaiowc/v1

Enabling the module creates the two tables below, seeds the defaults and schedules the thumbnail cleanup job.

Settings​

Store-wide defaults, stored in the bundled option row aiowc_gal_settings; legacy per-key options aiowc_gal_<key> are migrated on first read.

API nameStored keyDefaultMeaning
enableZoomenable_zoomtrueZoom on the main image.
enableLightboxenable_lightboxtrueOpen media in a lightbox.
enableVideoenable_videotrueAllow video items in the gallery.
enable360enable_360falseAllow 360-degree items.
thumbnailPositionthumbnail_positionbottomWhere the thumbnail strip sits: bottom, top, left or right.
galleryLayoutgallery_layoutsliderStore-wide default layout.
zoomTypezoom_typeinnerinner, window or lens.
lightboxAnimationlightbox_animationfadefade, slide or zoom.
videoAutoplayvideo_autoplayfalseWhether an embedded video starts on its own.
thumbnailsPerRowthumbnails_per_row4Thumbnails per row in the strip.

A product may override the layout, and carry its own options, through the per-product settings routes; those rows live in a separate table keyed uniquely by product.

Media items​

Each item belongs to a product and carries a type, the media URL, an optional thumbnail URL, alt text, a sort order and a JSON options blob. The type is one of image, video or 360, enforced by the column definition.

Video URLs are parsed for YouTube — watch, embed, short and Shorts forms — and Vimeo. The service derives the video id, builds the embed markup at a requested size with optional autoplay, and resolves a thumbnail for the item.

Admin screens​

Plugin admin tab​

The Gallery tab holds the store-wide settings form: layout, thumbnail position and count, zoom on or off and its type, lightbox on or off and its animation, video and 360 support, and video autoplay. It saves through the settings route.

Product edit screen​

The module adds an Enhanced Product Gallery meta box to the product editor's side column, listing the product's media and offering add, remove and per-product layout controls. It saves on save_post_product.

REST API endpoints​

All routes are on aiowc/v1 and require manage_woocommerce — plus a REST nonce on cookie-authenticated requests — except the product media read, which is open and rate limited to 120 requests a minute.

MethodPathPurposeRequired args
GET/gallery/products/{product_id}/mediaThe product's gallery items. Open read.product_id
POST/gallery/products/{product_id}/mediaAdd an item; accepts media_type, thumbnail_url, alt_text, sort_order.product_id, media_url
PUT / PATCH / POST/gallery/media/{id}Update an item's URL, thumbnail, alt text or position.id
DELETE/gallery/media/{id}Delete an item.id
PUT / PATCH / POST/gallery/products/{product_id}/reorderReorder a product's items.product_id, order
GET/gallery/products/{product_id}/settingsRead the product's own gallery settings.product_id
POST/gallery/products/{product_id}/settingsUpdate them; accepts layout.product_id
GET/gallery/settingsRead the store-wide settings above.–
POST/gallery/settingsUpdate the store-wide settings above.–

WooCommerce integration​

Storefront handlers are skipped inside wp-admin, and the admin handler only runs there.

HookPriorityWhat the module does
wp_enqueue_scripts10Loads the gallery assets.
woocommerce_single_product_image_thumbnail_html10Filters WooCommerce's own thumbnail markup.
woocommerce_before_single_product_summary5Replaces the default gallery with this module's.
add_meta_boxes10Adds the gallery meta box to the product editor.
save_post_product10Saves the meta box.
admin_enqueue_scripts10Loads the meta box assets.

The module registers no shortcode and no block.

Database schema​

TableHolds
{prefix}aiowc_gallery_mediaGallery items: product, type (image, video, 360), media URL, thumbnail URL, sort order, alt text, options JSON.
{prefix}aiowc_gallery_settingsPer-product layout and options, one row per product.

Background jobs​

HookIntervalGroupWork
aiowc_gallery_thumbnail_cleanup24 hoursaiowc-galleryRemoves generated thumbnails that no gallery item refers to.

Entitlement limits​

gallery is an on/off grant with no licence-side cap on media items or products. thumbnailsPerRow is a display setting, not a limit on how much media a product may hold.

Health check​

The module reports a warning when its tables are missing or WooCommerce is inactive, and otherwise reports that it is functioning normally.