Each item can have images and videos. They are shown in the item details window and, for the store, on the item details page.
Add images and videos
Go to Sales > Items and add or edit an item.
- Click Upload File to add images or video files. Videos can be MP4, WebM or OGV files, because browsers can play these types.
- Click Add video link, paste a YouTube, Vimeo, Loom or Dailymotion link and press Enter or click Add.
To upload video files, the file type must be allowed. Go to Settings > General and add the type, for example mp4, to Accepted file format.
Change the order
Drag the images and videos to change their order, then click Save. The gallery shows them in the same order. The first image is the default image of the item, for example in the store, the cart and proposals. Videos are skipped for the default image. If an item has no image, the picture of its first YouTube or Dailymotion link is used.
Point to an image or video and click the x to remove it.
Watch a video
- In the edit window, a video shows its first frame. Click the Full screen icon to play it in full screen.
- In the item details window and the item details page, videos play in the gallery. Click the Full screen icon at the top right of the video to watch it in full screen.
- When the buyer moves to another image, the video stops.
For plugin developers
Images, videos and video links are saved in the files field of the item, in the display order. A video link has an empty file_name and a video_url, for example:
array("file_name" => "", "video_url" => "https://www.youtube.com/watch?v=VIDEO_ID")
Use these functions instead of reading the field yourself:
- \App\Libraries\Item_media::get_media_list($item_info->files) returns the images, videos and video links with their type (image, video or video_url), url, thumbnail and embed_url.
- get_store_item_image($item_info->files) returns the default image of the item.