Skip Navigation

[Resolved] Showing post count from view through wpv-items-found shortcode when conditional check is in place

This support ticket is created 4 years, 2 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

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 1 reply, has 1 voice.

Last updated by SteBlood 4 years, 2 months ago.

Assisted by: Waqar.

Author
Posts
#1766027

My code is as follows

[wpv-layout-start]
[wpv-items-found]
[wpv-found-count]

Stock #
gallery
Caravan
LxW/Bed
Price
Links

[wpv-conditional if="( $(wpcf-price) lte '3000' )"]
[types field='stock-number'][/types]
[types field='main-image' title='%%TITLE%%' alt='%%ALT%%' align='center' size='custom' width="50px" resize='proportional'][/types]
[wpv-for-each start="2" field="wpcf-image-gallery"]

[types field='image-gallery' title='%%TITLE%%' alt='%%ALT%%' size='custom' height='20px' resize='proportional'][/types]

[/wpv-for-each]+ [count_instances field="wpcf-image-gallery"] images
[wpv-post-taxonomy type="caravan-make" format="name"] [types field='caravan-model'][/types]
[wpv-post-taxonomy type="caravan-length" format="name"]x[wpv-post-taxonomy type="caravan-width" format="name"]/[wpv-post-taxonomy type="caravan-bedroom" format="name"]DG: [wpv-post-taxonomy type="double-glazing" format="name"]H: [wpv-post-taxonomy type="caravan-heating" format="name"]
SIV: £[format_money price=[types field='caravan-siv' output='raw'][/types]][/format_money]Price: £[format_money price=[types field='price' output='raw'][/types]][/format_money][wpv-conditional if="( $(wpcf-was-price) ne '' )" evaluate="true"]Was: £[format_money price=[types field='was-price' output='raw'][/types]][/format_money][/wpv-conditional]
[wpv-conditional if="( '[wpv-post-author format='meta' meta='ID']' eq '[wpv-current-user info='id']' )"][wpv-view name="product-update-siv-link" ids='[wpv-post-id]'][/wpv-conditional][wpv-conditional if="( '[wpv-post-author format='meta' meta='ID']' eq '[wpv-current-user info='id']' )"][wpv-view name="product-sell-the-product-link" ids='[wpv-post-id]'][/wpv-conditional]

[/wpv-conditional]

[/wpv-items-found]
[wpv-no-items-found]
[wpml-string context="wpv-views"]No items found[/wpml-string]
[/wpv-no-items-found]
[wpv-layout-end]

I have created a view showing items in conditional, however, I want to count only the items that are output by the conditional statement.

The code I've used above, outputs the 'total' number of posts rather than the number of posts shown in the view

#1766061
#1766557

My issue is resolved now. Thank you!

That solved my issue perfectly, I should have looked a little closer than just to assume the conditional would be the way forward.

However, I learnt how to use conditional statements a little more through this journey.