Paid More Than 15 Minutes Ago

[ad_1]

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.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer