Price for sorting is incorrect #434
Labels
priority: low
The issue/PR is low priority—not many people are affected or there’s a workaround, etc.
type: bug
The issue is a confirmed bug.
type: good first issue
The issue is a good candidate for the first community contribution/for a newcomer to the team.
Milestone
What I expected
I expect the orderby=price-asc order by to be working correctly
What happened instead
Values saved in lookup_table are wrong, resulting order is wrong
Steps to reproduce the issue
Note 1: It looks like this happen only after an "update", not on creation.
Note 2: this is the query I use in the following steps to get the values
Create an accommodation product with the following:
Create another accommodation product with the following:
When using sorting by price asc, we want the cheapest first (Product1) but we have Product2 first.
This is because lookup_table gets a calculated value that take the min number of nights into account (see
WC_Bookings_Cost_Calculation::calculated_base_cost()
)...WC_Accommodation_Booking_Admin_Panels::save_product_data() tries to solve that l424:
but at that time, price is already set in lookup table.
The text was updated successfully, but these errors were encountered: