Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support reading of the meta fields #6

Closed
judgej opened this issue May 29, 2015 · 2 comments
Closed

Support reading of the meta fields #6

judgej opened this issue May 29, 2015 · 2 comments

Comments

@judgej
Copy link
Owner

judgej commented May 29, 2015

Updating products is one thing, but access to custom meta fields is also very handy. This plugin should support the reading of this data too.

The WC wc-api/v2/orders API does support meta fields, but wc-api/v2/products does not. A similar format can be adopted. An example of an order meta field on an order line is:

"line_items": [
{
    "id": 106,
    "subtotal": "400.00",
    "subtotal_tax": "0.00",
    "total": "400.00",
    "total_tax": "0.00",
    "price": "200.00",
    "quantity": 2,
    "tax_class": null,
    "name": "Product B from Vendor B",
    "product_id": 12,
    "sku": "1234567890-2",
    "meta": 
[
        {
            "key": "shipping_line_id",
            "label": "Shipping_line_id",
            "value": "110"
        }
    ]
},

The "meta" array contains the fields, each having a key, a label and a value.

@judgej
Copy link
Owner Author

judgej commented May 29, 2015

This format may be where the source of the question in issue #5 came from, and maybe the format should be adopted there too, so input and output fields are in the same format.

@judgej
Copy link
Owner Author

judgej commented May 31, 2015

Completed. Return format is in the main README.md documentation.

@judgej judgej closed this as completed May 31, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant