• Resolved Trinitech

    (@trinitech)


    Hi,

    I would like to use your snippet Change the calculation date for orders but I am not sure If I still need to enable the setting in the gateway or not?

    I want the order to expire after 30 business days for bank payment gateway.
    function woa_date_order_hook( $old_date, $gateway, $mode ) {
    // For example, change date only for cheque.
    if ( 'cheque' == $gateway ) {
    $old_date = strtotime( 'today -3 weekdays' );
    }

    return $old_date;
    }
    add_filter( 'woo_cao_date_order', 'woa_date_order_hook', 10, 3 );

Viewing 1 replies (of 1 total)
  • Plugin Author RVOLA

    (@rvola)

    hi

    You must change here:

    if ('check' == $ gateway) {
    $ old_date = strtotime ('today -3 weekdays');
    }

    replace “check” by the name of the gateway (same name as to add a gateway)
    and change this:
    $ old_date = strtotime ('today -3 weekdays');

    by this :

    $ old_date = strtotime ('today -30 days');

Viewing 1 replies (of 1 total)
  • The topic ‘Change the calculation date for orders snippet’ is closed to new replies.