• Resolved ffone

    (@ffone)


    We’re trying to set up a scheduled export that exports orders that were paid at least 15 minutes ago.

    We have an order filter set up where _paid_date <= {15 Minutes Ago}, and the following custom PHP:

    add_filter( “woe_compare_field_cast_to_type”, function($type, $field, $operator, $value, $public_fieldname){
    if( $public_fieldname == “_paid_date” ) $type = “date”;
    return $type;
    },10,5);

    add_filter(‘woe_settings_validate_defaults’, function ($settings) {
    $settings = json_encode($settings);
    $settings = str_replace( ‘{15MinutesAgo}’, date(“Y-m-d H:i”, strtotime(“-15 minutes”)), $settings);
    $settings = json_decode($settings, true);
    return $settings;
    } );

    This doesn’t seem to be working, however.

    Orders that were paid less than 15 minutes ago are still appearing in the export. If strtotime(“-15 minutes”) is changed to strtotime(“-1200 minutes”), though, which suggests perhaps a timezone issue with the comparison?

    Any help you could give would be much appreciated.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Paid More Than 15 Minutes Ago’ is closed to new replies.