Skip Navigation

[Resolved] View Post ID filter

This support ticket is created 3 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
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9: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/Karachi (GMT+05:00)

This topic contains 2 replies, has 2 voices.

Last updated by jelle-jacobd 3 years, 9 months ago.

Assisted by: Waqar.

Author
Posts
#1967007
Schermafbeelding 2021-02-25 om 17.01.40.png

Hi,

I have created a custom field to store product id's of related products or "outlet" as we call it in this case. The fields for related products (cross-sell and up-sell) are already in use. In itself this works fine, but if no value is entered, the view will show all available values. I have now solved it as below, but is that the correct and neat way to do it? It works, but maybe there's a better way?

I have put this is my page template:
[wpv-conditional if="( $(outlet) ne '' )"][wpv-view name="Outlet products" ids="[wpv-post-field name='outlet']" cached="off"][/wpv-conditional]

I uploaded the view setting in the image section.

Thanks!

#1967627

Hi,

Thank you for contacting us and I'd be happy to assist.

Your understanding is correct and adding an empty check for the "outlet" field value is the right logical way to achieve this.

regards,
Waqar

#1967755

My issue is resolved now. Thank you! Good to know I did it the correct way:)