Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save helgatheviking/60c8abcf28a891c24584ad81b0ea6bdd to your computer and use it in GitHub Desktop.
Save helgatheviking/60c8abcf28a891c24584ad81b0ea6bdd to your computer and use it in GitHub Desktop.
Create a WooCommerce Mix and Match product with it's settings
curl -X POST https://example.com/wp-json/wc/v3/products \
-u consumer_key:consumer_secret \
-H "Content-Type: application/json" \
-d '{
"name": "Sample Six Pack",
"type": "mix-and-match",
"regular_price": "0",
"description": "So many products to choose from.",
"short_description": "Pick 6.",
"categories": [
{
"id": 9
}
],
"mnm_child_items": [
{
"product_id": 7
},
{
"product_id": 9
},
{
"product_id": 14
},
{
"product_id": 16
},
{
"product_id": 17
},
{
"product_id": 10,
"variation_id": 12
}
],
"mnm_layout": "grid",
"mnm_min_container_size": 6,
"mnm_max_container_size": 6,
"mnm_discount": "25",
"mnm_priced_per_product": true,
"mnm_shipped_per_product": false
}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment