TycheSoftwares / order-delivery-date-for-woocommerce

WooCommerce Delivery Date Lite
8 stars 5 forks source link

Unable to sort the delivery dates on WooCommerce Order page #503

Closed Chetna1510 closed 6 months ago

Chetna1510 commented 1 year ago

Describe the bug The Delivery date plug in when you filter the right hand side it doesn't change the dates in order.

image

To Reproduce I'm able to replicate the issue on the staging site where I'm unable to sort the orders by delivery date.

Isolating the problem (mark completed items with an [x]):

WordPress Environment

``` **Additional context** https://tychesoftwares.freshdesk.com/a/tickets/56804
rashmimalpande commented 11 months ago

The sorting won’t work when ‘Enable default sorting of orders (in descending order) by Delivery Date on WooCommerce -> Orders page’ setting is disabled. Please check it by enabling this setting. It works fine when enabled.

ashokrane commented 11 months ago

@rashmimalpande @upenkapse @Chetna1510 Should we get rid of this setting & have it always enabled? Whether to sort it or not is upto the store admin. But by default, we can remove this setting & keep it enabled? The idea is to get rid of something obvious & not need to have a setting.

rashmimalpande commented 11 months ago

@ashokrane I agree. We can remove this setting from both lite & pro version.

Chetna1510 commented 11 months ago

@ashokrane Yes, definitely we can remove that setting.

@rashmimalpande Even with "Enable default sorting of orders (in descending order) by Delivery Date on WooCommerce -> Orders page’ setting" setting enabled, sorting was not working. It seems the issue is with HPOS. If you will enable HPOS, it creates an issue.

oluisrael11 commented 11 months ago

@ashokrane @rashmimalpande I'm also in support of removing the setting and enabling the order sorting enabled by default. It doesn't seem like it will affect anything, nor will users have an issue with the sorting if the setting is removed.

upenkapse commented 11 months ago

@rashmimalpande @upenkapse @Chetna1510 Should we get rid of this setting & have it always enabled? Whether to sort it or not is upto the store admin. But by default, we can remove this setting & keep it enabled? The idea is to get rid of something obvious & not need to have a setting.

This setting is needed because it not only sorts the orders when the Delivery Date sorting is used manually but as the name of the setting suggests it sorts the orders by default in descending order based on the delivery date selected in the orders.

It changes the default WooCommerce order sorting of recent orders first so we should not overwrite this default WooCommerce sorting without giving them an option.

ashokrane commented 11 months ago

Sorry guys. I misunderstood the setting that it is just used to make the delivery date field as sortable. I now have checked it's label (as @upenkapse said): "Enable default sorting of orders (in descending order) by Delivery Date on WooCommerce -> Orders page" . So removing it & enabling by default may not be a right decision.

https://github.com/TycheSoftwares/order-delivery-date-for-woocommerce/issues/503#issuecomment-1704647043 - @rashmimalpande Even if this setting is disabled, the sorting on the delivery date field should still work. The only thing this setting is supposed to do is show the order sorted by delivery date by default i.e when the Orders page loads. This setting shouldn't affect the behaviour when someone clicks on the Delivery Date column heading (to sort the orders) on the Orders page.

@upenkapse

This setting is needed because it not only sorts the orders when the Delivery Date sorting is used manually

On the same lines as I mentioned to Rashmi above, I don't think this setting should be needed to sort the orders by delivery date manually.

Chetna1510 commented 6 months ago

The issue is still there when HPOS is enabled.

When HPOS is disabled: image

When HPOS enabled:

image

So, I'm going to reopen this.