Can I upload Product Images using fmEcommerce Link (WooCommerce Edition)?
WooCommerce supports two ways of uploading Product Images:
- you can enter the URL for an Image and WooCommerce will download that Image when uploading a Product. That URL must be publicly accessible and point to a valid image file (e.g. .jpg, .png etc)
- if you have already uploaded an Image to your WordPress site you can simply reference the WordPress ID for a Product Image and WooCommerce will link to that existing Image when uploading a Product
The process for setting an image to be the Product image (featured image for the Product) or a Product Gallery image has changed from v2 to v3 of the WooCommerce REST API:
WooCommerce REST API v2 (fmEcommerce Link (WooCommerce Edition) v1.64 or earlier): the ProductImages::Position and ProductVariations::ImagePosition fields are used to set the position of a Product image. To set an image as the featured image for the Product set the value for the Position field to 0 for that image before uploading to WooCommerce.
WooCommerce REST API v3 (fmEcommerce Link (WooCommerce Edition) v1.65 or later): the use of the Position field to specify whether an image is the featured image has been removed from the WooCommerce API. The order of the Product Images when uploaded to WooCommerce determines whether an image is the featured image or a gallery image. The first image in the list of Product Images is used for the feature image, and all other images are then assigned as gallery images. We have removed all references to the ProductImages::Position and ProductVariations::ImagePosition fields when uploading/downloading Product and Variation images. We have not applied any sort order to the Product Images portal so the order that you enter images will determine whether they are a featured image or a gallery image. You can customise the sort order of the Product Images portal (or relationship if you're using the plugin version) as required to set a custom sort order and have more control of the position of images before uploading.
After uploading new product images to WooCommerce we recommend updating the Product so the WordPress IDs for any new media library files are downloaded which will prevent duplicate files from appearing in your WordPress Media Library.
We have a video demonstrating Product Image uploads on our Videos page. N.B. the WooCommerce API does not currently support directly uploading videos stored in a FileMaker container field, however the WordPress REST API does allow for media files to be uploaded directly to the WordPress Media Library. fmEcommerce Link v1.6 includes examples for uploading files directly from FileMaker container fields to the WordPress Media Library – see our Container Field Uploads page for further details.