• Resolved Syrsan

    (@syrsan)


    Hi! I’m not sure if it’s the right place to ask but maybe there is still somebody who knows the answer…
    I am trying to transfer some data into woocommerce by writing the data directly into the database.
    The problem is that it doesn’t seems to work with the variable products. In the plugin I can see the parent product but no attribute and no variations. I added everything that was necessary, or at least I think so, but it is still not working. The interesting thing though is that if, in the plugin, I add the corresponding attribute manually to the parent product the variations appear but I can’t see any new entries nor any change in the database to the records I added.

    A variable product has the following changes compared to a normal entry

    wp_post – for the child
    post_parent : parent_id
    post_type : “product_variation”
    i also making the specific changes in menu_order, guid, post_name, post_title

    wp_postmeta
    _product_attributes : serialized data
    _default_attributes : serialized data
    _min_variation_price, _max_variation_price…..
    for parent and
    attribute_AttrName : value

    wp_term_relationships
    object_id : Parent_ID
    term_taxonomy_id: 4
    term_order : 0

    wp_options
    option_name : _transient_wc_product_children_ids_2,
    option_value : a:2:{i:0;s:1:”3″;i:1;s:1:”4″;}
    autoload : yes

    wp_term_taxonomy
    term_taxonomy_id : 4
    term_id : 4
    Taxonomy: product_type
    parent : 0
    count : Nr_of_variable_products

    Does anybody has any idea what am I missing?

    It’s a C# program… I get the data from an .rpt file and writing it into the database.

  • The topic ‘Woocommerce Variable Product’ is closed to new replies.