HPOS compatibility for query loop (query woo orders/downloads)

It would be great to query woocommerce orders and downloads stored as HPOS on the query loop.

When HPOS is active on WooCommerce, orders and downloads are stored on _woo_orders _woo_orders_meta _woo_downloads _woo_downloads_meta tables, for higher database performance. As they are gone of _posts and post_meta tables, those entries are not reachable by the Bricks query loop.

Supporting HPOS will allow to highly customise the woocommerce customer endpoints while keeping high performance.

Meanwhile we are using wc_get_orders to customize the Woocommerce Order endpoint template.

5 Likes

Indeed. More info here: High-Performance Order Storage Documentation - WooCommerce

Indeed. This would be nice. Some more info here: High-Performance Order Storage Documentation - WooCommerce

+1
Definitely need this. I use HPOS on all my stores.

if someone is still interested, i got it working with the new API Query available since Bricks 2.1.
Of couse the usual dynamic data tags won´t work, but creating custom dynamic data from the api-query is pretty simple in bricks.

I use my own Rest-Endpoint but i guess it will work with the Woocommerce API as well.

1 Like

Thanks for the update @Mario , good to know

It arrives late to me

I prepared months ago a “My purchased Videos” page template for customers to play their purchased downloadable media online (videos) without downloading. I did with pure PHP while supporting HPOS, including search a purchased product among the customer orders, sort and pagination. I wanted to do that with Bricks using the query loop, but finaly I had to write the template with pure PHP which was really complex to me, but thanks to IA I achieved that succesfully.

For each order I had to get the download links, then the download retries count and expiration date, the protected file link using X-send and send it to a html < video > tag, also with the product name, and video cover, video duration and other ACF fields per product and order.

Not sure if I will achieve such page with API queries inside query lloops on Bricks.

HPOS Custom Query Loop + Order Dynamic Tags + Pagination for Custom Loop: Easily extendable to support additional Order dynamic tags.

wc-orders-loop

Nice,“Woo Orders Query” type doesn’t appears on <= 2.2 beta. Is this expected for future versions? Or is a hack you did? Or I’m missing something?

Also, customers would love to use a “product search” among orders, by typing the name of the product and the query returns the customer orders containing that given product, like Amazon does. Would this be possible?

@thomas any news? I need this

Hi @Faradei ,

We will have some new query loop types in the new Woo enhancement. And yes, they are compatible with HPOS setup.

Regards,
Jenn

3 Likes

Cool, we hope wp_comments is also in the list of new query loop types, while supporting replies tree.

Awesome @itchycode. This news made my weekend :grinning_face: I hope the Recently viewed product query is also on the list.