• Resolved Selman Demirdoven

    (@demirdoven)


    Hello. Thanks for this nice plugin.

    I noticed that a problem with sortable “Delivery Details” column on Orders page at the admin panel. After administrator updates the delivery/pickup date manually on edit order page, it doesn’t make any change when sort the orders by Delivery Details.

    Because the sorting function depends on “delivery_details_timestamp” meta values of orders. And when order dates been changed manually by admin, this meta value is not been updated.

    I’ve fixed this problem with adding these following to the class-coderockz-woo-delivery-admin.php file. And thought that maybe you want to know this and update your plugin.

    after line 5909 and again after 5937:
    update_post_meta( $order_id, 'delivery_details_timestamp', strtotime($en_date) );

    after line 5912 and again after 5940:
    delete_post_meta($order_id, 'delivery_details_timestamp');

    Finally, now when sort the orders by delivery details, it sorts them correctly.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author coderockz

    (@shoroar)

    Hello @demirdoven

    Thank you very much.

    We will fix it in our next version update.

    Thank you.

    xuxu88

    (@xuxu88)

    @demirdoven Could you maybe copy block for me of your adjustments from let’s say
    line 5907

    if(isset($_POST['pickupTime'])) {
    				$pickup_time = sanitize_text_field($_POST['pickupTime']);
    				update_post_meta( $order_id, 'pickup_time', $pickup_time );

    to your last adjusted line of former line 5940?

    Because I am trying to incorporate your correction for my site and I can’t reproduce your adjustments within my plugin to make it work as I’m not sure if I’m adding it to the right lines. Would very much appreciate it!

    Thread Starter Selman Demirdoven

    (@demirdoven)

    @xuxu88 , i didnt regard hours (time) of delivery/pickup, because it was enough to sort orders by only dates. So i’ve appended my code into this condition (for pickup):

    if(isset($_POST['pickupDate'])) {}
    
    And for delivery type (not pickup), ive added my code into this condition:
    
    

    if(isset($_POST[‘date’])) {}

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘The bug with sortable admin column (Delivery Details)’ is closed to new replies.