woocommerce / woocommerce/wc-api-php

Impossible to add meta_data to line_items

Open
#332 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

stale
Dominant language
PHP
Stars
546
Forks
158
Avg merge
3h 21m
Merged PRs (30d)
2

Description

I am trying to add additional attributes to the line_items before a purchase.
But after the request is done I don't have the information sent in the meta_data attribute
I use woocommerce rest api

//EXAMPLE OF INPUT
{ ...ordersAttributes, line_items: [{ product_id: 12, meta_data: [ { key: 'Size', value: 121 } ] }] }

//EXAMPLE OF OUTPUT
{ ...ordersAttributes, line_items: [{ product_id: 12, meta_data: [] }] }

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the order request with line_items.meta_data and compare the returned line_items data. The issue names no source file or test, so trace the REST API path that handles line-item metadata and verify that the submitted key and value are preserved in the response.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.