I don't know, what is it that you want to know if it will work? The conditional on the product's templates?
Yes. At the moment the wiew always show "More Previous Works" and it must show "More Available Works" when the product in the template is on sale or in stock and "More Previous Works" when the product in the template is out of stock.
Can you help me?
"More Previous Works" is part of the view "Other Previous Works in Artwork Page" which I added to the content template of the view
"More Previous Works" is part of the view "Other Previous Works in Artwork Page" which was not part fo the content template of the view "Other Artworks in Artwork Page"
I put both of them now, and we can see both strings:
- hidden link
- hidden link
Thanks but I need that only show "More Previous Works" when the Main Artwork is out of stock by example: hidden link
and only show " More Available Works" when the Main Artwork is instock or by example: hidden link
Both of the views that display the previous or available works from the same Artist are used inside the view "Other Previous Works in Artwork Page". This view does not have visibility over the data(stock info) of the main artwork. We can pass it to it using a shortcode, but we'll need to include it inside the Elementor template using shortcodes. Currently, it is added using an Elementor module(the view module) as you can see here hidden link
We'll be using the wpv-attribute shortcode to get the value of the stock from the main Artwork. Read more about it here https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-attribute
Then, in the "Other Previous Works in Artwork Page", we'll wrap each of the views, that display the previous or available artworks, in the conditional shortcode:
[wpv-conditional if="( '[wpv-attribute name='stock']' eq 'instock' )"]
[wpv-view name="available-artworks-in-artwork-page-2"]
[/wpv-conditional]
[wpv-conditional if="( '[wpv-attribute name='stock']' eq 'outofstock' )"]
[wpv-view name="other-previous-works-in-artwork-page"]
[/wpv-conditional]
And that will do the trick. Check this screenshot hidden link
Keep in mind that a content template is meant to display only one post, and a view is meant to display a list of posts. A content template can be inside a view's loop in order to display the current post in the loop.
I hope this helps. Let me know if you have any questions.
My issue is resolved now. Thank you!