Skip Navigation

[Resolved] Display Woocommerce orders on front-end

This support ticket is created 2 years, 8 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 19 replies, has 2 voices.

Last updated by dmitryK-2 2 years, 8 months ago.

Assigned support staff: Minesh.

Author
Posts
#1633143

Correct

#1633271

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Can you please check now: hidden link

I've created the following view "list-all-orders" that query the orders:
=> hidden link;

And created the following view "list-products-belongs-order" that query the products belongs to order:
=> hidden link

And added the view "list-products-belongs-order" within the Loop editor of "list-all-orders" as given under:

<td> [wpv-view name="list-products-belongs-order" ids="[wpv-ordered-product-ids]"] </td>

Where:
- [wpv-ordered-product-ids] will return the ordered product IDs.
More info:
=> https://toolset.com/documentation/user-guides/views/views-shortcodes/#wpv-ordered-product-ids

I can see its works as expected, you can format the view's loop editor to output the things as per your requirement.

#1633309

Hi Minesh,

but what about my shortcode and views - it has vice versa logic - I need to show:
- View "sht-adm_orders-prod_list" - shows all products & than breackdown by all orders "sht-adm_orders-list" which needs to be filtered by 'prodid' shortcode attribute [get_orders_by_product_id]

What you did - it is the view logic - All orders & breackdown by Products per orders

#1633351
Screenshot 2020-05-21 at 16.49.20.png
Screenshot 2020-05-21 at 16.30.28.png

I've tested again the View "sht-adm_orders-prod_list" (list of. Products) and subsidary view "sht-adm_orders-list" (list of orders with product in it) - I've switched to constant , Order ID = 5697

The result of View was completely wrong - it shows all the products has order # 5697 . That is totally wrong, because the order #5697 is only for product ID 5313.

That means there is a bug in filtering Views. I expect to see
Product ID 5313 & related order 5697
Product ID XXXX & 'No items found' for related orders.

#1633557

Solution provided vice versa I've asked