Skip Navigation

[Resolved] create order list for front end user

This thread is resolved. Here is a description of the problem and solution.

Problem:
create order list for front end user which shows or display only loggedin user orders

Solution:
To display only logged-in user's order I see the user ID is stored with meta key _customer_user. You should set your view to filter by this hidden custom field.

You can find proposed solution, in this case, with the following reply:
https://toolset.com/forums/topic/create-order-list-for-front-end-user/#post-1078447

Relevant Documentation:

This support ticket is created 6 years, 4 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 3 replies, has 3 voices.

Last updated by puneetS-3 6 years, 4 months ago.

Assisted by: Minesh.

Author
Posts
#1078353

Tell us what you are trying to do? create order list for front end user but it show all orders and i want only to show the login user his own orders

Is there any documentation that you are following? https://toolset.com/learn/create-an-ecommerce-wordpress-site/displaying-more-information-from-woocommerce/how-to-display-woocommerce-orders-on-the-front-end/

Is there a similar example that we can see? https://toolset.com/forums/topic/display-orders-list-for-an-user/

What is the link to your site? mybc.co.il

#1078447

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

To display only logged-in user's order I see the user ID is stored with meta key _customer_user . So please follow the following steps:

1) Go to Toolset => Settings => Front-End Content => Hidden custom fields section
- click on button "Select custom fields"
- find the find '_customer_user' and check-mark it
- click on button "Apply"

2) Edit your order view
- go to section "Query Filter" and add query filter for field _customer_user which you will see it within the custom fields section of query filter dropdown and click on button "Add query filter"
- select - the field _customer_user is a Number from dropdown and further select to filter by shortcode attribute and give the name as userid

For example:
=> hidden link

3) Go to a page where you are trying to display your order view and add userid and pass current loggedin user ID to it as given under.:

[wpv-view name="your-view-slug" userid="[wpv-current-user info='ID']"]

I hope above steps will help you to resolve your issue.

#1078449

thank you very much, it works...

#1305491

This won't work. You need to user info='id' Instead of info="ID"

So the code becomes:

[wpv-view name="your-view-slug" userid="[wpv-current-user info='id']"]