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 - BID NOW[/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
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
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]