• Resolved iwanwilaga

    (@iwanwilaga)


    Hello there!

    I got stuck.
    At the “Convert timestamp data to date format” option
    If i leave it checked, the user’s postcode fields, eg.: ‘billing_postcode’ and ‘shipping_postcode’ gets generated into Datetime format (as you said in that alert info), but if i uncheck it then after export-import the postcodes are OKAY, but the ‘user_registered’ (@ wp_users ) becomes ‘0000-00-00 00:00:00
    ‘ at every freshly imported users.

    The postcode here is a 4 digit number.
    Can this be server/mysql settings specific issue? As the from and to website are on diff. hosts.
    Thank you, best wishes!
    Wiktor

    • This topic was modified 4 years, 7 months ago by iwanwilaga.
    • This topic was modified 4 years, 7 months ago by iwanwilaga.
Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Javier Carazo

    (@carazo)

    @iwanwilaga,

    You can use this filter: acui_export_non_date_keys

    Or deactivate the datetime format conversion.

    Anyway in next version I will include those two fields to prevent the conversion by default.

    Stay tuned and update. Next version will fix it.

    Thread Starter iwanwilaga

    (@iwanwilaga)

    Hello Javier,

    Initially i tried this import process with the datetime format conversion activated and deactivated as well. That’s when the but ‘user_registered’ fields got knocked out: ‘0000-00-00 00:00:00‘ value at every freshly imported users.

    So either way has problem if i get it right.

    NOw i put this into functions.php:

    
    function exclude_problematic_datetime_keys( $keys ){
        $keys[] = 'user_registered';
        $keys[] = 'billing_postcode';
        $keys[] = 'shipping_postcode';
        
        return $keys;
    } 
    add_filter( 'acui_export_non_date_keys', 'exclude_problematic_datetime_keys', 10, 1 );
    

    It seems not running, (at least no change in the results, all 3 keys are with same problems.

    I tried this with the user list which i exported by the timestamp conversion option CHECKED.

    UPDATE
    NOw it seems if i export with the ..conversion UNCHECKED, then the hook probably works, and all 3 data is untouched by the converter. Thats happy thing! So in this case should it be Emphasized, that the export always should have been done UNCHECKED if we wanna use the above hook?

    Any ideas? Thank you..
    Wiktor

    • This reply was modified 4 years, 7 months ago by iwanwilaga.
    • This reply was modified 4 years, 7 months ago by iwanwilaga. Reason: update added
    • This reply was modified 4 years, 7 months ago by iwanwilaga.
    Plugin Author Javier Carazo

    (@carazo)

    Update to the last version and check again.

    It should work.

    Thread Starter iwanwilaga

    (@iwanwilaga)

    Hello Javier,

    Here are my updates on the updated version ?? :

    • I did update to latest (1.15.8), and exported orders with the ‘Convert timestamp data to date format’ CHECKED.
    • Also (just in case) i run the export in Troubleshoot mode, so only your plugin was activated.
    • Now all field got proper format, except this: ‘shipping_phone’.
      Can you please also include this on your plugin format/exclude logic, or what solution you suggest for now?

      Cheers, best wishes,
      Wiktor

    Plugin Author Javier Carazo

    (@carazo)

    @iwanwilaga,

    I have just included. Update.

    Anyway there is a filter to include as many fields as you want.

    Thread Starter iwanwilaga

    (@iwanwilaga)

    HEllo.

    Cool! The update worked.
    I am not sure that the filter that i added, did anything at all. To me it seems only that code does effect that you applied into your plugin codebase.

    Should this piece of code work by the way? OR what did i do wrong? This didn’t work for me on ‘shipping_phone’ yesterday, before your latest update.)

    function exclude_problematic_datetime_keys( $keys ){
        $keys[] = 'user_registered';
        $keys[] = 'billing_postcode';
        $keys[] = 'shipping_postcode';
        $keys[] = 'shipping_phone';
        
        return $keys;
    } 
    add_filter( 'acui_export_non_date_keys', 'exclude_problematic_datetime_keys', 10, 1 );

    (maybe the add_filter line is wrong with those 2 explicit priority + param number parameters?)
    Thank you!
    Viktor

    • This reply was modified 4 years, 6 months ago by iwanwilaga.
    • This reply was modified 4 years, 6 months ago by iwanwilaga.
    • This reply was modified 4 years, 6 months ago by iwanwilaga.
    Plugin Author Javier Carazo

    (@carazo)

    @iwanwilaga,

    This filter should work.

    This is strange.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Postcode Datetime conversion issue’ is closed to new replies.