Skip Navigation

[Resolved] Filter Products base on Custom User Fields

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

Last updated by bambiM 5 years, 10 months ago.

Assisted by: Minesh.

Author
Posts
#1195241

I created a custom user field called Web Category ( checkbox ), and what I want is to show the products base on the product category and the "Web Category" user field.

Ex.
Current Logged-in User has selected the "Art" checkbox then the Views will filter the product list to only show the Art Product Category.

Does it makes sense?

Thanks

#1195351

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

Well - as I understand, you want a view to display list of filtered items belongs to your user field value - correct? If yes,

I need problem URL and access details to check how you configured your field and view.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I would additionally need your permission to de- and re-activate Plugins and the Theme, and to change configurations on the site. This is also a reason the backup is really important. If you agree to this, please use the form fields I have enabled below to provide temporary access details (wp-admin and FTP).

I have set the next reply to private which means only you and I have access to it.

#1195883

Minesh
Supporter

Languages: English (English )

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

Ok - thank you for sharing access details.

Now, you need to adjust your custom checkboxes field values in order to have unified values with your product category and your user custom field.

With your user field "web-category" - you need to set the exact slug of taxonomy term as value for all of your checkboxes options.
=> hidden link

As you can see with the above link, I've set the "art-design-media" as value for the option "Art, Design & Media". You need to set the same slug as per the taxonomy term here for all your checkboxes options:
=> hidden link

With the user for which you shared access details "Iadmin_paypercontent ", I've only set first checkbox "Art, Design & Media" and saved the profile.

I'm displaying the view as given under:

[wpv-view name="article-archive" wpvproductcat="[types usermeta='web-category' separator=',' user_is_author='true'][/types]"]

And I've added following taxonomy filter to your view:

Select posts with taxonomy:
Product categories slug in one of those set by the View shortcode attribute wpvproductcat
eg. [wpv-view name="view-name" wpvproductcat="xxxx"]

I can see that now as with my profile only one checkbox is checked "Art, Design & Media", its correctly filtering the results.
=> hidden link

#1197348

My issue is resolved now.
Thank you So Much Minesh! WP Toolset for the win!

#1197379

Hi Minesh,

Last Question, is it possible to do it on the archive views?

Thanks

#1197826

Minesh
Supporter

Languages: English (English )

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

Well - would you mind to create a new ticket with your every new question. This will help other users searching on the forum as well as help us to write correct resolve ticket summary.

Thank you for understanding.

#1198994

My issue is resolved now. Thank you!