Wordpress Woocommerce: Add custom condition in product query based on custom filter

Viewed 21

I am working on a woocommerce project with little bit knowledge on wordpress. Now, I have got a requirement which is shared below:

1. Show date calendar on product listing page top of list not in sidebar. I am saving product availiblity based on date ranges in separate table. This table has product id, date start and date end.
2. Show sizes dropdown on product listing on top of list. Sizes filter is already showing in sidebard but client wants it on top. So, I wil disable it in sidebar.
3. When customer will select date and size, product list should be filter accordingly.  

I have read wordpress documentation where wc_query has option to use either "EXISTS or NOT Exists" through ws_meta_query. But I am not able to understand, how can I put filter on product query using either "EXISTS or NOT EXISTS" with my custom raw query?

Can someone please guide me how can I implement whole requirement along with how can I EXISTS using raw sql query with product query?

Thanks in Advance

1 Answers
Related