The WC_Product object has an image_id (string) and an gallery_image_ids (array) attribute for product image and product’s gallery images. Both of them are attachment ids, so you should get the image src from it’s attachment id with the wp_get_attachment_image_url() method and add it to your $products array.
Related Posts:
- Woocommerce REST API – add filter to set maximum query per page for product brands [closed]
- WooCommerce REST API endpoints don’t exist
- Fetch products with filter by similar categories at same time
- Auto generating API keys using the Application Authentication Endpoint [closed]
- WP/WooCommerce REST API cart/checkout/order [closed]
- WooCommerce: Can’t use wc_get_products for custom REST API endpoints
- Process checkout using WC REST API
- How to build a plugin that supports authenticated POST requests to the REST API from external servers?
- Extend Woocommerce rest api routes fails
- How to filter Post using Meta Data REST API
- Creating woocommerce product using WordPress REST API
- How to stop a Gutenberg Block from firing multiple GET Requests?
- Output JSON object with woocommerce products
- Problem with cURL and rest API
- Woo API REST : product variation price is read-only?
- Category Tree In WooCommerce Product API
- How to upload Woocommerce product images via API? [closed]
- Woocommerce REST API allow normal users make an order
- How to modify WCMP Rest API response?
- How to handle Woocommerce API credentials
- What will make Woocommerce REST API to issue 401 [closed]
- Woocommerce api: create product with images – bad request
- Woocommerce custom endpoints
- Woocommerce REST API – updating an order changes custom tax calculations
- Woocommerce Rest Api Categories problem [closed]
- Expired session error (admin) when I try to make a call to WooCommerce api [closed]
- API returns blank response after installing & uninstalling WP-rest-api plugin
- woocommerce axios react
- Get specific values in Woocommerce Rest API
- How can I get all the woocommerce api orders [closed]
- WooCommerce – Add product with image via REST API
- Tax are not showing on order while placing order with REST API
- JWT on Woocommerce cannot work with “Customer” role user
- Update Customer JWT Woocommerce
- Woocommerce, finding the ordinal number of a purchase for a certain product
- WooCommerce – Create multiple product tags via rest api endpoint
- WordPress SMS API integration without plugin error
- Absolute search against wordpress api
- Using the WordPress and WooCommerce REST APIs in the same Node app
- Retrieve Data from Custom Endpoint
- WordPress Woocommerce REST API JSON Error
- How to solve `Error getting remote image` in woocommerce rest api script?
- Getting in an exception for get product detail by id in woocommerce REST api
- Impossible to create a new WooCommerce customer using Rest API
- Woocommerce API security concerns
- Getting WordPress fatal error when hitting WooCommerce API
- wc_get_products() return empty object
- How can I send information when a order is completed to my own POS?
- woocommerce REST api on the website’s front-end
- Woocommerce Rest API: woocommerce_product_invalid_image_id
- How to save one API response to WooCommerce order meta data
- How can I get a get a list of customers from a list of email addresses?
- How to get WordPress to respond to a GET request at the end of a Woo product page
- Working with a json feed & trying to figure out how best to import
- WC Booking query bookings with date ranges
- Delete product image using WooCommerce API?
- “error_message”: “Sorry, you cannot list resources.” using WooCommerce API
- Woocommerce REST API: creating variations
- email address non required
- Woocommerce REST API not considering discounts and coupons
- WordPress returning “XHR” even when access keys are used
- Bypass wp_safe_remote_get()?
- How to programatically create a WooCommerce downloadable product?
- Users credentials and syncing from third party with WooCommerce
- Manual Woocommerce Complete order Emails
- Woocommerce API REST search by multiple keywords
- Create WordPress account on different domain when WooCommerce order completed
- Send data to external websites when there is an update or create a post
- GET woocommerce order request is not showing meta data [closed]
- How to add fee_lines using woocommerce rest API v3?
- Update a server-side render Block when woocommerce cart block changed
- Woocommerce Multisite Search Mod to archive.php but no pagination
- get deepest Woocommerce Product Category on Archivepage
- how to add custom button on product
- Custom Redirect after registration in WooCommerce
- Wrong product thumbnail size
- the_widget() – filter only one instance
- WooCommerce – Exclude category from snippet
- Woocommerce Email show HTML source code [closed]
- Add SKU in Product Title
- Images are displaying as blank images
- WC Lightbox, Zoom and Slider not loading [closed]
- Woocomerce pulling wrong time from server -5 hrs difference
- I want hide view more button if price is blank
- Change Dashboard URL from wp-admin to wp-admin/index.php
- Archive product loop does not work with product filters
- Adding Tracking Details for Advanced Shipment Tracking Plugin From Order Notes
- check shipping amount in woocommerce_after_checkout_validation?
- How to display woocommerce product details on wp page
- Update a list of product to featured if product have meta value (Mysql not wpquery)
- Adding Amchart Interface to WordPress API
- Is this code collecting user password?
- Update Custom Post Meta Even if Draft
- Update order status based on condition
- I’d like to add a button under the “Add to Cart” button which says “Buy on Amazon” and links to my Amazon product page [closed]
- If YITH Wishlist page is set to the WooCommerce my-account endpoint, the endpoints stop working all together. Any solution?
- WooCommerce pay per photo upload [closed]
- Creating a woocommerce order when a user creates an account
- Cannot use dynamic prefix for WooCommerce permalink
- Woocommerce paginate link generates #038 instead of ? – seems connected to caching