Giter Site home page Giter Site logo

Comments (18)

jasonknight avatar jasonknight commented on September 26, 2024

Yeah, Attribute support is being worked on right now. It's problematic because it's a database within a database...

from woocommerce-json-api.

jasonknight avatar jasonknight commented on September 26, 2024

Attribute reading is added in. Writing hasn't been tested...

from woocommerce-json-api.

sdelamo avatar sdelamo commented on September 26, 2024

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.

www weco-pirotehnika hr_callback_action_woocommerce_json_api_proc_get_products_arguments_per_page__100_arguments_page__1_arguments_token__6f2ldxomqeerr_and_crazy_chicken___weco_pirotehnika_and_untitled html_-_weco_croacia

from woocommerce-json-api.

jasonknight avatar jasonknight commented on September 26, 2024

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.

sdelamo avatar sdelamo commented on September 26, 2024

edit_product__weco_pirotehnika__wordpress

The attributes are of type "Text". The values are text strings.

from woocommerce-json-api.

jasonknight avatar jasonknight commented on September 26, 2024

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.

sdelamo avatar sdelamo commented on September 26, 2024

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.

jasonknight avatar jasonknight commented on September 26, 2024

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.

jasonknight avatar jasonknight commented on September 26, 2024

I see the problem, your product attributes are a taxonomy.

from woocommerce-json-api.

jasonknight avatar jasonknight commented on September 26, 2024

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.

sdelamo avatar sdelamo commented on September 26, 2024

@jasonknight is there any plans to fix this issue? I am still getting all attributes blank.

from woocommerce-json-api.

jasonknight avatar jasonknight commented on September 26, 2024

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.

jasonknight avatar jasonknight commented on September 26, 2024

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.

sdelamo avatar sdelamo commented on September 26, 2024

I uploaded your updated code and I can read attributes without any problems. Thanks!

from woocommerce-json-api.

PriyankaRose avatar PriyankaRose commented on September 26, 2024

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.

jasonknight avatar jasonknight commented on September 26, 2024

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.

PriyankaRose avatar PriyankaRose commented on September 26, 2024

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.

jasonknight avatar jasonknight commented on September 26, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.