• Anonymous User 16692328

    (@anonymized-16692328)


    Hi,
    how can I access the value of the first input field (textarea) in the database by meta_key to import orders from csv. Whats the mate_key, where can I find it please?

    • This topic was modified 5 years, 9 months ago by Anonymous User 16692328.
    • This topic was modified 5 years, 9 months ago by Anonymous User 16692328.
Viewing 6 replies - 1 through 6 (of 6 total)
  • Hi @hcn303

    I apologize for not reverting to you last week as I was occupied with some other work.

    The selected input field’s value of an order is stored in ‘_alg_wc_pif_global’ meta key of ‘_woocommerce_order_itemmeta’ table.

    So, you can fetch the order using WC_Order then get the items using get_items() function. Please follow the below steps to fetch the value of the custom input field’s value.

    $order = new WC_Order( $order_id );
    $items = $order->get_items();
    foreach ( $items as $item ) {
    Your code here
    }

    Please let me know whether the provided information helped you to achieve your requirements.

    Regards,
    Komal Maru

    Thread Starter Anonymous User 16692328

    (@anonymized-16692328)

    Thanks for the reply, the fetching part is clear now.
    I want to import orders to WC using a plugin (wp import all) to map fields from
    the a orders-csv columns to database fields. How would the 1-to-1 mapping look like,
    which fields to map?

    Hi @hcn303

    I apologize for the delay in response.

    We have not tested our plugin with the mentioned WP all import plugin. I have observed that the plugin is a paid plugin. Can you please email us the plugin so we can check and get back to you with an update?

    Our support email id is ‘support at tychesoftwares dot freshdesk dot com’.

    Regards,
    Komal Maru

    Thread Starter Anonymous User 16692328

    (@anonymized-16692328)

    Thanks for the reply. It might be more practical if you could let me know which (free) plugins to import WC-orders you could test it with? I’m not stuck to that particular plugin, whatever works works for me.

    Hi @hcn303,

    We have not tested with any import WC-orders plugins with our plugin so we are not sure with which plugin it will work.

    For export, I can tell you how to fetch the data from the database and then export it to the required plugin.

    But, to import and store it in the database, I am not sure about this.

    Regards,
    Komal Maru

    Thread Starter Anonymous User 16692328

    (@anonymized-16692328)

    Thanks for the reply.
    Being a bit surprised about it, as programatically storing the data in the db is the essential opposite of fetching it and already implemented in your plugin.
    Has noone ever asked before ?

    Anyway, the data is stored inside a serialized array in woocommerce_order_itemmeta -> _alg_wc_pif_local -> s:4:”value”
    How does it get in there ? how can I find out ?

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Access the value of input field in DB to import orders’ is closed to new replies.