Skip Navigation

[Resolved] Member Area – How to Display Loop from Custom Meta Field

This support ticket is created 7 years, 9 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
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

This topic contains 1 reply, has 2 voices.

Last updated by Beda 7 years, 9 months ago.

Assisted by: Beda.

Author
Posts
#419765

Hi,

We have used WooCommerce to set up a website for a modelling agency, where 'Products' are called 'Child Profiles' and we have removed all checkout and price features. I am now trying to create a 'parent area' that allows the parent to login and update certain attributes of their child (Height, Chest & Waist Measurements, Shoe Size, Clothes Size - all Product Attributes).

Through WooCommerce RestAPI, we are automatically creating the Parent's account which populates a custom user field (wpcf-childid) with the ProductID of their child/children.

Now, we need to create the parent's member page that displays their children with a front-end submission form to update the attributes. Our problem is how to tell the loop to display the products of the IDs within wpcf-childid? We want to loop through these using a Content Template that then allows for front end update of those certain attributes.

So, my question is - what would we have to do to get the loop to show the Products that are in the wpcf-childid field in the current logged in user's account?

Thanks 🙂

#419865

Since you are not using the native Toolset Types post relationships, you can not use the inbuilt Views feature for this.

But you can try to create a View, query your Post Type (the Child) and add a Query Filter like this:

Include only posts with IDs set by the View shortcode attribute "ids" eg. [wpv-view name="view-name" ids="1"]

Then, when you call the View you pass the Post Field (wpcf-childid) ShortCode to the ShortCode attribute ot the View.

This should then populate it with the ID of the Parent, stored in that single Child Post where you display the View.

Another approach is to do it directly in the Content Template, by adding a CRED form there, and passing the same field (wpcf-childid) as the ID of the Post that the CRED should Edit.
(in case you use CRED)

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.