• Hello! In the WordPress desktop, in the Woocommerce Orders area, the date that appears as acceptance of the Privacy Policy by the customer appears on the current date (all products with the same) instead of the date of purchase and acceptance.
    Why could this be?
    Thank you very much!

Viewing 1 replies (of 1 total)
  • The error is caused if I edit an existing order in the backend of WooCommerce which has the date accepted already stored in postmeta with the meta_key = ‘_wpgdprc’ and a date in the past, this date is not shown – instead the current date is always displayed.

    This is also the case when listing orders in WooCommerce – the original accepted date is ignored and the current date is displayed against all of the orders.

    To fix it, edit /plugins/wp-gdpr-compliance/Integrations/Plugins/WooCommerce.php and:

    Replace line [224]:
    $value = $this->getAcceptedDate( ! empty( $date ) );

    with:

    if($date=='') {
        $value = '';
    } else {
        $value = Time::localDateFormat( get_option( 'date_format' ) . ' ' . get_option( 'time_format' ), $date );
    }

    Replace line [206]:
    $value = $this->getAcceptedDate( ! empty( $date ) );

    with:

    if($date=='') {
        $value = '';
    } else {
        $value = Time::localDateFormat( get_option( 'date_format' ) . ' ' . get_option( 'time_format' ), $date );
    }

    Add after line [7]:

    use WPGDPRC\Utils\Time;

    This also fixes the issue of any records that were in the database before the plugin was added, in which case there is no record in postmeta and so no date to check.

Viewing 1 replies (of 1 total)
  • The topic ‘Wrong date of acceptance of Privacy Policy by customers’ is closed to new replies.