• abdulmoiz222

    (@abdulmoiz222)


    Hi there, i am using “Advanced Order Export For WooCommerce” for order export. I have some custom in put fields in my checkout and i am showing these fiels in woocommerce > orders using this hook “woocommerce_admin_order_totals_after_tax”. This data is in serialize form in data base and meta key is “_participant”. so now when i export data by add field and fill it with meta key it showing me data in this format
    s:906:”a:21:{s:14:”part_full_name”;a:1:{i:0;s:19:”Developer Testing 2″;}s:18:”part_contact_phone”;a:1:{i:0;s:11:”45454545454″;}s:20:”additional_checkbox1″;a:1:{i:0;s:2:”on”;}s:20:”additional_checkbox2″;a:1:{i:0;s:2:”on”;}s:9:”occupant1″;a:1:{i:0;s:9:”occupancy”;}s:8:”birthday”;a:1:{i:0;s:10:”1999-06-14″;}s:7:”address”;a:1:{i:0;s:9:”test”;}s:4:”city”;a:1:{i:0;s:4:”test”;}s:5:”state”;a:1:{i:0;s:4:”test”;}s:3:”zip”;a:1:{i:0;s:5:”46000″;}s:8:”pass_num”;a:1:{i:0;s:10:”6AuPQ3d6KH”;}s:17:”upload_img_hideen”;a:1:{i:0;s:0:””;}s:6:”gender”;a:1:{i:0;s:4:”male”;}s:11:”aware_issue”;a:1:{i:0;s:18:”concerns concerns “;}s:11:”require_any”;a:1:{i:0;s:12:”requirements”;}s:13:”note_organize”;a:1:{i:0;s:18:”OrganizerOrganizer”;}s:10:”refference”;a:1:{i:0;s:18:”referred referred “;}s:5:”adult”;a:1:{i:0;s:5:”adult”;}s:9:”knowledge”;a:1:{i:0;s:2:”on”;}s:9:”send_mail”;a:1:{i:0;s:2:”on”;}s:5:”terms”;a:1:{i:0;s:2:”on”;}}”;
    i want it to be pretier
    Can we do something that when we export the order this data should not be in serialized form.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter abdulmoiz222

    (@abdulmoiz222)

    Can we do something that when we export the order this data should not be in serialized form.

    Plugin Author algol.plus

    (@algolplus)

    please, check topic https://docs.algolplus.com/algol_order_export/hooks-filters/

    if you added key “_participant” to export — hook will be

    add_filter('woe_get_order_value__participant',function( $value,$order, $fieldname ) {
    return $value;
    }, 10, 3 );

    Thread Starter abdulmoiz222

    (@abdulmoiz222)

    i used this code but its still not unserializing it in export.

    add_filter('woe_get_order_value__participant', function($value, $order, $fieldname) {
    if (!empty($value)) {
    $unserialized_value = maybe_unserialize($value);
    if (is_array($unserialized_value)) {
    // Convert array to a readable format, for example, JSON
    $value = json_encode($unserialized_value, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);
    } elseif (is_string($unserialized_value)) {
    $value = $unserialized_value;
    }
    }
    return $value;
    }, 10, 3);

    Plugin Author algol.plus

    (@algolplus)

    please run phpMyAdmin , open table wp_postmeta and export one record as SQL file.

    you can submit this file as new ticket to https://algolplus.freshdesk.com

    • This reply was modified 5 months ago by algol.plus.
    Plugin Author algol.plus

    (@algolplus)

    probably $value damaged? try use

    $unserialized_value = maybe_unserialize($order->get_meta("_participant"));

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.