Comments (18)
Yeah, Attribute support is being worked on right now. It's problematic because it's a database within a database...
from woocommerce-json-api.
Attribute reading is added in. Writing hasn't been tested...
from woocommerce-json-api.
Thanks for working so fast in the issue. Unfortunately I am afraid the issue is still opened. I pulled the new code and tested the get products call again and now the attributes values are shown as null instead of empty.
from woocommerce-json-api.
what is the database value, exactly. i.e. select the raw value and put it in your comment so I can recreate the values on my local system.
from woocommerce-json-api.
The attributes are of type "Text". The values are text strings.
from woocommerce-json-api.
Which version of WooCom do you have? It's look slightly different to mine...
Also, I kind of need the database represetation. Will prolly look like a:{i:1:"pa_ean blah blah,
You can run these commands to find out:
$ mysql -u myuname -pPASSNOSPACEAFTERp my_database_name
> select meta_key, meta_value from wp_postmeta where meta_key = '_product_attributes' and post_id = 'mypostidhere'
Or use PHPMyAdmin or something.
from woocommerce-json-api.
I am running Woocommerce 2.0.14 in Wordpress 3.6.1
This is the output of the next query:
select meta_key, meta_value from wp_postmeta where meta_key = '_product_attributes' and post_id = '84';
meta_id: 2425
post_id: 84
meta_key: _product_attributes
meta_value: a:4:{s:6:"pa_ean";a:6:{s:4:"name";s:6:"pa_ean";s:5:"value";N;s:8:"position";i:0;s:10:"is_visible";i:1;s:12:"is_variation";i:0;s:11:"is_taxonomy";i:1;}s:12:"pa_packaging";a:6:{s:4:"name";s:12:"pa_packaging";s:5:"value";N;s:8:"position";i:4;s:10:"is_visible";i:1;s:12:"is_variation";i:0;s:11:"is_taxonomy";i:1;}s:6:"pa_adr";a:6:{s:4:"name";s:6:"pa_adr";s:5:"value";N;s:8:"position";i:5;s:10:"is_visible";i:1;s:12:"is_variation";i:0;s:11:"is_taxonomy";i:1;}s:6:"pa_nem";a:6:{s:4:"name";s:6:"pa_nem";s:5:"value";N;s:8:"position";i:7;s:10:"is_visible";i:1;s:12:"is_variation";i:0;s:11:"is_taxonomy";i:1;}}
from woocommerce-json-api.
The values are null.
{
s:4:"name";
s:6:"pa_ean";
s:5:"value";N;
s:8:"position";
i:0;
s:10:"is_visible";
i:1;
s:12:"is_variation";
i:0;
s:11:"is_taxonomy";
i:1;
}
s:5:"value";N; means Null.
Do you have a plugin running that filters these attributes?
from woocommerce-json-api.
I see the problem, your product attributes are a taxonomy.
from woocommerce-json-api.
Alright, latest version supports the WooComm attribute taxonomy reading.
Writing them doesn't have 100% support just yet but the code is in place but will have to wait till I cam write up a test case for it.
from woocommerce-json-api.
@jasonknight is there any plans to fix this issue? I am still getting all attributes blank.
from woocommerce-json-api.
Yes, could you provide me with your testing db so I can work against your precise situation? You can send it via dropbox or something?
from woocommerce-json-api.
Okay, I just pushed a change that should let you at least read the taxonomy values...
Part of the product taxonomy system.
from woocommerce-json-api.
I uploaded your updated code and I can read attributes without any problems. Thanks!
from woocommerce-json-api.
I'm also sailing in the same issue. Could you post the updated code, it would be a great help. Thanks
from woocommerce-json-api.
The latest code is always in the repo. If you are having issues, maybe you can poke around and see what is up?
from woocommerce-json-api.
I couldn't able to get attribute values from taxonomy. I have tried
select meta_value from wp_postmeta where meta_key = '_product_attributes' and post_id = '55';
It gives an array a:1:{s:13:"pa_size-value";a:6:{s:4:"name";s:13:"pa_size-value";s:5:"value";s:0:"";s:8:"position";s:1:"0";s:10:"is_visible";i:1;s:12:"is_variation";i:1;s:11:"is_taxonomy";i:1;}}
With these array values, i dono how to proceed.
Could you mention how to walk around with woocommerce taxonomy?
from woocommerce-json-api.
Aiyiyi. The WC Product Attribute Taxonomy is so insane, I don't even pretend to understand it. It's a pretty circuitous route to any. Basically they have their own table that you select against. You'll have to look at the table structure, I don't recall off the top of my head. It's a similar query to getting a regular taxonomy, I think you may even be able to use WP Core functions to do it...
from woocommerce-json-api.
Related Issues (20)
- Issue With get_products HOT 1
- Issues With set_product HOT 1
- Support for delete product HOT 1
- Deleting Product Variation HOT 1
- How can I set featured image when set_products? HOT 1
- URL HOT 1
- How can i use this plugin?
- How can i use this plugin? HOT 2
- Product attribute 'attributes' is represented as array, map or string HOT 5
- invalid api user HOT 1
- Feature request: get_* include last modified time HOT 4
- Var not set HOT 2
- Plans To Support Filters HOT 6
- Issues With get_orders() and get_products
- Question regarding target url HOT 3
- Is it possible to test the plugin using cUrl method? HOT 4
- Plugin can not be activated after installation HOT 2
- TypeError HOT 2
- Create a Product and add it to a WooThemes Subscription HOT 1
- package management HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from woocommerce-json-api.