WooCommerce Integration
Display WooCommerce products in YOOtheme Pro
WooCommerce Integration
This guide shows how to connect to the WooCommerce REST API to display products in YOOtheme Pro.
When to use this
Use API Mapper for WooCommerce when you need to display products on a separate website - for example, a landing page or microsite that isn't your main WooCommerce store.
If products are on the same WordPress installation, use YOOtheme's built-in WooCommerce source instead.
Prerequisites
- WooCommerce store with REST API enabled
- API credentials (Consumer Key & Secret)
- API Mapper Pro or Developer license (for unlimited products)
Step 1: Generate WooCommerce API Keys
- In your WooCommerce store, go to WooCommerce → Settings → Advanced → REST API
- Click Add Key
- Enter a description (e.g., "API Mapper")
- Set Permissions to Read
- Click Generate API Key
- Copy the Consumer Key and Consumer Secret
Keep these safe!
The Consumer Secret is only shown once. Save it securely.
Step 2: Create the Connection
- Open API Mapper settings
- Click Add Connection
- Configure:
- Name: WooCommerce Products
- Base URL:
https://your-store.com/wp-json/wc/v3
Step 3: Configure Authentication
WooCommerce uses a special authentication method:
- Set Authentication to Basic Auth
- Enter your Consumer Key as username
- Enter your Consumer Secret as password
Step 4: Set Up the Endpoint
- Endpoint:
/products - Method: GET
Optional Query Parameters
| Parameter | Value | Description |
|---|---|---|
per_page | 12 | Products per request (max 100) |
status | publish | Only published products |
category | 15 | Filter by category ID |
orderby | date | Sort by: date, title, price |
order | desc | Order: asc or desc |
Step 5: Map Product Fields
Add these field mappings:
| Field Name | Path | Type |
|---|---|---|
| ID | id | Number |
| Name | name | Text |
| Price | price | Text |
| Regular Price | regular_price | Text |
| Sale Price | sale_price | Text |
| Description | description | Text |
| Short Description | short_description | Text |
| Image | images[0].src | Image |
| Link | permalink | Link |
| SKU | sku | Text |
| Stock Status | stock_status | Text |
Step 6: Test and Save
- Click Test Connection
- Verify you see product data
- Click Save
Using in YOOtheme
- Open YOOtheme Pro Customizer
- Add a Grid element
- Set Dynamic Content to API Mapper: WooCommerce Products
- Map fields:
- Title → Name
- Image → Image
- Content → Short Description
- Link → Link
Displaying Price
To show formatted prices, use a Text element with the Price field. You may need to add currency formatting in your template.
Advanced: Categories
To display product categories:
- Create a new connection
- Endpoint:
/products/categories - Map fields:
id→ IDname→ Nameimage.src→ Imagecount→ Product Count
Troubleshooting
"Consumer key is invalid"
- Verify the key was copied correctly
- Check if the key has Read permissions
- Ensure the WooCommerce REST API is enabled
Empty response
- Check if products exist and are published
- Verify the
status=publishparameter - Check API permissions
CORS errors
- This happens when testing from browser console
- API Mapper makes server-side requests, so CORS shouldn't affect it
Next Steps
Was this page helpful?