Skip to content

Commit

Permalink
Update the versions and documenation.
Browse files Browse the repository at this point in the history
  • Loading branch information
judgej committed Feb 21, 2016
1 parent 6717e88 commit a317745
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 6 deletions.
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,36 @@ $product = [
That's it. Make sure those elements are in your REST API request, and this plugin is installed at the other end,
and you can set any meta fields you like, except for the protected fields (see below).

From version 0.7.0 metadata on variations is also supported:

~~~php
$product = [
'product' => [
'title' => 'Foobar',
...
'variations' => [
[
'regular_price' => '9.50',
'attributes' => [
[
'name' => 'Pack Size',
'slug' => 'pack-size',
'option' => '4-pack etc',
],
// These custom meta fields will be added to the variations.
// When fetching variable products, the metafields will be retrieved
// for the variations.
'custom_meta' => [
'my_custom_variation_field_name' => 'my custom variation value',
'my_other_variation_custom_field_name' => 'my other custom variation value',
],
],
],
],
]
]
~~~

I have not tested this with anything other than strings, so be aware that the behaviour storing other data structures
in metafields are *undefined* at present.

Expand Down
15 changes: 11 additions & 4 deletions readme.txt
Original file line number Diff line number Diff line change
@@ -1,19 +1,26 @@
=== WC API Custom Meta ===
Contributors: judgej
Tags: woocommerce,
Tags: woocommerce, api
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=B4STZL8F5WHK6
Requires at least: 4.0.0
Tested up to: 4.2.2
Stable tag: 0.6.0
Tested up to: 4.4.2
Stable tag: 0.7.0
License: GPL2
License URI: http://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html

Allows access to custom meta fields on products through the API.

== Description ==
Allows access to custom meta fields on products through the API.
In short, installing this plugin on your WooCommerce site, will extend the
WooCommerce API so that custom metadata can be passed back and forth through
that API.

See the main documentation here: https://github.com/judgej/wc-api-custom-meta

== Installation ==
Standard installation - whatever you normally do.

Will only work with WooCommerce with the V2 API.
Will only work with WooCommerce with the V2 API at his time, which means any version
from mid-2015, until the V2 API is eventually removed. It may work with the V3
API, but that has not been tested.
4 changes: 2 additions & 2 deletions wc-api-custom-meta.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
Plugin Name: WC API Custom Meta
Plugin URI: hhttps://github.com/judgej/wc-api-custom-meta
Description: Allows access to custom meta fields on products through the API.
Version: 0.6.0
Version: 0.7.0
Author: Jason Judge
Author URI: http://academe.co.uk
Author URI: http://academe.co.uk https://github.com/buxit
*/

/**
Expand Down

0 comments on commit a317745

Please sign in to comment.