I have a Woocommerce store with more than 1000 products. I would like that all products which have a price below 999 should be shown on a separate page, so I can tag that Page in my menu.
Is it possible?
I have a Woocommerce store with more than 1000 products. I would like that all products which have a price below 999 should be shown on a separate page, so I can tag that Page in my menu.
Is it possible?
Update: (added
'type' => 'DECIMAL',
to themeta_query
array)This can be done using Woocommerce shortcode
[products]
to be used on a page, with the following additional code (that will add the possibility to define a price to be compared through an existing argument):Code goes in function.php file of your active child theme (or active theme). Tested and works.
USAGE:
1) DISPLAY PRODUCTS BELOW A SPECIFIC AMOUNT (YOUR CASE)
You will paste the following shortcode example with as
class
argument valuebelow-999
(for products that have a price below 999):The wordpress page text content editor:
You will get:
2) DISPLAY PRODUCTS ABOVE A SPECIFIC AMOUNT
You will paste the following shortcode example with as
class
argument valueabove-50
(for products that have a price above50
):Available shortcode arguments and settings: Woocommerce shortcodes documentation
See:
$query->posts
to display your post