Skip Navigation

[Resolved] How can I display on sale products (Woocommerce) inside a View ?

This thread is resolved. Here is a description of the problem and solution.

Problem:
How can you filter the WooCommerce products and display only products on sale with Views?

Solution:
You will add a Filter to views for the Custom Field

Product on sale status

and tell Views, what to look for in this Custom Field

WooCommerce returns the Product ID in this Field

So if you want the Views to return only Products that are on sale, try to set the Query to return Products where the Field "Product on sale status" is not equal "." or even empty.

Relevant Documentation:
https://toolset.com/documentation/user-guides/filtering-views-by-custom-fields/

This support ticket is created 8 years, 1 month 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
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Tagged: 

This topic contains 4 replies, has 3 voices.

Last updated by Beda 6 years, 9 months ago.

Assisted by: Beda.

Author
Posts
#378733

With Woocommerce there's simple shortcode to use to display only products which are on sale : [sale_products per_page="12"]

How can we filter the products and display only products on sale with View ?

When I add a filter, I choose "Custom field - Product on sale status" (from Woocommerce Views filter fields), and then I've no idea how to fill the other fields...

By the way, I've only variable products (only the variations will be on sale), will the filter work ?

#378881

Well, you will add the Filter and tell Views, what to look for in this Custom Field "Product on sale status"

WooCommerce returns the Product ID for this and this will not help, as the ID varies each Product.

I would try to set that Query to return Products where the Field "Product on sale status" is not equal "." or even empty.

Does that work?

Thank you

#378916

Yes ! Thank you very much !

I did it with empty.

#542073
Screen Shot 2017-06-27 at 16.59.39.png

I still can't figure this out:

I can make it display my on sale product by putting [wpv-if sale="_sale_price" evaluate="!empty($sale)"] [/wpv-if] around the actual loop item, but have not been able to make it work as a filter

What option do I choose for "is not equal"?

#544973

@guyc, this Thread is resolved, we are not going to reply here

I suggest to not piggy-back old issues, but instead, for fastest and most detailed assistance, open your own, at the forum:
https://toolset.com/forums/forum/support-2/

Thank you!

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