Skip Navigation

[Résolu] cannot get view to filter to current post

This support ticket is created Il y a 6 années et 1 mois. 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 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 4 réponses, has 2 voix.

Last updated by Shane Il y a 6 années et 1 mois.

Assisted by: Shane.

Auteur
Publications
#621159
Screen Shot 2018-03-01 at 23.53.31.png
Screen Shot 2018-03-01 at 23.53.19.png

Hi there

I have created a Layout for the Product content type.

The product content type has a field for the product City, this field is also being used in the User account as a custom City field with the same select list content being used in the Products.

I have created a google map and display the products on the map. When the user clicks on one of the products on the map, on the popup box a custom message is displayed, the view checks to see if the City field of the Users account matches the Product city field being viewed on the map. It then displays a custom message depending on the result.

This works perfectly fine on the map.

However, on my Layouts page for products, I want to do the same. I am using the below code in another View, whcih i placed in the Layout page:

[wpv-post-title]<br />
[wpv-post-excerpt]<br />
[wpv-conditional if="( $(wpcf-product-state) eq '[types usermeta="user-state" user_current="true" output="raw"][/types]' )"]This Auction is hosted in [types field='product-state'][/types] and you can place a bid - <a href="[wpv-post-url]">BID NOW</a>[/wpv-conditional]
[wpv-conditional if="( $(wpcf-product-state) ne '[types usermeta="user-state" user_current="true" output="raw"][/types]' )"]This Auction is hosted in [types field='product-state'][/types] and you cannot place a bid[/wpv-conditional]

This doesnt seem to work on the Layout page and I cant get the view to filter the results to the current product being viewed (single page). It seems to be displaying ALL results

#621408

Shane
Supporter

Languages: Anglais (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Puoya,

Thank you for contacting our support forum.

Would you mind providing me with admin access to the website so that I can have a look at this for you ?

The private fields will be enabled for your next response.

Thanks,
Shane

#621534

Hi Shane

I wrote the login details here and then logged out and was still able to read the information so i deleted it as anyone can just access my site like this

how do i give you access?

#621555

Shane
Supporter

Languages: Anglais (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Pouya,

Please see the private fields

#622076

Shane
Supporter

Languages: Anglais (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Pouya,

I've Identified the issue and its that the custom fields that you are trying to display are not on the products.

Maybe i'm a bit confused but this shortcode also works on the layout.

[wpv-conditional if="( $(wpcf-product-state) eq '[types usermeta="user-state" user_current="true" output="raw"][/types]' )"]This Auction is hosted in [types field='product-state'][/types] and you can place a bid - <a href="[wpv-post-url]">BID NOW</a>[/wpv-conditional]
[wpv-conditional if="( $(wpcf-product-state) ne '[types usermeta="user-state" user_current="true" output="raw"][/types]' )"]This Auction is hosted in [types field='product-state'][/types] and you cannot place a bid[/wpv-conditional]

Could you let me know what exactly doesn't work.

Thanks,
Shane

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